[jQuery] possible to have tilted DIVs?
Hi, Daring to dream, I was wondering if jQuery can be used to tilt DIVs. That is, a traditional square can be rotated several degrees to give the appearance of being tilted, or in an extreme case, be tilted 90 degrees to give the appearance of a diamond. Any advice is appreciated, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] input textfield within a DIV that is sortable
Hi, I'm having trouble getting the cursor to focus on a text field within a DIV that has been made sortable. Here is the HTML div id=m12 class=sortList form onsubmit=return get(this)/form table tr tdimg width=100 src=images/roman.jpg alt= border=0/td td valign=top table trtd class=itemHeaderRoman Numeral Converter/td/tr trtd class=itemType in a number in either form./td/tr trtd class=iteminput size=16 /td/tr trtd class=item input type=submit value=Convert/td/tr /table /td /tr /table /form /div and here's the JS ... $('div.listGroup1').Sortable( { accept :'sortList', helperclass : 'sortHelper', activeclass : 'sortableactive', hoverclass :'sortablehover', opacity:0.8, tolerance: 'intersect', onStart : function() { $.iAutoscroller.start(this, document.getElementsByTagName('body')); }, onStop : function() { $.iAutoscroller.stop(); saveDivPositions(); } } ) when I try and click on cursor on the textfield, it won't focus (no cursor appears within the textfield). Any advice on what I can do to enter data in the textfield? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] animating off screen
Hi, Yesterday I got some great help on how to animate a DIV and move it from offscreen left to the middle of the screen. My question now is I want to slide that div to off-screen right. The complication is that I don't know how big the user's browser is going to be. How can I slide the div completely off screen to the right? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] animating off screen
Thanks, Bryan. So if I want to get the viewable width of the screen, would I call Geometry.getHorizontalScroll? - Dave ---Original Message--- From: Bryan McLemore [EMAIL PROTECTED] Subject: Re: [jQuery] animating off screen Sent: Mar 20 '07 16:54 Here is some code from the Geometry lib I've written based on some code out of one of my books and whatnot. if (window.innerWidth) { //All but IE Geometry.getViewportWidth= function() { return window.innerWidth; }; Geometry.getViewportHeight = function() { return window.innerHeight; }; Geometry.getHorizontalScroll = function() { return window.pageXOffset; }; Geometry.getVerticalScroll= function() { return window.pageYOffset; }; } else if (document.documentElement document.documentElement.clientWidth) { // IE6 w/ doctype Geometry.getViewportWidth= function() { return document.documentElement.clientWidth; }; Geometry.getViewportHeight = function() { return document.documentElement.clientHeight; }; Geometry.getHorizontalScroll = function() { return document.documentElement.scrollLeft ; }; Geometry.getVerticalScroll = function() { return document.documentElement.scrollTop; }; } else if (document.body.clientWidth) { // IE4,5,6(w/o doctype) Geometry.getViewportWidth= function() { return document.body.clientWidth; }; Geometry.getViewportHeight = function() { return document.body.clientHeight; }; Geometry.getHorizontalScroll = function() { return document.body.scrollLeft; }; Geometry.getVerticalScroll = function() { return document.body.scrollTop; }; } The Viewport functions will tell you how big the browser window is ( displayable area only) On 3/20/07, [LINK: MAILTO:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Yesterday I got some great help on how to animate a DIV and move it from offscreen left to the middle of the screen. My question now is I want to slide that div to off-screen right. The complication is that I don't know how big the user's browser is going to be. How can I slide the div completely off screen to the right? Thanks, - Dave ___ jQuery mailing list [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ -- -- Bryan McLemore Kaelten ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Plugin to move DIVs?
Hi, What is the most appropriate plug-in that will allow me to slide a DIV horizontally from off-screen to on-screen center? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Plugin to move DIVs?
Thanks for this info. From reading the page, there is still one thing I'm unsure of. If you want your DIV to come in from left to right, (from off-screen to center on screen), what are the parameters that should be passed? Thanks, - Dave ---Original Message--- From: John Beppu [EMAIL PROTECTED] Subject: Re: [jQuery] Plugin to move DIVs? Sent: Mar 19 '07 18:23 You're looking for the Interface plugin: [LINK: http://interface.eyecon.ro/docs/animate] http://interface.eyecon.ro/docs/animate On 3/19/07, [LINK: MAILTO:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, What is the most appropriate plug-in that will allow me to slide a DIV horizontally from off-screen to on-screen center? Thanks, - Dave ___ jQuery mailing list [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to convert class to style='attrs ...'
Hi, I'm trying to write a function to generate MySpace friendly HTML. MySpace does not accept link tags, so the HTML from my page that contains class='whatever', will mean nothing on the mySpace page. My question is, given an element with a class, e.g. td class='myClass'Hello/td, how would I use jQuery to rewrite that element as td style='font-family:verdana;font-size:12px;...Hello/td? Notice I have replaced the class attribute with a style attribute with all the attributes listed out. Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to convert class to style='attrs ...'
---Original Message--- From: Sam Collett [EMAIL PROTECTED] Subject: Re: [jQuery] How to convert class to style='attrs ...' Sent: Mar 15 '07 17:06 On 15/03/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm trying to write a function to generate MySpace friendly HTML. MySpace does not accept link tags, so the HTML from my page that contains class='whatever', will mean nothing on the mySpace page. My question is, given an element with a class, e.g. td class='myClass'Hello/td, how would I use jQuery to rewrite that element as td style='font-family:verdana;font-size:12px;...Hello/td? Notice I have replaced the class attribute with a style attribute with all the attributes listed out. Thanks, - Dave Can't you use style? style type=text/css @import http://example.com/style.css;; /style Sadly, no. They filter out the @import tag. - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to convert class to style='attrs ...'
Thanks but what I am really trying to do is find out all the attributes that define myClass. Below it appears you have hard-coded certain values, but I won't know those ahead of time and there could be different classes per element, each defined differently. Thanks, - Dave ---Original Message--- From: Brandon Aaron [EMAIL PROTECTED] Subject: Re: [jQuery] How to convert class to style='attrs ...' Sent: Mar 15 '07 17:44 I didn't think MySpace allowed JavaScript either? Here is how you could do it. $(function() { $('.myClass').css({ fontFamily:'verdana', fontSize:'12px' }); }); -- Brandon Aaron On 3/15/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm trying to write a function to generate MySpace friendly HTML. MySpace does not accept link tags, so the HTML from my page that contains class='whatever', will mean nothing on the mySpace page. My question is, given an element with a class, e.g. td class='myClass'Hello/td, how would I use jQuery to rewrite that element as td style='font-family:verdana;font-size:12px;...Hello/td? Notice I have replaced the class attribute with a style attribute with all the attributes listed out. Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to convert class to style='attrs ...' [Offtopic]
Hi Javier, Thanks for your thoughtful insight into my question. I will try out this code. It definitely gets me closer to where I want to be. Best regards, - Dave ---Original Message--- From: Javier Infante [EMAIL PROTECTED] Subject: Re: [jQuery] How to convert class to style='attrs...' [Offtopic] Sent: Mar 15 '07 20:05 El jue, 15-03-2007 a las 18:50 +, [EMAIL PROTECTED] escribió: Thanks but what I am really trying to do is find out all the attributes that define myClass. Below it appears you have hard-coded certain values, but I won't know those ahead of time and there could be different classes per element, each defined differently. Thanks, - Dave Hi Dave, I have found your question interesting and i think i have got you a point from where you can start. Alltought the code is not jquery at all maybe some jquery hacker finds it interesenting to develop a small plugin (if i get some time i might give it a try) here goes the code: function getClassContent(classname) { for (var i=0; idocument.styleSheets.length; i++) { var styleSheet=document.styleSheets[i]; var ii=0; var cssRule=false; do { if (styleSheet.cssRules) cssRule = styleSheet.cssRules[ii]; else cssRule = styleSheet.rules[ii]; if (cssRule) { eval (regExp = /\.+classname+/); // I will look for div.classname in the css if (regExp.test(cssRule.selectorText)) return cssRule.style.cssText; } ii++; } while (cssRule); } } alert(getStyleAttribute(infoExtra)); This thing will only work with css rules defined as class (div.myClass), but not with css rules defined for id (div#myId)... allthought i think you could make that work not to hardly. anyway, is this what you were looking for? -- Javier Infante Dpto. Internet y Desarrollo Irontec, Internet y sistemas sobre GNU/Linux - http://www.irontec.com +34 94 404 81 82 - Ext. 202 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] draggables question
Hi, I have two DIVs on my page. Div A contains smaller DIVs that I'd like to be able to drag to DIV B. But if the user doesn't drag DIV A's smaller DIV within part of the boundary of DIV B, I'd like the smaller DIV to return back to where it was. Does JQuery support this? I've looked at the demo http://interface.eyecon.ro/demos/drag.html and I can't find anything that does quite this. Thanks for any help, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] More sensible draggables question
Hi, After reading through the documentation, I have a more sensible question about draggables, overriding the more vague question I asked before. I am trying to create an area where the draggable can be moved and if it is not moved to this area, I would prefer it returns to where it is. I found an attribute containment for the draggable. Sadly, my page does not seem to be respecting the containment. Instead allowing the draggable to be moved anywhere on the screen, regardless of whether it is in the containment area. Can someone help? Here is the snippet of HTML / JS code. div id=worksheetItems class=worksheetItems table tr class=worksheetHeadertdAvailable Worksheets/td/tr trtd id=worksheetItemArea div id=w1table tr tdimg src=images/pdficon.gif alt= border=0/td td class=worksheetItemWorksheet 1/td /tr /table/div /td /tr/table /div script type=text/javascript $(document).ready( function () { $('#w1').Draggable( { zIndex: 1000, containment:'userWIArea', ghosting: false, opacity:0.7 } ); } ) /script /td tddiv id=userWorksheetItems class=userWorksheetItems table tr class=worksheetHeadertdMy Custom Worksheet/td/tr trtd id=userWIArea/td/tr /table /div /td /tr /table Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to test if droppable has accepted a draggable?
Hi, Thanks for Erik's previous response. I have a new question on this subject. If I have defined draggables with class drag a droppable zone with id = dropzone1, once I have finished dragging my item, how do I test if it has been accepted by dropzone1? Further, if it has not been accepted, how do I send the draggable item back to its original position? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Sortables question: one for the experts
Hi, I have two DIVs, one on the left, one on the right, each full of mini-DIVs. My question is, I want to drag mini-DIVs from the left DIV to the right DIV, with everything in the right DIV being Sortable. However, I do not want any fo the DIVs in the left to be sortable, but I would like the mini-DIVs from the left to be able to be Sortable if they are dragged to the right DIV. Could someone tell me what are the first steps to begin to do this? Thanks for your help, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] get class name
Hi, What is the jQuery syntax to ge the class name of an item with a known id? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] finding closest ancestor matching a pattern
Hi, I am trying to find the closest ancestor whose id begins with childrenTOC. I am invoking the function within the onclick handler of the element with class toggleStrike. Previously, I was given this code $(this).parents([EMAIL PROTECTED]); but that seems to return an arrray of elements, and I just want the closest one. Here is the HTML in question ... div id=childrenTOC10 style=display:block div id=toc11 class=tocItem10-0 style=display:block; margin-left:10px div style=display:blocktable tbody tr tda id=openClose164 class=openClose href='#' onClick=javascript:toggleTOCItem('childrenTOC11', 'childrenTOC10', 0);img name=imgchildrenTOC11 src=images/tree_open.gif alt= border=0/a/td td style=text-decoration:none id=item164 class=title1Unit 1: Our Land and First People/td tda class=readMore href='#'Read/a/td tda href='#' class=toggleStrikeRemove/a/td /tr /tbody /table/div Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to get the response text of an .ajax call?
Hi, Simple question. How do I get the response text of an ajax call? Right now, my call is returning an XMLHttpRequest object, but I don't know how to extract the plain text that I'm expecting. here's the code var responseData = $.ajax({ type: POST, url: url, data: paramStr, dataType: text, async: false, error: function(request, msg){ alert( Error upon saving request: + msg ); }, success: function(request) { // alert( Saved ); } }); alert(responseData); var responseText = responseData.html(); As you may have guessed, there is a JS error on the last line of code. Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] how to find an item when you only know part of the class name
Hi, I have a DIV whose ID I know. Within that DIV is a table with a table cell which either has a class beginning with the word title and followed by an integer. I would like to reference the text within that table cell. What is the easiest way to get a reference to this cell? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] how to find an item when you only know part of the class name
---Original Message--- From: Jake McGraw [EMAIL PROTECTED] Subject: Re: [jQuery] how to find an item when you only know part of the class name Sent: Mar 02 '07 22:46 You can reference any attribute using the following notation: [EMAIL PROTECTED] Starts with [EMAIL PROTECTED] Ends with [EMAIL PROTECTED] equals [EMAIL PROTECTED] contains So for your problem... $([EMAIL PROTECTED]) Hope this helps, - jake On 3/2/07, [LINK: MAILTO:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I have a DIV whose ID I know. Within that DIV is a table with a table cell which either has a class beginning with the word title and followed by an integer. I would like to reference the text within that table cell. What is the easiest way to get a reference to this cell? Thanks, - Dave ___ jQuery mailing list [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ I appreciate your reply. I'm still not finding the element, and I wanted to ask what I was doing wrong. The JS is $(document).ready( function () { $('a.toggleStrike').click( function() { var parentDiv = $(this).parents([EMAIL PROTECTED]); alert(parentDiv[0].id); var tdElt = parentDiv.find([EMAIL PROTECTED]); alert(tdElt[0].id); var textDecor = tdElt.css('text-decoration'); var newDecor = textDecor == line-through ? none : line-through; tdElt.css('text-decoration', newDecor); }); } ) and a sample HTML div would be div id=toc25 class=tocItem15-2 style=display:block; margin-left:30px div style=display:blocktable tr td/td td style=text-decoration:none class=title3Lesson 1 Core Ancient Americans/td tda class=readMore href='#'Read/a/td tda href='#' class=toggleStrikeRemove/td /tr /table/div /div The first alert displays the correct value, but the second alert displays a blank box and subsequently everything in the highest level table gets a strike through it when I just want this one cell. Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] how to find an item when you only know part of the class name
---Original Message--- From: Jake McGraw [EMAIL PROTECTED] Subject: Re: [jQuery] how to find an item when you only know part of the class name Sent: Mar 02 '07 23:19 Not sure if the source is like this too, but you haven't closed this element (insert a /a): a href='#' class=toggleStrikeRemove/a /td Maybe, that'll help? - jake On 3/2/07, [LINK: MAILTO:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ---Original Message--- From: Jake McGraw [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: [jQuery] how to find an item when you only know part of the class name Sent: Mar 02 '07 22:46 You can reference any attribute using the following notation: [EMAIL PROTECTED] Starts with [EMAIL PROTECTED] Ends with [EMAIL PROTECTED] equals [EMAIL PROTECTED] contains So for your problem... $([EMAIL PROTECTED]) Hope this helps, - jake On 3/2/07, [LINK: MAILTO: [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I have a DIV whose ID I know. Within that DIV is a table with a table cell which either has a class beginning with the word title and followed by an integer. I would like to reference the text within that table cell. What is the easiest way to get a reference to this cell? Thanks, - Dave ___ jQuery mailing list [LINK: mailto:[LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com [LINK: [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/] [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ I appreciate your reply. I'm still not finding the element, and I wanted to ask what I was doing wrong. The JS is $(document).ready( function () { $('a.toggleStrike').click( function() { var parentDiv = $(this).parents([EMAIL PROTECTED]); alert(parentDiv[0].id); var tdElt = parentDiv.find([EMAIL PROTECTED]); alert(tdElt[0].id); var textDecor = tdElt.css('text-decoration'); var newDecor = textDecor == line-through none : line-through; tdElt.css('text-decoration', newDecor); }); } ) and a sample HTML div would be div id=toc25 class=tocItem15-2 style=display:block; margin-left:30px div style=display:blocktable tr td/td td style=text-decoration:none class=title3Lesson 1 Core Ancient Americans/td tda class=readMore href='#'Read/a/td tda href='#' class=toggleStrikeRemove/td /tr /table/div /div The first alert displays the correct value, but the second alert displays a blank box and subsequently everything in the highest level table gets a strike through it when I just want this one cell. Thanks, - Dave ___ jQuery mailing list [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ That was indeed a problem. Sadly, even after I remedied that, I still get the same result -- the second alert shows a blank value and the entire table gets a line through it. - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] appending text nodes
Hi, I want to append text to a node. I'm using this code $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append(val); but if the variable val contains special characters, like td, that will mess up the rest of my tree. What is the best way to handle this? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] appending text nodes
---Original Message--- From: Kristinn Sigmundsson [EMAIL PROTECTED] Subject: Re: [jQuery] appending text nodes Sent: Feb 22 '07 15:42 Hm, you empty it and then append to it? wouldn't that be the same as using .html(val)? If that is what you'd want to do, try the .text() command: $(this).parents(div.sidebarToDo).find(td.sidebarText).text(val) contents of td.sidebarText will be replaced with val On 2/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I want to append text to a node. I'm using this code $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append(val); but if the variable val contains special characters, like td, that will mess up the rest of my tree. What is the best way to handle this? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Thanks. This is what I wanted to do. One further question about the text command. I'm getting a JS error when I try to implement the following: $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append(input type=\text\ size=\10\ class=\editableTDItem\ value=\ + $.text(item) + \); Your thoughts? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] appending text nodes
Thanks. I incorporated your suggestion ... this is where item was coming from var item = $(this).parents(div.sidebarToDo).find(td.sidebarText).text(); Things work great. - Dave ---Original Message--- From: Karl Swedberg [EMAIL PROTECTED] Subject: Re: [jQuery] appending text nodes Sent: Feb 22 '07 16:17 Hi Dave, Not sure where the item variable is coming from, but you can try setting the variable first with .text() and then just including that variable name in the append string. Something like this: var item = $('your-selector-goes-here').text(); And then, instead of $.text(item) in the append string, just use item. So: $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append(input type=\text\ size=\10\ class=\editableTDItem\ value=\ + item + \); --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 22, 2007, at 11:06 AM, [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ---Original Message--- From: Kristinn Sigmundsson [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: [jQuery] appending text nodes Sent: Feb 22 '07 15:42 Hm, you empty it and then append to it? wouldn't that be the same as using .html(val)? If that is what you'd want to do, try the .text() command: $(this).parents(div.sidebarToDo).find(td.sidebarText).text(val) contents of td.sidebarText will be replaced with val On 2/22/07, [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I want to append text to a node. I'm using this code $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append(val); but if the variable val contains special characters, like td, that will mess up the rest of my tree. What is the best way to handle this? Thanks, - Dave ___ jQuery mailing list [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ Thanks. This is what I wanted to do. One further question about the text command. I'm getting a JS error when I try to implement the following: $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append(input type=\text\ size=\10\ class=\editableTDItem\ value=\ + $.text(item) + \); Your thoughts? Thanks, - Dave ___ jQuery mailing list [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Reference to the last DIV in a group?
Hello, I have a main div, with id= todoList, and within it, a number of DIVs, all with classes sidebarToDo. Let's say I have just added a DIV to the DOM ... $('#todoList').append('div class=sidebarToDo width=100%Hello/div'); How do I now get a reference to this last DIV with class sidebarToDo? Notice it doesn't have an ID, but it is the last one in the master todoList DIV. Thanks so much. This discussion group is excellent. - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Reference to newly inserted item?
Hi, If I have $(this).parents(div.sidebarToDo).find(td.sidebarText).empty().append('input type=text value= size=10 class=editableItem'); What is the best way to get a reference to the newly created text field? Note that it does not have an ID and I would prefer a more generic way of finding it other than input.editableItem because on PC IE 6, if I insert multiple text fields, like the above, this call ... $(this).parents(div.sidebarToDo).find(input.editableTDItem); only returns a correct reference for the first time a textfield is added. I cant get the most recent addition with the above call if there had been text fields added in the past. Thanks, please let me know what info I can provide to make this question more clear, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] How to get the ID of the parent node?
Hi, Following up from a question I asked yesterday, I wanted to get the closest parent DIV given an arbitrary nested element. But when I request the .id of that element, i repeatedly get an undefined message, even though this call, $(this).parent(div.sidebarToDo) yields an object. $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).id; alert(divId); // alwasy gives 'undefined' $(this).click = function() { $('#' + divId).remove(); }; }); This is the HTML in question: div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput id=cbTdId3 onClick=var textDecor = (this.checked ? 'line-through' : 'none'); $('#textId3').css('text-decoration', textDecor); type=checkbox id=tdcb3 /td td id=textId3 class=sidebarText style=text-decoration: noneStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href=javascript:toggleDiv('dToDo3');img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to get the ID of the parent node?
---Original Message--- From: Chris Ovenden [EMAIL PROTECTED] Subject: Re: [jQuery] How to get the ID of the parent node? Sent: Feb 21 '07 16:04 On 2/21/07, SAM COLLETT [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 21/02/07, [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Following up from a question I asked yesterday, I wanted to get the closest parent DIV given an arbitrary nested element. But when I request the .id of that element, i repeatedly get an undefined message, even though this call, $(this).parent( div.sidebarToDo) yields an object. $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).id; alert(divId); // alwasy gives 'undefined' $(this).click = function() { $('#' + divId).remove(); }; }); This is the HTML in question: div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput id=cbTdId3 onClick=var textDecor = (this.checked ? 'line-through' : 'none'); $('#textId3').css('text-decoration', textDecor); type=checkbox id=tdcb3 /td td id=textId3 class=sidebarText style=text-decoration: noneStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href=javascript:toggleDiv('dToDo3');img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks, - Dave You can get the id via attr: $(this).parent(div.sidebarToDo).attr(id) To spell it out a little more clearly, the API for attributes has changed in jQuery 1.0.3+ and shortcuts like .id() no longer work -- Chris Ovenden [LINK: http://thepeer.blogspot.com] http://thepeer.blogspot.com Imagine all the people / Sharing all the world Thanks, but I'm still getting undefined even though I can an object for my reference to the DIV. Any ideas on how to troubleshoot? here's the JS: $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).attr(id); alert($(this).parent(div.sidebarToDo) + id: + divId); $(this).click = function() { $('#' + divId).remove(); }; }); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] How to get the ID of the parent node?
---Original Message--- From: Sam Collett [EMAIL PROTECTED] Subject: Re: [jQuery] How to get the ID of the parent node? Sent: Feb 21 '07 17:19 On 21/02/07, Sam Collett [EMAIL PROTECTED] wrote: On 21/02/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ---Original Message--- From: Chris Ovenden [EMAIL PROTECTED] Subject: Re: [jQuery] How to get the ID of the parent node? Sent: Feb 21 '07 16:04 On 2/21/07, SAM COLLETT [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On 21/02/07, [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Following up from a question I asked yesterday, I wanted to get the closest parent DIV given an arbitrary nested element. But when I request the .id of that element, i repeatedly get an undefined message, even though this call, $(this).parent( div.sidebarToDo) yields an object. $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).id; alert(divId); // alwasy gives 'undefined' $(this).click = function() { $('#' + divId).remove(); }; }); This is the HTML in question: div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput id=cbTdId3 onClick=var textDecor = (this.checked ? 'line-through' : 'none'); $('#textId3').css('text-decoration', textDecor); type=checkbox id=tdcb3 /td td id=textId3 class=sidebarText style=text-decoration: noneStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href=javascript:toggleDiv('dToDo3');img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks, - Dave You can get the id via attr: $(this).parent(div.sidebarToDo).attr(id) To spell it out a little more clearly, the API for attributes has changed in jQuery 1.0.3+ and shortcuts like .id() no longer work -- Chris Ovenden [LINK: http://thepeer.blogspot.com] http://thepeer.blogspot.com Imagine all the people / Sharing all the world Thanks, but I'm still getting undefined even though I can an object for my reference to the DIV. Any ideas on how to troubleshoot? here's the JS: $('#todoList a.deleteTDItem').each(function(index) { var divId = $(this).parent(div.sidebarToDo).attr(id); alert($(this).parent(div.sidebarToDo) + id: + divId); $(this).click = function() { $('#' + divId).remove(); }; }); I would have thought that would have worked.. you could always try: $(this).parent(div.sidebarToDo)[0].id I think I have an idea of what you are trying to do - hide the todo item when delete is clicked, and put a line through the task if the checkbox is checked (i.e. task completed). In that case, the HTML can be tidied up a bit (I've removed the id's to improve readability, and also noticed that you had two defined on the checkbox): div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput type=checkbox name=completed/td td class=sidebarTextStart Work/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href='#'img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div And the following JavaScript used: $('#todoList a.deleteTDItem').click( function() { alert(clicked); $(this).parent(div.sidebarToDo).remove(); return false; }); That should be: $('#todoList a.deleteTDItem').click( function() { $(this).parents(div.sidebarToDo).remove(); return false; }); $('#todoList :checkbox').click( function() { var textDecor = (this.checked ? 'line-through' : 'none'); $(this).parent().find(td.sidebarText).css('text-decoration', textDecor); }); You guessed correctly on the bigger picture of what I'm trying to do. Thanks to all for their responses. The s thing solved the biggest hurdle I was trying to get over. - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Easiest way to add elements on the fly?
Hi, If, after the document has fully loaded, I want to append a DIV to the end of another DIV with id = todoList, what is the easiest way to do that? The HTML code that I want to append is below ... div class=sidebarToDo width=100% id=dToDo3 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput type=checkbox name=completed/td td class=sidebarTextinput type=text size=10 name=newItem id=newItem/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href='#'img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Right way to set line-through?
Hi, How do I use JQuery to set the text-decoration of an element with ID id1 to line-through? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Sortables question
Regarding the sortables plug-in and the specific example http://interface.eyecon.ro/demos/sort_lists.html does anyone know how I would iterate over the items in the list in the order in which they appear on screen? My goal is to list the ids in the order they appear. Your help is greatly appreciated as always, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Sortables question
---Original Message--- From: Blair Mitchelmore [EMAIL PROTECTED] Subject: Re: [jQuery] Sortables question Sent: Feb 20 '07 18:29 $('ol.steps li').each(function(index) { $(this).append('span class=asideList item ' + (index + 1) + '/span'); }); Would convert: ol class=steps liCut a hole in a box/li liPut your junk in that box/li liMake her open the box/li /ol into: ol class=steps liCut a hole in a boxspan class=asideList item 1/span/li liPut your junk in that boxspan class=asideList item 2/span/li liMake her open the boxspan class=asideList item 3/span/li /ol ...I think... If each li element has an id attribute you can access them by using this.id inside the each iterator function. -blair [EMAIL PROTECTED] wrote: Regarding the sortables plug-in and the specific example http://interface.eyecon.ro/demos/sort_lists.html does anyone know how I would iterate over the items in the list in the order in which they appear on screen? My goal is to list the ids in the order they appear. Your help is greatly appreciated as always, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Beautiful! Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] easy way to get checkbox state from within a DIV
Hi, I'm sure there's a shorthand way to do this. I'm trying to get the checked state of a checkbox, the only one, within a particular DIV. I would prefer not to use the ID of the checkbox but some more generic way of referring to the only checkbox within the DIV, id=dToDo1. I am fine to use the ID of the DIV in the shorthand expression. Here's how the HTML looks: div class=sidebarToDo width=100% id=dToDo1 table cellpadding=0 cellspacing=0 border=0 width=100% tr tdinput id=cbTd1 onClick=var textDecor = (this.checked ? 'line-through' : 'none'); $('#textId1').css('text-decoration', textDecor); type=checkbox id=tdcb1 /td td id=textId1 class=sidebarText style=text-decoration: noneWake Up/td td align=righta class=editTDItem href='#'img src=images/edit.gif alt=Edit border=0/a/td td align=righta class=deleteTDItem href=javascript:toggleDiv('dToDo1');img src=images/deleteLink.gif alt=Delete border=0/a/td /tr /table /div Thanks for your help, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] easy way to get checkbox state from within a DIV
---Original Message--- From: Chris Domigan [EMAIL PROTECTED] Subject: Re: [jQuery] easy way to get checkbox state from within a DIV Sent: Feb 20 '07 20:48 Oops, replace input.checked with input:checked. :) ___ jQuery mailing list [LINK: [EMAIL PROTECTED] discuss@jquery.com [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/ Thanks. This indeed worked. One follow up question, if I want to iterate over all the anchor tags in this same block with the class, deleteAnchor, how would I invoke them? - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Getting parent nodes
Hi, If I have a this.id reference to an element in my DOM, how would i get its parent node? More challenging, how would I get the first DIV node that the element is in? That is, it may be nested within an arbitrary number of table cells, but there is a DIV lurking at the top ... div id=outer div id=inner table trtd table trtd!-- here's the element -- In the example here, I would like to get a reference to the DIV with ID = inner. Thanks, you guys are the best, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Bug in jquery related to text elements?
Hi, Is anyone familiar with a bug in JQuery where including the jquery.js library on your page seems to disassociate text elements from their parent forms? This is the text element I have that no longer recognizes its parent form when I call alert(document.getElementById('PM16033-1497').form.name);. I get a JS error, document.getElementById ... .form has no properties. input onChange=if (this.value != '') {isValidQty(this)}; type=text size=4 name=PM16033-1497 id=PM16033-1497 value= Thanks, - ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Rounded corners question
Hi, Please disregard my previous post about a bug in jquery and text elements. I wish to revise that by saying, when I include jquery, the jq-corner.js library and then include this code script type=text/javascript $(function(){ $('.inner').wrap('div class=outer/div'); $('.inner').each(function() { $(this).corner(round 5px).parent().css('padding', '1px').corner(round 6px); }); }); /script the text elements within the DIV inner get disassociated from the parent form -- that is, when I submit the form, the elements are no longer a part of them. Here is the HTML for one of my DIVs. The text element PM16033-1497 is getting dropped from the form. Any advice on how to overcome this problem is greatly appreciated. - Dave div class=inner table cellpadding=0 cellspacing=0 border=0 tr td align=center valign=topimg src=images/ICO-TONER.jpg alt= border=0/td td table cellpadding=0 cellspacing=0 border=0 tr td table width=100% cellpadding=0 cellspacing=0 border=0 tr class=orderFormPrinterName tdspan class=orderFormPrinterNameSmallprinter name:/spannbsp; span class=orderFormPrinterNameLargecustomPrinter/span/td tdspan class=orderFormPrinterNameSmalldepartment:/spannbsp; span class=orderFormPrinterNameLargeMain/span/td /tr /table /td /tr trtdspan class=orderFormPrinterModelSmallprinter model:/span span class=orderFormPrinterModelLargeMyManufacturer MyPrinter/span/td/tr trtd width=540img src=images/ICO-cartridge_legend.gif alt= border=0/td/tr trtd style=border-bottom-width:1px; border-bottom-style:solid; border-bottom-color:#5E5F5F; table width=100% cellpadding=0 cellspacing=0 border=0 tr td style=width:40px; class=orderFormColor img src=/usr/local/apache2/images/colors/ alt= border=0 /td td table width=100% cellpadding=0 cellspacing=0 border=0 tr td style=width:260px; padding:3px; class=orderFormCartridgeNameabcd / span style=font-weight:bold;MyCartridge/span/td td style=width:53px; padding:3px; class=orderFormRetailPrice align=center$15.00/td td style=width:55px; padding:3px; class=orderFormYourPrice align=center$7.50/td td style=width:20px; class=orderFormCartridgeNamenbsp;/td /tr trtd colspan=4 class=orderFormCartridgeDesc style=padding:3px; width:388px;/td/tr /table /td
[jQuery] jqModal: How to invoke functions after ajax has loaded?
Hi, Using jqModal, if I define that my dialog load its contents through ajax $('#editPanelTitle').jqm({trigger: '#editTitle1', focus: true, overlayColor: '#fff', overlay: 30, ajax: panel_title.html}, function(h) { /* do stuff */ }); how do I invoke a JS function once the ajax contents have been loaded? The onOpen argument of the jqModal doesn't seem to work because I'm not guaranteed the ajax call will be loaded. Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Why isn't my Ajax call working?
Hi, I'm sure this is really simple, but here is my dilemma. I'm trying to make an Ajax call to get some response text. However, when I make the call, my html variable is coming up empty. Additionally, my error function is never invoked. function loadModuleHTML(p_id, p_moduleIndex) { var html = $.ajax({ type: POST, url: get_file_contents.php, data: mod_index= + p_moduleIndex, dataType: html, error: function(req, errorMsg) { alert(An error occurred: + errorMsg); } }).responseText; alert(html);// This always returns a blank alert box. document.getElementById(p_id).innerHTML = div class=\sortListInner\ + html + /div; }// loadModuleHTML $().ready(function() { loadModuleHTML('li0', 0); }); If I hard code the URL mydomain.com/get_file_contents.php?mod_index=0 into my browser, I get valid HTML returned. Any ideas what's going on? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Why isn't my Ajax call working?
---Original Message--- From: Jake McGraw [EMAIL PROTECTED] Subject: Re: [jQuery] Why isn't my Ajax call working? Sent: Feb 16 '07 22:33 Which PHP array are you using to access user variables? If you're using $_GET, then your AJAX Post variables won't show up in the application, I usually use $_REQUEST. Also, have you thought of using the jQuery ajax abstraction methods? Something like this should do the trick (not tested): $.ajaxError(function(request, settings){ alert('An error has occurred!'); }); function loadModuleHTML(p_id, p_moduleIndex) { $.post('get_file_contents.php',{mod_index:p_moduleIndex},function(data){ $(#+p_id).empty().append('div class=sortListInner'+data+'/div'); }); $(function(){ loadModuleHTML('li0',0); }); I noticed that you're using some plain Jane JavaScript, like 'getElementById', etc. In case you haven't already, you should check out all the amazing things jQuery can do besides ajax. - jake On 2/16/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm sure this is really simple, but here is my dilemma. I'm trying to make an Ajax call to get some response text. However, when I make the call, my html variable is coming up empty. Additionally, my error function is never invoked. function loadModuleHTML(p_id, p_moduleIndex) { var html = $.ajax({ type: POST, url: get_file_contents.php, data: mod_index= + p_moduleIndex, dataType: html, error: function(req, errorMsg) { alert(An error occurred: + errorMsg); } }).responseText; alert(html);// This always returns a blank alert box. document.getElementById(p_id).innerHTML = div class=\sortListInner\ + html + /div; }// loadModuleHTML $().ready(function() { loadModuleHTML('li0', 0); }); If I hard code the URL mydomain.com/get_file_contents.php?mod_index=0 into my browser, I get valid HTML returned. Any ideas what's going on? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Thanks for this info. Unfortunately, I'm getting a JS error $.ajaxError is not a function. My code is below. Is that the right syntax or do I need to be using a more current version of jQuery? $.ajaxError(function(request, settings){ alert('An error has occurred!'); }); function loadModuleHTML(p_id, p_moduleIndex) { $.post('get_file_contents.php', {mod_index:p_moduleIndex}, function(data){ $(#+p_id).empty().append('div class=sortListInner'+data+'/div'); }); } $(function(){ loadModuleHTML('li0',0); }); Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Why isn't my Ajax call working?
---Original Message--- From: Jake McGraw [EMAIL PROTECTED] Subject: Re: [jQuery] Why isn't my Ajax call working? Sent: Feb 16 '07 22:58 Sorry, that function needs to be attached to jQuery object... if you're just going to put up an alert box, you can use: $(document).ajaxError(function(request, settings){ alert('An error has occurred!'); }); That should work, I think. - jake On 2/16/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: ---Original Message--- From: Jake McGraw [EMAIL PROTECTED] Subject: Re: [jQuery] Why isn't my Ajax call working? Sent: Feb 16 '07 22:33 Which PHP array are you using to access user variables? If you're using $_GET, then your AJAX Post variables won't show up in the application, I usually use $_REQUEST. Also, have you thought of using the jQuery ajax abstraction methods? Something like this should do the trick (not tested): $.ajaxError(function(request, settings){ alert('An error has occurred!'); }); function loadModuleHTML(p_id, p_moduleIndex) { $.post('get_file_contents.php',{mod_index:p_moduleIndex},function(data){ $(#+p_id).empty().append('div class=sortListInner'+data+'/div'); }); $(function(){ loadModuleHTML('li0',0); }); I noticed that you're using some plain Jane JavaScript, like 'getElementById', etc. In case you haven't already, you should check out all the amazing things jQuery can do besides ajax. - jake On 2/16/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I'm sure this is really simple, but here is my dilemma. I'm trying to make an Ajax call to get some response text. However, when I make the call, my html variable is coming up empty. Additionally, my error function is never invoked. function loadModuleHTML(p_id, p_moduleIndex) { var html = $.ajax({ type: POST, url: get_file_contents.php, data: mod_index= + p_moduleIndex, dataType: html, error: function(req, errorMsg) { alert(An error occurred: + errorMsg); } }).responseText; alert(html);// This always returns a blank alert box. document.getElementById(p_id).innerHTML = div class=\sortListInner\ + html + /div; }// loadModuleHTML $().ready(function() { loadModuleHTML('li0', 0); }); If I hard code the URL mydomain.com/get_file_contents.php?mod_index=0 into my browser, I get valid HTML returned. Any ideas what's going on? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Thanks for this info. Unfortunately, I'm getting a JS error $.ajaxError is not a function. My code is below. Is that the right syntax or do I need to be using a more current version of jQuery? $.ajaxError(function(request, settings){ alert('An error has occurred!'); }); function loadModuleHTML(p_id, p_moduleIndex) { $.post('get_file_contents.php', {mod_index:p_moduleIndex}, function(data){ $(#+p_id).empty().append('div class=sortListInner'+data+'/div'); }); } $(function(){ loadModuleHTML('li0',0); }); Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ It does. Thanks, Jake. I have seen the light! - ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Can't get a 1 pixel rounded corner
Hello, Following advice on this mailing list, I visited http://www.malsup.com/jquery/corner/ to learn how to create a rounded border that was a different color than the inner DIV. I want to create a 1 pixel border, and so I changed the code in the first Adornment example to read ... $(this).corner(round 8px).parent().css('padding', '1px').corner(round 10px) but in both PC IE and Firefox, at the upper left and right box corners, you can see pointy box corners, whereas at the bottom, the corners round smoothly. How can I adjust the above to make the top corners as smooth as the bottom ones? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Can't get a 1 pixel rounded corner
---Original Message--- From: Dave Methvin [EMAIL PROTECTED] Subject: RE: [jQuery] Can't get a 1 pixel rounded corner Sent: Feb 15 '07 17:36 $(this).corner(round 8px).parent().css('padding', '1px').corner(round 10px) Unless Mike Alsup's recent changes removed this limitation, you need to have at least as much padding as the corner height. That might cause what you are seeing. See the Tips and Tricks section here: http://methvin.com/jquery/jq-corner.html Thanks for your reply. By corner height, what would that be in the above example? - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Can't get a 1 pixel rounded corner
---Original Message--- From: Mike Alsup [EMAIL PROTECTED] Subject: Re: [jQuery] Can't get a 1 pixel rounded corner Sent: Feb 15 '07 17:47 Following advice on this mailing list, I visited http://www.malsup.com/jquery/corner/ to learn how to create a rounded border that was a different color than the inner DIV. I want to create a 1 pixel border, and so I changed the code in the first Adornment example to read ... $(this).corner(round 8px).parent().css('padding', '1px').corner(round 10px) but in both PC IE and Firefox, at the upper left and right box corners, you can see pointy box corners, whereas at the bottom, the corners round smoothly. How can I adjust the above to make the top corners as smooth as the bottom ones? Dave, There are some practical limitations with this adornment approach. But usually after a little experimenting you'll find something that works. For example, in your case, using a smaller border radius works well: $(this).corner(round 5px).parent().css('padding', '1px').corner(round 6px) With our implementation the acceptable border width (padding) is constrained by the corner radius. The larger the radius, the larger the padding required to hide the inner corner. Mike I read this after posting my last reply. This works perfectly. Thanks for taking the time to explain. - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Centering jqmodal dialog windows
Hi, What is the easiest way to center a jqModal dialog window? The examples from http://dev.iceburg.net/jquery/jqModal/ seem to have the windows at fixed points on the screen. Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Centering jqmodal dialog windows
---Original Message--- From: Benjamin Sterling [EMAIL PROTECTED] Subject: Re: [jQuery] Centering jqmodal dialog windows Sent: Feb 15 '07 18:28 Dave, you need to do something like: .jqWindow{ position:absolute; width:300px; height: 300px; margin:-150px 0 0 -150px; left:50%; top:50%; } -- Benjamin Sterling [LINK: http://www.KenzoMedia.com] http://www.KenzoMedia.com [LINK: http://www.KenzoHosting.com] http://www.KenzoHosting.com Thanks for this reply, unfortunately, when I defined the id for my class as #editPanelTitle { position:absolute; font-family:verdana,tahoma,helvetica; width: 400px; display:none; top:50%; left:50%; } the jqmodal window appeared at the right of the screen, about 100 pixels down from the top, but definitely not vertically aligned. When I added the margin property you suggested, the window did not appear at all. No JS errors were reported. - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] rounding the corners but making the background transparent
Hi, I used this JS to make my borders rounded ... $().ready(function() { $('#editPanelTitle').corner(); }); Here is the class-id definition: #editPanelTitle { background: #ff; position:absolute; font-family:verdana,tahoma,helvetica; width: 400px; display:none; } Problem is, the corners get rounded, but if I float my DIV above other elements, the space between the rounded corner and the normal rectangular corner is filled with white background, and I would prefer that this space be transparent, allowing you to see the elements behind. Is that possible? Is my question clear enough? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jqModal: Defining a custom event before closing the window?
Hi, I'm trying to create a modal dialog using http://dev.iceburg.net/jquery/jqModal/ where I want to have two buttons, Save and 'Cancel. Clicking Save should perform some action, and then close the window. However, if I define the onclick handler for the Save button, the window no longer closes. How can I execute the functions of my Save and then close the modal dialog window? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jqModal: Defining a custom event before closing the window?
Thanks Chris, This sounds like a winning idea. I'm still new to JQuery and its plug-ins and syntax, but if the ID of my save button is saveButton, how would I invoke '.trigger(#cancelButton)'? Would it be ... input type=button id=saveButton value=Save onclick=doStuff(); .trigger('#cancelButton'); ? - Dave ---Original Message--- From: Chris Domigan [EMAIL PROTECTED] Subject: Re: [jQuery] jqModal: Defining a custom event before closing the window? Sent: Feb 14 '07 22:57 You could just set Cancel as the only button that closes the window. Then at the end of your Save action, just do .trigger(#cancelButton); Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jqModal: Defining a custom event before closing the window?
Rock on! Works perfectly. Thanks so much, - ---Original Message--- From: Chris Domigan [EMAIL PROTECTED] Subject: Re: [jQuery] jqModal: Defining a custom event before closing the window? Sent: Feb 14 '07 23:18 Ah whoops! You use it like this: $(#cancelButton).trigger(click); I must be half asleep... :) Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Rounded corners question
I was checking out the rounded corners jquery page: http://methvin.com/jquery/jq-corner-demo.html . I wanted to create a rounded corners DIV in which the rounded border color is black and the rest of the cell is white.On the page above, the border is the same color as the background. How would one work the above so that you have a different color border? If the above can't do it, do you know a jquery plug-in that can? Thanks, - Dave ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/