[jQuery] Problem with 1.1 and metadata
At some point, it appears that window (as in, the JS object) gets run through the setArray function that metadata overloads. The window object doesn't have getElementsByTagName, so when I've done $.meta.setType(elem, script), I get: this.getElementsByTagName is not a function var e = this.getElementsByTagName($.meta.name); Adding a check for getElementsByTagName fixed it: } else if ( $.meta.type == elem ) { if( !this.getElementsByTagName ) return; // Added this var e = this.getElementsByTagName($.meta.name); --Erik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .height(val) - what am I missing?
Theo Welch wrote: I'm not sure if this is the issue, Adam, but have you tried using a string for the height value instead of an integer... I did try everything here for the value just to be sure, but 1.1 should handle strings or integers according to what I've read - 600 with be 600px, 50em with be 50em, and so on (and it does). Problem was the DOM hadn't loaded, you guys were right about that. I was under the mistaken impression that the $(...) worked as $(fn) for document.ready. Now I know. Just curious, what is the difference between $(fn) and the 'failsafe jQuery' code jQuery(function($) {...}); ? Adam -- View this message in context: http://www.nabble.com/.height%28val%29---what-am-I-missing--tf3015887.html#a8386315 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
Hi Lukas, I've got around problems like this in the past by ensuring you have explicitly specified height and width on the elements before you fade them*. Also, Show() in IE is affected when ClearType is enabled in Windows, but you can get around this by specifying element background color (other than transparent or blank). If you're experiencing either of these problems then they're just mad IE/JS quirks rather than JQuery faults. Cheers, George * You can use JQuery to measure and set the width and/or height for you before the first fade or hide. Lukas Pitschl wrote: hi list, i'm terribly sorry to litter this list with all IE7 problems, but unfortunately i have to have my sites working in that s browser too, so i can't hesitate to ask. fadeOut doesn't seem to work on divs if triggered twice or more times. it works if only triggered once, but it seems that opacity is not restored, or the opacity filter is not removed after fading out and then reactivating the div with $('#some_mane').show(). is there any workaround? thx for help lukas ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/IE-7-fadeIn%2C-fadeOut-problem-tf3018206.html#a8386649 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Controlling focus on alert box created in jQuery
in genaral alert message focus only to alert only, we can't move anywhere.here we are not using alert,and making own alert window,and i am unable to focus on that,here we can move anywhere i.e in background that should not. here is my code: function show_warning(e_msg, m_info, e_title, alert_type, car_id, move_next, help_text) { if (e_title) { $(#error).find(span.title).html(e_title); } $(#overlay).find(div.panel).hide(); $(#skin:hidden).show(); $(#error).find(div.message).html(e_msg); $(#overlay:hidden).show(); /* $(#mask:hidden).show(); */ $(#error:hidden).show(); $('#loading').hide(); TB_position(#error) $(window).resize(function(){TB_position(#error)}); if (alert_type) { if (alert_type == remove) { var el = $.DIV({}, $.IMG({className:'close-box hover js-link', src:'images/buttons/cancel.gif', alt:'Cancel'}), $.IMG({className:'delete hover js-link second', src:'images/buttons/remove.gif', alt:'Remove'}) ) $(#error).find(div.bd).css(background,#fff url(images/icons/warning.gif) no-repeat 0px 0px); var btns=$(#error).find(div.buttons); btns.html().append(el); inithover(btns.get(0)); $(#error).find(img.close-box).click(function(){ $('#error').hide(); $('#overlay').hide(); }); $(#error).find(img.delete).click(function(){ if (car_id) { remove_car(car_id); $('#error').hide(); $('#overlay').hide(); } }); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] wrapping siblings
Hi, I'd like to wrap three siblings into a div, sort of like div ... textarea ... div ... and transform it into div div ... textarea ... div ... /div these three siblings also have more siblings that I want to leave out of the loop, so it's not entirely straightforward. Any ideas? Andreas ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Jquery Birthday
Hi, I develop a french site who manage the birthdays. Jquery is present to birthday celebrities. to see this birthday : http://www.mes-anniversaires.com/anniversaires_du_jour-anniversaire-id-1076.html I love jquery :) [EMAIL PROTECTED] Ps : sorry for my bad english ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] load won't post params
hi Jörn ok, here's my code: $(document).ready(function() { p = {}; p[id] = test; p[value] = this is only a test; $(p).bind(click, function() { $(this) .before(div id='feedback' style='background-color:#0f0'/div); $(#feedback) .load(test.php, p); }); }); in the body, there is only a paragraph (to click), while the php is only plain echo stuff.. i've attached screenshots of both behaviors (one in jquery 1.1 and the other 1.0.4).. did the load function change somehow in jquery 1.1? thanks! [g] loaderrorjq11.png Description: PNG image loadgoodjq104.png Description: PNG image ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] click and dblclick-problem
Hi, using jscript-1.1 i have registered click and dbclick event on the same tag $(#liste p).dblclick(function(){ ... } $(#liste p).click(function(){ ... } so that i have different bahavior on click and doubleclick. click works fine when i doubleclick the item the doubleclick gets execute, BUT click gets executed twice BEFORE. what am i doing wrong. thaks stefan -- Stefan Kilp SK-Software, Entwicklung Beratung email: [EMAIL PROTECTED] fon : +49 6151 93344-0 fax : +49 6151 93344-20 Herta-Mansbacher-Str. 98 64289 Darmstadt, Germany. - ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery Birthday
On 16/01/07, Matthieu BARBE [EMAIL PROTECTED] wrote: Hi, I develop a french site who manage the birthdays. Jquery is present to birthday celebrities. to see this birthday : http://www.mes-anniversaires.com/anniversaires_du_jour-anniversaire-id-1076.html I love jquery :) [EMAIL PROTECTED] Ps : sorry for my bad english jQuery is a Capricorn, and its horoscope for the day is: Focus on those business deals! This is a great cosmic configuration for you to hammer out the fine points of a deal. Strike now while the iron is hot, as you could find yourself sitting in the catbird seat. Source: http://horoscopes.astrology.com/dailycapricorn.html Not that I really follow horoscopes, but they are often so vague that they can be interpreted as predictive (prophétique!). My French is limited to what translation sites give me... grammer, rather than the words is what is hard (as individual words can be looked up easily, but stringing them together to form a coherent sentence is the challenge). Those with English as a first language can have poor grammer, so your English is fine. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference betweendocument.getElementById('id') and $('#id') ?
yes. Thanks. I have it now. Any takers on my what is the jQuery object question? Is it simply an array of elements that have been selected? It may be kind of obvious, but it took me a few days to figure it. It might be good to explicitly say this somewhere early in the docs IMHO. thanks again. On 1/15/07, Dave Methvin [EMAIL PROTECTED] wrote: $(function () { self.focus(); $(#userresponse).setAttribute(autocomplete,off); $(#userresponse).focus(); }); I would do this: $(function () { self.focus(); $(#userresponse).attr(autocomplete,off)[0].focus(); }); There isn't a setAttribute method on a jQuery object, and I assume you want the DOM focus() method on #userresponse. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] 1.1 breaks sort (w/ fix) (again)
Apparently I'm the only person that uses metadata and sort. Sort also broke with 1.1, exactly the same way it did with 1.0.4 (see here: http://jquery.com/dev/bugs/bug/255/. As was the case before, it was just the result of some refactoring, but it took me all night to hunt down. Here's the change: Old: return this.pushStack( jQuery.merge( [].sort.apply( this, arguments ), []), [] ); New: return this.pushStack( jQuery.makeArray( [].sort.apply( this, arguments )) ); I've added this to the bug report. --Erik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference betweendocument.getElementById('id') and $('#id') ?
The jQuery object is a chunk of the DOM, on steroids. --Erik On 1/16/07, Daniel McBrearty [EMAIL PROTECTED] wrote: yes. Thanks. I have it now. Any takers on my what is the jQuery object question? Is it simply an array of elements that have been selected? It may be kind of obvious, but it took me a few days to figure it. It might be good to explicitly say this somewhere early in the docs IMHO. thanks again. On 1/15/07, Dave Methvin [EMAIL PROTECTED] wrote: $(function () { self.focus(); $(#userresponse).setAttribute(autocomplete,off); $(#userresponse).focus(); }); I would do this: $(function () { self.focus(); $(#userresponse).attr(autocomplete,off)[0].focus(); }); There isn't a setAttribute method on a jQuery object, and I assume you want the DOM focus() method on #userresponse. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery Birthday
Bonjour [EMAIL PROTECTED], The zooming photo widget that comes up if you click on the Devo hat is really cool. Great site, but I feel compelled to file a complaint that jQuery's official spokesperson, Paris Hilton, isn't in the database :P -Pat ps. February 17, 1981. Heh. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] load won't post params
I like using the load method a lot, and with jQuery 1.1, I've noticed that now it doesn't post the object params parameter to This has been fixed in SVN. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference betweendocument.getElementById('id') and $('#id') ?
On 16/01/07, Daniel McBrearty [EMAIL PROTECTED] wrote: yes. Thanks. I have it now. Any takers on my what is the jQuery object question? Is it simply an array of elements that have been selected? It may be kind of obvious, but it took me a few days to figure it. It might be good to explicitly say this somewhere early in the docs IMHO. thanks again. It is a collection of selected elements, that can be batch processed (events assigned, styles applied, classes added etc), but due the fact that multiple types of elements (div, span, input etc) can be selected, the methods of each element have to be accessed by index (using get(n).focus() or [n].focus()). It's really a pseudo array rather than a real array. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Item width
Hi! I want to create a vertical scrolling news ticker. I have the following structure: div id=divParent style=width: 300px; overflow: hidden; divNews1, news2, /div /div I set the inner div to relative and set the left position to scroll it. It works fine, but after a while the inner div scrolls out of view. I wanted to check if the inner width is still overflow on the right edge, if not I would change the scrolling direction. How do I get the real width of the inner width? (I tried width, offsetWidth, clientWidth but none of the gives the real width.) Nandi ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] wrapping siblings
On 16/01/07, Andreas Wahlin [EMAIL PROTECTED] wrote: Hi, I'd like to wrap three siblings into a div, sort of like div ... textarea ... div ... and transform it into div div ... textarea ... div ... /div these three siblings also have more siblings that I want to leave out of the loop, so it's not entirely straightforward. Any ideas? Andreas Without knowing exactly what you are trying to do, here is an idea that may help. Apply a class to them and select by that: var mysiblings = $(.mysiblings); Then create the div and append 'mysiblings' to it then add the div to the desired location: var mydiv = $(div).append(mysiblings).appendTo(#mycontainer); ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Problem with $(...).css() or interface 1.1
Can you tell I'm upgrading to 1.1 tonight? :) Draggable ghosting isn't working in interface 1.1 on FF because it does: jQuery.iDrag.helper.css('opacity', elm.dragCfg.opacity); opacity is a float, and css('opacity', float) doesn't work on FF anymore. I changed it to: jQuery.iDrag.helper.css('opacity', elm.dragCfg.opacity+''); And it works fine. Not sure if this is a jQuery issue or an interface issue. --Erik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] .height(val) - what am I missing?
On 16/01/07, agent2026 [EMAIL PROTECTED] wrote: Theo Welch wrote: I'm not sure if this is the issue, Adam, but have you tried using a string for the height value instead of an integer... I did try everything here for the value just to be sure, but 1.1 should handle strings or integers according to what I've read - 600 with be 600px, 50em with be 50em, and so on (and it does). Problem was the DOM hadn't loaded, you guys were right about that. I was under the mistaken impression that the $(...) worked as $(fn) for document.ready. Now I know. Just curious, what is the difference between $(fn) and the 'failsafe jQuery' code jQuery(function($) {...}); ? Adam -- You only need to use jQuery(function($) {...}) if you are using a library that also uses $ (e.g prototype). It prevents conflicts from occurring. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem with $(...).css() or interface 1.1
Erik Beeson wrote: Can you tell I'm upgrading to 1.1 tonight? :) Draggable ghosting isn't working in interface 1.1 on FF because it does: jQuery.iDrag.helper.css('opacity', elm.dragCfg.opacity); opacity is a float, and css('opacity', float) doesn't work on FF anymore. I changed it to: jQuery.iDrag.helper.css('opacity', elm.dragCfg.opacity+''); And it works fine. Not sure if this is a jQuery issue or an interface issue. --Erik ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ Hi Erik, I talked with John about this issue and it will be fixed this week along with a new release. As a temporary solution you can downloads jQuery from interface website, it is hacked so you don't have this problem. Stefan ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
great idea :-), thank you for the fast help. i'll immediately try that, as the only work around i've come up with by now is setting the filter property opacity back to 100 after issueing .show(). best regards lukas Am 16.01.2007 um 10:01 schrieb George Adamson: Hi Lukas, I've got around problems like this in the past by ensuring you have explicitly specified height and width on the elements before you fade them*. Also, Show() in IE is affected when ClearType is enabled in Windows, but you can get around this by specifying element background color (other than transparent or blank). If you're experiencing either of these problems then they're just mad IE/JS quirks rather than JQuery faults. Cheers, George * You can use JQuery to measure and set the width and/or height for you before the first fade or hide. Lukas Pitschl wrote: hi list, i'm terribly sorry to litter this list with all IE7 problems, but unfortunately i have to have my sites working in that s browser too, so i can't hesitate to ask. fadeOut doesn't seem to work on divs if triggered twice or more times. it works if only triggered once, but it seems that opacity is not restored, or the opacity filter is not removed after fading out and then reactivating the div with $('#some_mane').show(). is there any workaround? thx for help lukas ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/IE-7-fadeIn%2C- fadeOut-problem-tf3018206.html#a8386649 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Error IE6
Hi guys, Why jquery does not work correctly in IE6 ? Has Anybody else ever had this same issue ? Error: 'style' is null or it does not a object line 480 ]if (!force elem.style[prop]) { -- []'s Harlley R. Oliveira www.syssolution.com.br --- ~ U never try U'll never learn ~ --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Pass var to parent function syntax?
I'm calling a resize function from a file loaded into an object tag: onload=function(){ var sH = (document.body.scrollHeight) this.parent.resize(#external,sH); } The resize function in the parent page: function resize(objId,h){ console.log(objId+,+h); // #external,1157 $(objId).height(h); console.log($(objId).height()); } Even though my variables are being passed, I'm getting an undefined error: $ is not defined [Break on this error] $(objId).height(h); Syntax? Adam -- View this message in context: http://www.nabble.com/Pass-var-to-parent-function-syntax--tf3020753.html#a8389607 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] load won't post params
just recently? ok, i'll check. thanks mike :) On 1/16/07, Mike Alsup [EMAIL PROTECTED] wrote: I like using the load method a lot, and with jQuery 1.1, I've noticed that now it doesn't post the object params parameter to This has been fixed in SVN. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?
I second the request for a good understanding of what the JQuery object is. Daniel McBrearty wrote: ok, I got it. To access the element I need to access $('#id')[0] What confused me here is that I wasn't really clear what the jquery object actually is. I have looked through the various intro and tutorial material a few times, and managed to get the library to do some useful things, but I missed this. Is there anywhere where this is explained? thanks Daniel On 1/15/07, Daniel McBrearty [EMAIL PROTECTED] wrote: sorry ... not the smartest question. of course, one returns the element, one returns the jquery object. What I needed was $('#id').attr( { autocomplete : off } ); I still have a problem to set the focus though. There is no error shown for $('#id').focus(); but the focus is not set ... On 1/15/07, Daniel McBrearty [EMAIL PROTECTED] wrote: I'm changing some old js I had to use jQuery. I used to have a function like this (to select a certain text input on a form and automatically focus on it) ... : window.onload = function() { self.focus(); document.getElementById(userresponse).setAttribute(autocomplete,off); document.getElementById(userresponse).focus(); } which worked fine ... then I replace it with this: $(function () { self.focus(); $(#userresponse).setAttribute(autocomplete,off); $(#userresponse).focus(); }); which fails to select the text box. why not? I thought these were equivalent excpet the jQuery version loads sooner? thanks Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/what%27s-the-difference-between-document.getElementById%28%27id%27%29-and-%24%28%27-id%27%29---tf3017662.html#a8389635 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] ID (or name) of current tab
Bruce MacKay schrieb: Hello folks, I'm trying to retrieve the ID of the current tab (a la Klaus) to pass to a function (tFocus). My attempt thus far... $(#editor).tabs({fxFade: true, fxSpeed: fast, onShow: tFocus($(this).attr(id))}); but this just returns undefined to tFocus - which I'm sure won't surprise many of you, but has stumped me. A hand up out of this hole would be appreciated. Cheers, Bruce Bruce, you have to pass in a function reference, not the function call itself, so unless tFocus does not return a function try this: $(#editor).tabs({ fxFade: true, fxSpeed: fast, onShow: function(clicked) { tFocus(clicked.id); } }); This will pass the id of the last clicked anchor (tab) to tFocus after the tab content got shown. Does that work or do you need the id the div that holds the content for a tab? The callbacks onClick, onHide, onShow get passed three parameters: onShow: function(clickedTabLink, contentDivOfClickedTab, contentDivOfHiddenTab) { // alert id of div that holds // content for current tab alert(contentDivOfClickedTab.id); } -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] click / dblclick Problem
Hi, i am using jscript-1.1 i have registered click and dbclick event on the same tag $(#liste p).dblclick(function(){ ... } $(#liste p).click(function(){ ... } so that i have different bahavior on click and doubleclick. click works fine when i doubleclick the item then doubleclick gets execute, BUT click gets executed twice BEFORE. i wanted to execute dblclick or click, not both. what am i doing wrong. thanks stefan -- Stefan Kilp SK-Software, Entwicklung Beratung email: [EMAIL PROTECTED] fon : +49 6151 93344-0 fax : +49 6151 93344-20 Herta-Mansbacher-Str. 98 64289 Darmstadt, Germany. - ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery Birthday
Hi Patrick ! Thx, for the zooming photo see this page : http://vikjavev.no/highslide/ Paris Hilton, who is she ? :) @+ [EMAIL PROTECTED] 2007/1/16, Patrick Hall [EMAIL PROTECTED]: Bonjour [EMAIL PROTECTED], The zooming photo widget that comes up if you click on the Devo hat is really cool. Great site, but I feel compelled to file a complaint that jQuery's official spokesperson, Paris Hilton, isn't in the database :P -Pat ps. February 17, 1981. Heh. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] load won't post params
I already downloaded the latest revision, 1073. but still found the fn.apply is not a function error after calling load(url, data). is this the right revision with that fix for load? sorry for being stupid. thanks, [g] On 1/16/07, Guntur N. Sarwohadi [EMAIL PROTECTED] wrote: just recently? ok, i'll check. thanks mike :) On 1/16/07, Mike Alsup [EMAIL PROTECTED] wrote: I like using the load method a lot, and with jQuery 1.1, I've noticed that now it doesn't post the object params parameter to This has been fixed in SVN. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
hey george, could you help me out with getting the height and width out of my divs, as i can't seem to do that right as offsetHeight nor offsetWidth properly work. i'd really appreciate your help regards lukas Am 16.01.2007 um 10:01 schrieb George Adamson: Hi Lukas, I've got around problems like this in the past by ensuring you have explicitly specified height and width on the elements before you fade them*. Also, Show() in IE is affected when ClearType is enabled in Windows, but you can get around this by specifying element background color (other than transparent or blank). If you're experiencing either of these problems then they're just mad IE/JS quirks rather than JQuery faults. Cheers, George * You can use JQuery to measure and set the width and/or height for you before the first fade or hide. Lukas Pitschl wrote: hi list, i'm terribly sorry to litter this list with all IE7 problems, but unfortunately i have to have my sites working in that s browser too, so i can't hesitate to ask. fadeOut doesn't seem to work on divs if triggered twice or more times. it works if only triggered once, but it seems that opacity is not restored, or the opacity filter is not removed after fading out and then reactivating the div with $('#some_mane').show(). is there any workaround? thx for help lukas ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/IE-7-fadeIn%2C- fadeOut-problem-tf3018206.html#a8386649 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] load won't post params
On 1/16/07, Guntur N. Sarwohadi [EMAIL PROTECTED] wrote: I already downloaded the latest revision, 1073. but still found the fn.apply is not a function error after calling load(url, data). is this the right revision with that fix for load? sorry for being stupid. No, it's not in 1073. I just fixed it this morning. You can get ajax.js here: http://jquery.com/dev/svn/trunk/jquery/src/ajax/ajax.js?format=txt Or you can temporarily patch your own jQuery file using the work-around found here: http://jquery.com/discuss/2007-January/021767/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Item width
Try using scrollWidth. However, in Firefox there is a bug where scrollWidth will only report the visible width if a parent has overflow hidden (it reports the correct scrollHeight). What I've done in the past is to clone the node and insert it somewhere else in the DOM, check the offsetWidth and then remove it. -- Brandon Aaron On 1/16/07, Kolman Nándor [EMAIL PROTECTED] wrote: Hi! I want to create a vertical scrolling news ticker. I have the following structure: div id=divParent style=width: 300px; overflow: hidden; divNews1, news2, …./div /div I set the inner div to relative and set the left position to scroll it. It works fine, but after a while the inner div scrolls out of view. I wanted to check if the inner width is still overflow on the right edge, if not I would change the scrolling direction. How do I get the real width of the inner width? (I tried width, offsetWidth, clientWidth but none of the gives the real width.) Nandi ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] load won't post params
ah.. ok.. i know i was doing something stupid. :) thanks again mike [g] On 1/16/07, Mike Alsup [EMAIL PROTECTED] wrote: On 1/16/07, Guntur N. Sarwohadi [EMAIL PROTECTED] wrote: I already downloaded the latest revision, 1073. but still found the fn.apply is not a function error after calling load(url, data). is this the right revision with that fix for load? sorry for being stupid. No, it's not in 1073. I just fixed it this morning. You can get ajax.jshere: http://jquery.com/dev/svn/trunk/jquery/src/ajax/ajax.js?format=txt Or you can temporarily patch your own jQuery file using the work-around found here: http://jquery.com/discuss/2007-January/021767/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
Lukas, Check out the demensions pluging, this should help you get the actual height and width real easy. Ben -- View this message in context: http://www.nabble.com/IE-7-fadeIn%2C-fadeOut-problem-tf3018206.html#a8390102 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery Birthday
Here she is. http://static.flickr.com/52/114431569_4c0c4e1763.jpg?v=0 2007/1/16, Matthieu BARBE [EMAIL PROTECTED]: Hi Patrick ! Thx, for the zooming photo see this page : http://vikjavev.no/highslide/ Paris Hilton, who is she ? :) @+ [EMAIL PROTECTED] 2007/1/16, Patrick Hall [EMAIL PROTECTED]: Bonjour [EMAIL PROTECTED], The zooming photo widget that comes up if you click on the Devo hat is really cool. Great site, but I feel compelled to file a complaint that jQuery's official spokesperson, Paris Hilton, isn't in the database :P -Pat ps. February 17, 1981. Heh. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Rafael Santos Sà :: webdeveloper www.rafael-santos.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Testing for presence of ID
Absolutely correct, Sam. I was going insane, I thought... :) Gerry On 1/15/07, Sam Collett [EMAIL PROTECTED] wrote: http://blog.danen.org/ Gerry In answer to the question on your blog, I think the fields are like that because of the Google Toolbar form filling feature. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
On 16/01/07, lukas | dressy vagabonds [EMAIL PROTECTED] wrote: hey george, could you help me out with getting the height and width out of my divs, as i can't seem to do that right as offsetHeight nor offsetWidth properly work. i'd really appreciate your help regards lukas Have you tried the dimensions plugin? Download from: http://jquery.com/dev/svn/trunk/plugins/dimensions/dimensions.js?format=raw ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Error IE6
This part of my code that is not working: var arrElementos = $(p).get(); var tempo = 1000; for(var i in arrElementos) { if (i == 0) { setTimeout($(arrElementos[i]).DropInRight(1000), tempo); } else { setTimeout($(arrElementos[i]).DropInLeft(1000), tempo); } } 2007/1/16, Mike Alsup [EMAIL PROTECTED]: Why jquery does not work correctly in IE6 ? Has Anybody else ever had this same issue ? Error: 'style' is null or it does not a object line 480 ]if (!force elem.style[prop]) { Can you please provide more information or a sample test page? Thanks. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- []'s Harlley R. Oliveira www.syssolution.com.br --- ~ U never try U'll never learn ~ --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] how to determine if $(this) is @changed ?
$([EMAIL PROTECTED]) is very useful, but how can I determine whether $(this) has been changed? -- View this message in context: http://www.nabble.com/how-to-determine-if-%24%28this%29-is-%40changed---tf3021012.html#a8390359 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
Yep, Ben's right try the plugin. In some cases I found the standard JQuery height() and width() methods adequate, but the dimensions plugin tends to be more reliable. Something like this should do it: (Maybe someone else can offer a shorter technique) $(select-my-elements).each(function(){ var $myEl = $(this); $myEl.css({ width:$myEl.height(), height:$myEl.height() }); }) George bmsterling wrote: Lukas, Check out the demensions pluging, this should help you get the actual height and width real easy. Ben -- View this message in context: http://www.nabble.com/IE-7-fadeIn%2C-fadeOut-problem-tf3018206.html#a8390355 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] how to determine if $(this) is @changed ?
On 16/01/07, jazzle [EMAIL PROTECTED] wrote: $([EMAIL PROTECTED]) is very useful, but how can I determine whether $(this) has been changed? -- This may work $(this).is(@changed) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] click and dblclick-problem
click works fine when i doubleclick the item the doubleclick gets execute, BUT click gets executed twice BEFORE. That's the way the events work. By the time it figures out you wanted a double-click, it has already delivered a click. You can avoid doing the click action by using setTimeout in the click() handler for say 400ms, and only execute the click action if the timer expires. Your double-click handler should cancel the timer and perform the double-click action. You cannot make the click timeout shorter than the double-click time, which in Windows is configurable by the user. So don't try to make the click timeout short. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Get first ancestor of type
Hi Chris, Someone wrote an ancestorsTo() plugin a while back. There was some talk about changing its name to parentsUntil() and including it with nextUntil() in a single plugin. Not sure who wrote the plugin originally, but Dave Methvin refers to it here: Would this be a candidate for addition to the core possibly? The ancestorsTo looks like it's an up-the-tree analog of the nextUntil method for siblings that was discussed here a while back. I think the general consensus on that was that there would be an extended navigation plugin rather than add all these to the core. Maybe they should be named ancestorsUntil and siblingsUntil for better consistency? Also, since this is a modifying plugin it should use pushStack() to allow the use of .end() to get back to the previous selected nodes. I think the end result would be something like this, untested: jQuery.fn.ancestorsUntil = function(match) { var a = []; jQuery(this[0]).ancestors().each(function() { a.push(this); return !jQuery(this).is(match); }); return this.pushStack(a, arguments); }; Hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 15, 2007, at 9:09 PM, Chris Domigan wrote: Hi there, How would I select the first ancestor of a certain type? Eg if I want to select the first div that is found while searching up the DOM from an element. Cheers, Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
I'm not sure I understand the problem. Could you try to upload or send me a test case where it demonstrates the problem you are having. I threw together a quick test case but everything seems to work fine for me. http://brandon.jquery.com/testing/fx/fade.html -- Brandon Aaron On 1/15/07, lukas | dressy vagabonds [EMAIL PROTECTED] wrote: hi list, i'm terribly sorry to litter this list with all IE7 problems, but unfortunately i have to have my sites working in that s browser too, so i can't hesitate to ask. fadeOut doesn't seem to work on divs if triggered twice or more times. it works if only triggered once, but it seems that opacity is not restored, or the opacity filter is not removed after fading out and then reactivating the div with $('#some_mane').show(). is there any workaround? thx for help lukas ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Error IE6
var arrElementos = $(p).get(); var tempo = 1000; for(var i in arrElementos) { if (i == 0) { setTimeout($(arrElementos[i]).DropInRight(1000), tempo); } else { setTimeout($(arrElementos[i]).DropInLeft(1000), tempo); } } This statement: $(p).get(); returns an Array, not an Object. Iterate an Array with a normal for loop instead of a for-in loop. setTimeout takes a string or a function reference. You're executing: $(arrElementos[i]).DropInLeft(1000) and passing the result to setTimeout. You could probably rewrite what you have like this: $(function() { setTimeout(dropIn, 1000); }); function dropIn() { $(p).each(function(i) { i==0 ? $(this).DropInRight(1000) : $(this).DropInLeft(1000); }); } ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] how to determine if $(this) is @changed ?
It does indeed. BTW: it turns out that @changed wasn't what I was remembering thinking. It checks for the presence of an attribute called 'changed', NOT whether the item has been changed (i.e. value != defaultValue) Sam Collett wrote: $([EMAIL PROTECTED]) is very useful, but how can I determine whether $(this) has been changed? This may work $(this).is(@changed) -- View this message in context: http://www.nabble.com/how-to-determine-if-%24%28this%29-is-%40changed---tf3021012.html#a8391017 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?
Thanks for the explaination. The reason for my request was my curiosity of what exactly makes up the JQuery Object. For example, I didn't understand that [0] is a reference to the first DOM object. I ran this to try to look at the Object (using 1.04): --- html head script type=text/javascript src=jquery.js/script /head body form input id=test class=test type=text nametest input id=test2 class=test type=text nametest /form script type=text/javascript !-- $(document).ready(function(){ var t = $(.test); var s; for (property in t) { s = s + brbrhr /brbr +property.toString()+ : +t[property].toString(); } document.write(s.toString()); }); //-- /script /body /html --- and learned quite a bit. (Although the page never fully loads, not sure why). Anyway, I would recommend looking at this page for anyone who wants to learn more. (If there is a better way to look at the Object, please post here) - Rich malsup wrote: I second the request for a good understanding of what the JQuery object is. The jQuery object is just a JavaScript object (like Date or Array). It encapsulates zero or more DOM elements and lets you manipulate those elements using the jQuery API. var jq = $('.myClass'); The statement above selects all elements that have a class of 'myClass' and wraps them in an object - the jQuery object. Once those elements are wrapped in a jQuery object you can use the jQuery API to do all kinds of things with them. Like show them all: jq.show(); or add a click event handler to all of them: jq.click(function() { alert ('I was clicked'); }); or access each of the selected DOM elements: jq.each(function(i) { // 'this' is the DOM element inside the 'each' method this.innerHTML = 'my index is ' + i; }); That's really the nuts and bolts of it. jQuery lets you easily select elements in the DOM and do something with them. It's selection capabilities are very powerful and very fast. And it's API is quite extensive. You'll also find that most of the functions in the jQuery API return the jQuery object on which they operate. This means they are chainable and this is great when you want to do more than one thing with the selected elements. The examples above could be combined into a single statement like this: $('.myClass').show().click(function() { alert ('I was clicked'); }).each(function(i) { this.innerHTML = 'my index is ' + i; }); Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/what%27s-the-difference-between-document.getElementById%28%27id%27%29-and-%24%28%27-id%27%29---tf3017662.html#a8391034 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Method return values in jQuery 1.1
I've already sent a ticket about a bug in the jQuery.fn.add method (#821), but after some more test I'm convincing myself that there is a general problem in the jQuery implementation. Apparently, now all or most method change the returned jQuery object (another example is the show/hide methods). In my opinion this is not a good idea. As I pointed out also in the mentioned ticked, it should be a clear distinction among chainable and non-chainable methods. Actually, there should be three types of methods: 1) Fully chainable methods (like add, show etc.) which should return the same object whose method was called 2) Indirectly chainable methods (like find, filter etc.) which should return a new jQuery object containing a reference to the method owner. 3) Non-chainable methods (like get, attr etc.) which return something else than a jQuery object Fully chainable methods should *always* return the method owner object itself (no clones or other), and other methods should left the method owner unchanged and return a new object. While browsing the code, I found some other things that perplexed me. I can't understand what's the point in creating objects that mimic an array but lack fundamental properties and methods of the array object. Watching with firebug, I found objects containing elements retrievable with the [] operator, but without the length property, and without the push method (see also the note below). Such practices, I think, could only be error prone and confusing. Why not simply maintain an array of object as a property of the jQuery object, avoiding all that tricky code to simply add or remove an element, or change some property of the collection? What is the benefit from having a pseudo-array object instead of a clean collection object with only the add, remove, and get methods? The possibility to use the [] operator? If there is no other reason, it's a very small advantage (if it could be considered as an advantage) in front of a cryptic code and a significant increment of the risk of errors. I realize that a change like that could generate severe compatibility problems, but maybe in future versions the use of the [] operator could be deprecated and gradually removed (the use of a 'compatibility patch', like the one distributed for version 1.1 may be a good solution). A final note: this is the code of the pushStack and setArray methods: pushStack: function( a ) { var ret = jQuery(this); ret.prevObject = this; return ret.setArray( a ); }, setArray: function( a ) { this.length = 0; [].push.apply( this, a ); return this; }, pushStack creates a new jQuery object with the same content of this, than save this object as prevObject, then call setArray to copy the contents of the array a to the new jQuery object which is finally returned. Note that setArray sets the length property to 0 but do not remove the elements, so you can have an object that contains elements but has zero length. Yes, by applying the push method (but, incidentally, why to use tricks like [].push.apply(this, a) instead of inheriting the push method?), we override the pseudo-array contents, but if the object contained more elements than those inserted with push, we have an inconsistent object with, for example, length=3 and 5 elements. Elements of index 3 and 4 are 'illegal' elements, but can always be retrieved with the [] operator. Does not look like a mess, all that? Maybe I'm missing something, but the push stack method could not be simply something like this?: pushStack: function( a ) { var ret = jQuery(a); ret.prevObject = this; return ret; }, I showed this example because I have the impression that the jQuery implementation needs a accurate cleaning. I suspect, also, that speed could be significantly increased by removing unnecessary complications. Ok, thanks for your attention, I hope my remarks could be a contribution to improve that very useful and well conceived javascript library that jQuery is. Regards Paolo ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
thanks for all the help, 1. i'll definitely try the dimension plugin, didn't kow of that 2. the problem can be seen here: heart.coffeeandrecords.com/shop/ cart.php if you have items in the shopping cart and try to update the quantity in IE7 there's a fadeIn, fadeOut error, which is at the time fixed, by resetting the filter opacity to 100 best regards lukas Am 16.01.2007 um 15:06 schrieb Brandon Aaron: I'm not sure I understand the problem. Could you try to upload or send me a test case where it demonstrates the problem you are having. I threw together a quick test case but everything seems to work fine for me. http://brandon.jquery.com/testing/fx/fade.html -- Brandon Aaron On 1/15/07, lukas | dressy vagabonds [EMAIL PROTECTED] wrote: hi list, i'm terribly sorry to litter this list with all IE7 problems, but unfortunately i have to have my sites working in that s browser too, so i can't hesitate to ask. fadeOut doesn't seem to work on divs if triggered twice or more times. it works if only triggered once, but it seems that opacity is not restored, or the opacity filter is not removed after fading out and then reactivating the div with $('#some_mane').show(). is there any workaround? thx for help lukas ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?
I ran this to try to look at the Object (using 1.04): and learned quite a bit. (Although the page never fully loads, not sure Yes, that's the API. Those are the properties and methods on the jQuery object. You can view this information in a more useful format online. Sam posted some very useful links here: http://webdevel.blogspot.com/2007/01/jquery-documentation.html ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Hi, But I still have the same problem... Here is a zip file. After unzipping, there will be a new chili folder with a test page and a subfolder. It works in FF1.5.0.9 but does not in IE7. http://www.nabble.com/file/5620/chili.zip chili.zip Currrently I don't have IE7 at hand - on monday again. Sorry, yesterday there was too muc todo for the customers. Here we go: On Sunday I have installed IEs4Linux on m Linux machine with IE5, IE5.5, IE6 and IE7 all of them except for IE5 worked correctly. Now I have tested on a Windows XP machine with IE7. I have no problems with a relative package path ('packages/'), but an absolute package path to a network device ('//server/share/test/chili/packages/') doesn't work. Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] IE 7 fadeIn, fadeOut problem
It looks like the animation is not reaching 1 or 100%. Try using fadeTo instead of fadeIn and fadeOut. $('#item') .fadeTo(0) // fadeOut .fadeTo(1); // fadeIn I believe this should solve the problem. -- Brandon Aaron On 1/16/07, lukas | dressy vagabonds [EMAIL PROTECTED] wrote: thanks for all the help, 1. i'll definitely try the dimension plugin, didn't kow of that 2. the problem can be seen here: heart.coffeeandrecords.com/shop/ cart.php if you have items in the shopping cart and try to update the quantity in IE7 there's a fadeIn, fadeOut error, which is at the time fixed, by resetting the filter opacity to 100 best regards lukas Am 16.01.2007 um 15:06 schrieb Brandon Aaron: I'm not sure I understand the problem. Could you try to upload or send me a test case where it demonstrates the problem you are having. I threw together a quick test case but everything seems to work fine for me. http://brandon.jquery.com/testing/fx/fade.html -- Brandon Aaron On 1/15/07, lukas | dressy vagabonds [EMAIL PROTECTED] wrote: hi list, i'm terribly sorry to litter this list with all IE7 problems, but unfortunately i have to have my sites working in that s browser too, so i can't hesitate to ask. fadeOut doesn't seem to work on divs if triggered twice or more times. it works if only triggered once, but it seems that opacity is not restored, or the opacity filter is not removed after fading out and then reactivating the div with $('#some_mane').show(). is there any workaround? thx for help lukas ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] [plugin] jdMenu - Finally Released!
That's exactly what I was trying to find but like you said I couldn't find any links to it. Thanks! -Jonathan On 1/15/07, Aaron Heimlich [EMAIL PROTECTED] wrote: On 1/15/07, Jonathan Sharp [EMAIL PROTECTED] wrote: Is jQuery's even object that gets passed in standard or would I have to code around W3C/IE target vs. srcElement? jQuery does some basic normalization to ensure the event object you receive complies with the W3C DOM2 Spec (and yes, event.target vs. event.srcElement is one of them). See http://docs.jquery.com/Events_%28Guide%29 for more info (Note: there don't seem to be any pages linking here[1]. I actually had to search to find it). There's also the fix_events plugin which does some more extensive normalization: http://jquery.com/dev/svn/trunk/plugins/fix_events/fix_events.js [1] http://docs.jquery.com/index.php?title=Special:Whatlinksheretarget=Events_%28Guide%29 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] fadeOut text
I'm trying to write my first jquery function using it's rules...it's hard getting started. I want to write a function that is ready at all times for any div's (or perhaps spans's instead) that when they appear they will fade away about ten second later. I'll attach a class to the span called 'notify'...like this... span class='notify'Updated/span These are appearing via an ajax call already, so they don't appear when the page originally loads...only after an ajax call has been executed. The best I've been able to get so far...no, this doesn't work...I'm hoping somebody can help me move forward with this (my head is spinning here): $(document).ready ( function () { $('span.notify').fadeOut('slow') } ); I don't care if it simply fades out the text or the entire span...or perhaps even innerHTML's the text to an nbsp; (there's another idea)... Help! ;) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Christof Donat wrote: I have no problems with a relative package path This is very strange... Did you use the exact files/directories in the zip I submitted? -- View this message in context: http://www.nabble.com/dynamic-loading-of-jquery.js-into-my-web-page-tf2905089.html#a8392903 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Item width
Hi, take a look at http://jdsharp.us/code/jQuery/plugins/jdNewsScroll/ Cheers, -js On 1/16/07, Kolman Nándor [EMAIL PROTECTED] wrote: Hi! I want to create a vertical scrolling news ticker. I have the following structure: div id=divParent style=width: 300px; overflow: hidden; divNews1, news2, …./div /div I set the inner div to relative and set the left position to scroll it. It works fine, but after a while the inner div scrolls out of view. I wanted to check if the inner width is still overflow on the right edge, if not I would change the scrolling direction. How do I get the real width of the inner width? (I tried width, offsetWidth, clientWidth but none of the gives the real width.) Nandi ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?
(If there is a better way to look at the Object, please post here) The very best way to understand what JavaScript code is going and explore objects is to use any JavaScript debugger, such as Firebug or Venkman for Firefox, or the Microsoft Script Editor for IE. If you don't have a JavaScript debugger that you are comfortable with, you're working too hard! :-) -Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] dynamic loading of jquery.js into my web page
Hi, I have no problems with a relative package path This is very strange... Did you use the exact files/directories in the zip I submitted? Yes, I just changed packageBase to the path at my computer. Everything else is exactly the files in the zip. Maybe it has to do with your security-setings in IE. You need to allow scripts to access secure ActiveX-Controls, as you need for all ajax stuff. Otherwise there will of course not be any chance to get an XMLHttpRequest object. Christof ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?
There's a reasonable explanation of the jQuery object in the Visual jQuery Magazine at http://www.visualjquery.com/magazine/issue1.01.pdf On 1/16/07, PragueExpat [EMAIL PROTECTED] wrote: Thanks for the explaination. The reason for my request was my curiosity of what exactly makes up the JQuery Object. For example, I didn't understand that [0] is a reference to the first DOM object. I ran this to try to look at the Object (using 1.04): --- html head script type=text/javascript src=jquery.js/script /head body form input id=test class=test type=text nametest input id=test2 class=test type=text nametest /form script type=text/javascript !-- $(document).ready(function(){ var t = $(.test); var s; for (property in t) { s = s + brbrhr /brbr +property.toString()+ : +t[property].toString(); } document.write(s.toString()); }); //-- /script /body /html --- and learned quite a bit. (Although the page never fully loads, not sure why). Anyway, I would recommend looking at this page for anyone who wants to learn more. (If there is a better way to look at the Object, please post here) - Rich malsup wrote: I second the request for a good understanding of what the JQuery object is. The jQuery object is just a JavaScript object (like Date or Array). It encapsulates zero or more DOM elements and lets you manipulate those elements using the jQuery API. var jq = $('.myClass'); The statement above selects all elements that have a class of 'myClass' and wraps them in an object - the jQuery object. Once those elements are wrapped in a jQuery object you can use the jQuery API to do all kinds of things with them. Like show them all: jq.show(); or add a click event handler to all of them: jq.click(function() { alert ('I was clicked'); }); or access each of the selected DOM elements: jq.each(function(i) { // 'this' is the DOM element inside the 'each' method this.innerHTML = 'my index is ' + i; }); That's really the nuts and bolts of it. jQuery lets you easily select elements in the DOM and do something with them. It's selection capabilities are very powerful and very fast. And it's API is quite extensive. You'll also find that most of the functions in the jQuery API return the jQuery object on which they operate. This means they are chainable and this is great when you want to do more than one thing with the selected elements. The examples above could be combined into a single statement like this: $('.myClass').show().click(function() { alert ('I was clicked'); }).each(function(i) { this.innerHTML = 'my index is ' + i; }); Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/what%27s-the-difference-between-document.getElementById%28%27id%27%29-and-%24%28%27-id%27%29---tf3017662.html#a8391034 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Problem loading HTML and Script Code with Ajax
Hello, I've got the following problem: My page is loading dynamically an HTML formular using the $.post() function. I would like to submit this formular using the $ajaxForm() function from the forms library. The HTML fragment I am loading looks like this: form id=myForm method=post action=upload input type=hidden name=abc value=xyz / input type=submit name=submitButton value=Submit / /form script type=text/javascript //![CDATA[ $('#myForm').submit(function() { var options = { target: '#myForm', }; $(this).ajaxSubmit(options); return false; }); //]] /script When I am loading the fragment, the javascript will not be executed and the form will not be prepared for the ajax request. Submitting the formular will end up in a plain HTTP request. Can anyone tell me how to solve this? Thanks, Harald ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] fadeOut text
Use div instead of span - that worked for me when I had a similar problem. Vaska wrote: I'm trying to write my first jquery function using it's rules...it's hard getting started. I want to write a function that is ready at all times for any div's (or perhaps spans's instead) that when they appear they will fade away about ten second later. I'll attach a class to the span called 'notify'...like this... span class='notify'Updated/span These are appearing via an ajax call already, so they don't appear when the page originally loads...only after an ajax call has been executed. The best I've been able to get so far...no, this doesn't work...I'm hoping somebody can help me move forward with this (my head is spinning here): $(document).ready ( function () { $('span.notify').fadeOut('slow') } ); I don't care if it simply fades out the text or the entire span...or perhaps even innerHTML's the text to an nbsp; (there's another idea)... Help! ;) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/fadeOut-text-tf3021748.html#a8394482 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface 1.1
really nice! thank you!!! your docu. says for draging elements use string ('parent' or 'document') or array (top, left, width, height) for containment should be array (left, top, width, height) so works fine, greetings jac -- View this message in context: http://www.nabble.com/Interface-1.1-tf3014110.html#a8392024 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] fadeOut text
Well, I was close...but still not close enough: $(document).ready ( function() { $('.notify').fadeOut('slow') }); Works onload - for the obvious reasons. But, I need this to work any time there is a something with class 'notify'. This is the hard part (I'm reading up on things now). I also need to pause this, but I think I can throw a setTimeout in there and all will be ok. And yeah, it's working fine on a span. ;) On 16 Jan 2007, at 18:13, James Thomas wrote: Use div instead of span - that worked for me when I had a similar problem. Vaska wrote: I'm trying to write my first jquery function using it's rules...it's hard getting started. I want to write a function that is ready at all times for any div's (or perhaps spans's instead) that when they appear they will fade away about ten second later. I'll attach a class to the span called 'notify'...like this... span class='notify'Updated/span These are appearing via an ajax call already, so they don't appear when the page originally loads...only after an ajax call has been executed. The best I've been able to get so far...no, this doesn't work...I'm hoping somebody can help me move forward with this (my head is spinning here): $(document).ready ( function () { $('span.notify').fadeOut('slow') } ); I don't care if it simply fades out the text or the entire span...or perhaps even innerHTML's the text to an nbsp; (there's another idea)... Help! ;) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/fadeOut-text- tf3021748.html#a8394482 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem loading HTML and Script Code with Ajax
Sorry, stupid question, I already solved this on my own. Using the onsubmit event in the form tag helps a lot ;-) Harald -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Harald Dietrich Sent: Dienstag, 16. Januar 2007 17:59 To: jQuery Discussion. Subject: [jQuery] Problem loading HTML and Script Code with Ajax Hello, I've got the following problem: My page is loading dynamically an HTML formular using the $.post() function. I would like to submit this formular using the $ajaxForm() function from the forms library. The HTML fragment I am loading looks like this: form id=myForm method=post action=upload input type=hidden name=abc value=xyz / input type=submit name=submitButton value=Submit / /form script type=text/javascript //![CDATA[ $('#myForm').submit(function() { var options = { target: '#myForm', }; $(this).ajaxSubmit(options); return false; }); //]] /script When I am loading the fragment, the javascript will not be executed and the form will not be prepared for the ajax request. Submitting the formular will end up in a plain HTTP request. Can anyone tell me how to solve this? Thanks, Harald ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem loading HTML and Script Code with Ajax
Can anyone tell me how to solve this? The code you have should work fine if it's moved to a doc-ready function. But you can simplify it even more with ajaxForm: $(function() { $('#myForm').ajaxForm( { target: '#myForm' }); }); Remember, you need to wait for doc-ready before accessing dom elements. Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Get first ancestor of type
Umm, sorry, the other answers that came in somehow weren't attached to the same thread in my email, so I didn't see them before posting mine. If one of those worked for you, use it instead. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 16, 2007, at 9:00 AM, Karl Swedberg wrote: Hi Chris, Someone wrote an ancestorsTo() plugin a while back. There was some talk about changing its name to parentsUntil() and including it with nextUntil() in a single plugin. Not sure who wrote the plugin originally, but Dave Methvin refers to it here: Would this be a candidate for addition to the core possibly? The ancestorsTo looks like it's an up-the-tree analog of the nextUntil method for siblings that was discussed here a while back. I think the general consensus on that was that there would be an extended navigation plugin rather than add all these to the core. Maybe they should be named ancestorsUntil and siblingsUntil for better consistency? Also, since this is a modifying plugin it should use pushStack() to allow the use of .end() to get back to the previous selected nodes. I think the end result would be something like this, untested: jQuery.fn.ancestorsUntil = function(match) { var a = []; jQuery(this[0]).ancestors().each(function() { a.push(this); return !jQuery(this).is(match); }); return this.pushStack(a, arguments); }; Hope that helps. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 15, 2007, at 9:09 PM, Chris Domigan wrote: Hi there, How would I select the first ancestor of a certain type? Eg if I want to select the first div that is found while searching up the DOM from an element. Cheers, Chris ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface 1.1
interface is still very slow. dragging isn't nearly fast enough...there's like a two second time gap before you can see what you are doing. at least in Safari... On 16 Jan 2007, at 16:30, j. siefer wrote: really nice! thank you!!! your docu. says for draging elements use string ('parent' or 'document') or array (top, left, width, height) for containment should be array (left, top, width, height) so works fine, greetings jac -- View this message in context: http://www.nabble.com/Interface-1.1- tf3014110.html#a8392024 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface 1.1
j. siefer wrote: really nice! thank you!!! your docu. says for draging elements use string ('parent' or 'document') or array (top, left, width, height) for containment should be array (left, top, width, height) so works fine, greetings jac Does anyone else have an opinion on this? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface 1.1
I will test on safari soon and get back on this. Vaska wrote: interface is still very slow. dragging isn't nearly fast enough...there's like a two second time gap before you can see what you are doing. at least in Safari... On 16 Jan 2007, at 16:30, j. siefer wrote: really nice! thank you!!! your docu. says for draging elements use string ('parent' or 'document') or array (top, left, width, height) for containment should be array (left, top, width, height) so works fine, greetings jac -- View this message in context: http://www.nabble.com/Interface-1.1- tf3014110.html#a8392024 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Timer statement
I am using grow efect, but a I need to call another function just after of determined seconds. Is it possivel I do it with JQuery ? For example: $('#containerMenu').Grow(200); $('#listaMenu').css( {display: block} ); // I need to that statement to be executed after 300 ms $('#teste').css( {display: block} ); -- []'s Harlley R. Oliveira www.syssolution.com.br --- ~ U never try U'll never learn ~ --- ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem loading HTML and Script Code with Ajax
Harald, I just re-read you post. You just need to run the ajaxForm code within the callback method of $.post. In other words, after the new form has been added to the dom you can prepare it using ajaxForm. Sorry for the confusion. Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Problem loading HTML and Script Code with Ajax
That's ok, but I do not know which fragment I will get, so I cannot use the callback method. The script has to be in the fragment I return from the server. By the way it is still not working. The script seems to be executed only for the first request. If I replace the script with the fragment another time, the function cannot be found anymore, even if it exists in the DOM. Harald -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Mike Alsup Sent: Dienstag, 16. Januar 2007 18:49 To: jQuery Discussion. Subject: Re: [jQuery] Problem loading HTML and Script Code with Ajax Harald, I just re-read you post. You just need to run the ajaxForm code within the callback method of $.post. In other words, after the new form has been added to the dom you can prepare it using ajaxForm. Sorry for the confusion. Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery 1.1 regression: $(a, c)... if c is a jQuery object, c = document...
I know this has already been reported... http://jquery.com/dev/bugs/bug/804 ... but does anyone know if this will be fixed or if it's going to be how it is moving forward? Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] JQuery FX set an element to display block in progress ...
Hi, When using fx of JQuery, animate will set display of an element to block in progress, This is a bad thing, so I must wrap another element. Is there any way to use this correctly? Thanks, Yours, Microtoby 2007-1-17 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Timer statement
One approach would be: setTimeout(function() { $('#listaMenu').css('display', 'block'); }, 300); -js ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] datePicker
We also have an upcoming need for a calendar component. Our release is Feb. 26th so I'm not sure if this is going to make it in by then (or if I'll have it done in time). But what about if we come up with a core feature list. I think I can start putting some time towards this. Cheers, -js On 1/15/07, Zach Shelton [EMAIL PROTECTED] wrote: I've only recently discovered jQuery, and I'm quite impressed. I'm going to be porting some code for an application that was developed without a js framework (I'm going to be using it in the next version of my CMS project http://lucidcms.net ). For the most part, I' think this is going to be pretty painless and jQuery will give me a lot of new possibilities. But I'm having a hard time finding a suitable replacement for jscalendar ( http://www.dynarch.com/demos/jscalendar/ ). The datePicker plugin doesn't have the range of features available in jscalendar, and while I admire simplicity and light weight, there are things in jscalendar that I can not give up (inclusion of time element in addition to date is the most critical part). Are there any other date/time selectors out there in the jQuery universe, I've scoured several forums and followed Google search results several pages deep, all to no avail. The best I came up with was a plugin for Drupal that simply takes jscalendar and wraps it with jQuery (along with the Drupal jstools API). If there is nothing out there already, I may have to abandon the conversion effort, as I just don't have the time right now for a doing something as complicated as jscalendar myself. Thanks in advance for any leads you may have. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] JQuery FX set an element to display block in progress ...
What property or properties are you animating? -- Brandon Aaron On 1/16/07, Microtoby [EMAIL PROTECTED] wrote: Hi, When using fx of JQuery, animate will set display of an element to block in progress, This is a bad thing, so I must wrap another element. Is there any way to use this correctly? Thanks, Yours, Microtoby 2007-1-17 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface 1.1
CSS spec puts top before left and width should go before height. It is correct how you have it (top, left, width, height). -- Brandon Aaron On 1/16/07, Stefan Petre [EMAIL PROTECTED] wrote: j. siefer wrote: really nice! thank you!!! your docu. says for draging elements use string ('parent' or 'document') or array (top, left, width, height) for containment should be array (left, top, width, height) so works fine, greetings jac Does anyone else have an opinion on this? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?
thanks very much everyone for helping clarify things. This helps a lot. Yes, it was using firebug that helped me to start figuring what was going on. May I suggest that some extracts of this thread, or whatever, find their way into the getting started docs? It could maybe be just a paragraph or two. Now that it is laid out in front of me it's pretty obvious, but when you come into the thing cold, these things are not obvious. I think it would be a good idea to explicitly state what the object is, and that $ refers to it (I think that's right ... now I mention it I'm not quite sure if $ is an object reference or an operator ... ) - anyhow just a bit of clarification of the basics. The reason I like jQuery very much, is because my needs are simple, and I got it doing useful things very quickly - at the same time it doesn't seem at all restricted as the plugin architecture promises that more advanced things are also there. Just a little extra explanation would really be the icing on the cake, I think. On 1/16/07, Yehuda Katz [EMAIL PROTECTED] wrote: There's a reasonable explanation of the jQuery object in the Visual jQuery Magazine at http://www.visualjquery.com/magazine/issue1.01.pdf On 1/16/07, PragueExpat [EMAIL PROTECTED] wrote: Thanks for the explaination. The reason for my request was my curiosity of what exactly makes up the JQuery Object. For example, I didn't understand that [0] is a reference to the first DOM object. I ran this to try to look at the Object (using 1.04): --- html head script type=text/javascript src=jquery.js/script /head body form input id=test class=test type=text nametest input id=test2 class=test type=text nametest /form script type=text/javascript !-- $(document).ready(function(){ var t = $(.test); var s; for (property in t) { s = s + brbrhr /brbr +property.toString()+ : +t[property].toString(); } document.write(s.toString()); }); //-- /script /body /html --- and learned quite a bit. (Although the page never fully loads, not sure why). Anyway, I would recommend looking at this page for anyone who wants to learn more. (If there is a better way to look at the Object, please post here) - Rich malsup wrote: I second the request for a good understanding of what the JQuery object is. The jQuery object is just a JavaScript object (like Date or Array). It encapsulates zero or more DOM elements and lets you manipulate those elements using the jQuery API. var jq = $('.myClass'); The statement above selects all elements that have a class of 'myClass' and wraps them in an object - the jQuery object. Once those elements are wrapped in a jQuery object you can use the jQuery API to do all kinds of things with them. Like show them all: jq.show(); or add a click event handler to all of them: jq.click(function() { alert ('I was clicked'); }); or access each of the selected DOM elements: jq.each(function(i) { // 'this' is the DOM element inside the 'each' method this.innerHTML = 'my index is ' + i; }); That's really the nuts and bolts of it. jQuery lets you easily select elements in the DOM and do something with them. It's selection capabilities are very powerful and very fast. And it's API is quite extensive. You'll also find that most of the functions in the jQuery API return the jQuery object on which they operate. This means they are chainable and this is great when you want to do more than one thing with the selected elements. The examples above could be combined into a single statement like this: $('.myClass').show().click(function() { alert ('I was clicked'); }).each(function(i) { this.innerHTML = 'my index is ' + i; }); Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/what%27s-the-difference-between-document.getElementById%28%27id%27%29-and-%24%28%27-id%27%29---tf3017662.html#a8391034 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Yehuda Katz Web Developer | Wycats Designs (ph) 718.877.1325 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131 ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] Thickbox CSS - Including in Thickbox.js?
Hi all, Here is a question I have, and perhaps this is doable (I can't see why not), but why don't the *box scripts like Thickbox, Lightbox, etc, just write the CSS in the Javascript file, and eliminate the need to include a CSS file (or it's contents in your CSS)? For instance, I know Safari has issues appending child elements to the head, but scriptaculous just does a simple document.write to brute-force the script in there. Why not with style elements? Perhaps there is some issue I am not seeing, but couldn't this be fairly easily done? The project I am working on is rather large, and editing the CSS file is a bit of a pain, so I was wondering if it would be easier to just do this in the JS? IMO, there appear to be two ways to do this: document.write the styles in the head between two style tags, OR use jQuery to add the CSS styles to the elements each. Any thoughts before I give this a go? I don't want to waste an hour doing something if someone else has tried it and found it impossible. Thanks guys, -- View this message in context: http://www.nabble.com/Thickbox-CSS---Including-in-Thickbox.js--tf3022867.html#a8396709 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery Birthday
On Jan 16, 2007, at 5:25 AM, Sam Collett wrote: My French is limited to what translation sites give me... grammer, rather than the words is what is hard (as individual words can be looked up easily, but stringing them together to form a coherent sentence is the challenge). Those with English as a first language can have poor grammer, so your English is fine. Also, those with good grammar can have poor spelling. :) http://www.englishrules.com/writing/2005/spelling-grammar.php (just a little teasing. all in good fun.) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dynamically Loaded Scripts in IE 7 - Problems Found and Lessons Learned
Great information! Exploration like this is what we all need. Good work. However, I am dealing with these problems right now... I've addressed them in Firefox and it works without issue; however, in Internet Exploder (6 7) the issues occur. The issues I describe below only occur in IE. Similar to what you described, I have a Master Layout (host) page that loads content specified in a URL param (guest) via .load() into a div in the Master Layout. This works perfectly until I load content that contains a form. The dynamically loaded content containing the form displays just fine. However, I have a Jquery based Validation and Form submission script that runs against the form. There are no JS errors and the the script seems to not run. It seems that the scripts cannot access any of the form elements contained in the dynamically loaded content. I've tried various techniques to resolve this issue... I've moved the scripts from the guest file to the host file and vice versa. I've added functions to the guest file that call stored functions in the host file to rebind the elements. I'm at a loss. If there is a way to update the page's DOM when the dynamic content is loaded? If so, this would probably address the issue? Any suggestions? Again, great work. Norbert wrote: Dear all, I have spent quite a bit of time trying to make a dynamically-loaded page's scripts work in IE 7 and Firefox and would like to share with you the lessons I have learnt. You might find my discoveries obvious or trivial, but I am still going to post them in case they are useful to someone: I have a page (host page) that is loading another page (guest page) into a div via the .load() ajax function. The host page's head element contains links to all the project's JavaScript files (including jquery.js) and style sheets files. The guest page just contains links to the JavaScript files and style sheets files applicable to the content it is loading. However, these links are not put into the head section as IE seems to ignore links placed there (thanks to Chris Mcleod for sharing that with us at the end of August). The solution is to put these links into the body tag. The good news is that there is no need to re-load the JavaScript files and style sheets files that were loaded in the host page as these seem to be accessible from the guest page. If you have some inline scripts in the guest page (some of my JavaScript variables are dynamically generated via ASP.NET and therefore need to be inline), the order in which you place the script tags is important as IE and Firefox differ slightly: - If you put the linked script before the inline script, Firefox will execute the inline script before the linked script, whilst IE will execute the linked script before the inline script. - If you put the inline script before the linked script, both Firefox and IE will execute the inline script before the linked script. I use the second approach as it is consistent in the two browsers. Also, take into account that any $(document).ready placed in the guest page JavaScript code will be triggered as soon as it is found (it will not wait until the guest page is loaded). This being the case, I just place the code to be executed when the page is loaded at the bottom of the last loaded script. Another thing that has driven me crazy is the use of var in IE (Firefox doesn't seem to have this problem): In the host page (or any other normally loaded page) any variable declared with var has a limited scope only if it is declared within a context (for example a function). Any variable declared with var outside any context has a global scope and can be accessed from any other place in the code. In the guest page, however, any variable that is preceded with var will have a scope that is limited to the script in which it was declared (I imagine it has something to do with the eval statement used to execute the dynamically loaded script code). That means that, in my case, the variables that were declared in the inline script were not accessible from the code present in the linked scripts. The solution is to remove the var from the variable declarations. If you just put myVariable = 'whatever'; you will be able to access myVariable from the rest of the scripts. A final thing I have discovered that is probably quite obvious is that the guest page JavaScript code can have an effect on the host page DOM. If, for example, your guest page loads the following JavaScript code $('div').css('backgroundColor': '#F00');, all the divs in the host page will turn red. This is probably due to the fact we are loading the guest page into the host page (as oppossed to using an iframe). Tha means that you should be careful when using the jQuery selectors in the guest page JavScript code. Well, that's about it! I hope somebody finds this information useful. If you have found any other
Re: [jQuery] Dylan Verheul's Autocomplete Mod...
Dan, this looks great. I like the Ajax/array flexibility. Do you have some sample backend code that populates the ajax listbox? (e.g. your autocomplete.cfm) Also, how do you match content in the middle of a string? (typing 'rica' will bring up 'Africa') I haven't had much luck with matchSubset or matchContains... Thanks, ___ SEAN O Dan G. Switzer, II wrote: I needed some modifications to the autocomplete library that Dylan Verheul released, and I wanted to share the modded library: http://www.pengoworks.com/workshop/jquery/autocomplete.htm Here are some of the things I fixed/changed: * Supports local data array (can now use w/out AJAX). * Limit dropdown to XX number of results (good for limiting the results to users) * Autofill pre-populates text box as you type * New findValue() method can be used to programmatically determine if the value in the box is a valid option. (Useful for verifying the text entered is an existing value option.) * Dropdown options now correctly re-position themselves on each display (which means they adjust for changing to the DOM) * Dropdown box defaults to the width of the input field its attached to (you can manually specify a larger width as well) * Better emulates Windows autocomplete boxes (for example: hitting delete and retyping the same box will now bring back the dropdown menu) * Miscellaneous bug fixes -Dan ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/Dylan-Verheul%27s-Autocomplete-Mod...-tf2968123.html#a8397446 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] $.ajax call works with 1.04 but not with 1.1
Sasha Oros schrieb: By the way, all the variable values (url, columnNo elementID) are the same for both jQuery libraries. Can you post a test page? Can't spot any obvious errors in your code. -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dylan Verheul's Autocomplete Mod...
Sean, Dan, this looks great. I like the Ajax/array flexibility. Do you have some sample backend code that populates the ajax listbox? (e.g. your autocomplete.cfm) Here's the URL to the AJAX template: http://www.pengoworks.com/workshop/jquery/autocomplete_ajax.cfm?q=sp That currently returns: Sparta|896 Spencer|897 Spencerville|898 Spring Valley|899 Springboro|900 Springfield|901 The code basically expects a pipe delimited list of options separated by new lines. The pipe delimited list is then split into an array. Also, how do you match content in the middle of a string? (typing 'rica' will bring up 'Africa') I haven't had much luck with matchSubset or matchContains... Well, the matchSubset actually is a cache checking option. It's designed to expand the cache search. The matchContains is what you want to set to 1. This should make sure the JS portion of the code actually searches for the matches anywhere in the string. On top of that, your AJAX page also needs to return matches for both exact (matches at the start of the string) and contain (matches anywhere in the string.) The way I handle this is to provide exact returns first and then contain matches second. My SQL would look something like: select 1 as ExactMatch, UserId, Name from User where Name like 'Dan%' union select 0 as ExactMatch, UserId, Name from User where UserId not in ( select UserId from User where Name like 'Dan%' ) and Name like '%Dan%' order by ExactMatch desc, Name asc This allows me to show exact/best matches at top and other interesting matches at the bottom. The code that I'm using needed to allow users to search by either last name or first name. For users who type the last name in first (which is the way the results are returned) then those exact matches appear right at top. I'll try to actually write some documentation when I get a chance. I was trying to find Dylan's original post to the mailing list where he documented the plug-in, but I couldn't find it when I went back to look for it. It almost looked like the post was archived. -Dan ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Interface 1.1
Not sure if there is a correct way to do it. In CSS spec, shorthand properties go both ways: top goes first; left goes last: - margin: top right bottom left; vs. left goes first; top goes second: - background: url(...) no-repeat left top; --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 16, 2007, at 12:47 PM, Stefan Petre wrote: j. siefer wrote: really nice! thank you!!! your docu. says for draging elements use string ('parent' or 'document') or array (top, left, width, height) for containment should be array (left, top, width, height) so works fine, greetings jac Does anyone else have an opinion on this? ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] .callMethod( method )
I don't know if jQuery already has a way to do this (or if anyone else would find it useful), but here's a simple extension to call a method (with or with parameters) via a string. jQuery.fn.callMethod = function( method ) { // calls any method of the object via the passed string; // parameters are optional and comma-delimited; any spaces are preserved; // multiple methods are delimited by a period following the parameter list (e.g.: show().hide()) if (typeof(method) != string) return this; var a = []; if (method.indexOf().) -1) a = method.split().); else a = [method]; var self = this; for (var i = 0; i a.length; i++) { method = a[i]; var j = (method + ().indexOf( ( ); var m = method.substr(0, j).replace(/(^\s*)|(\s*$)/g, ); if (typeof(self[m]) != function) return self; // tolerate invalid methods j++; var k = (method + )).lastIndexOf( ) ) - 1; var p = method.substr( j, (k - j) ); if (p == ) p = []; else { p = p.split(,); for (var k = 0; k p.length; k++) if (!isNaN(p[k])) p[k] = Number(p[k]); } self = self[m].call( self, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9] ); } return self; } jQuery.fn.callMethodInAttribute = function( attribute, defaultMethod ) { return this.each( function() { jQuery(this).callMethod( this[attribute] ? this[attribute] : defaultMethod ); } ); } I find .callMethod() very helpful in debugging/testing but I also use it in production apps. We use a lot of declarative programming techniques and specify an object's behavior based namedspaced attributes. For example, with dozens of snazzy effects available, some 'designers' (aka managers) can't decide which to use. So we use an attribute to determine the hide/show effect. div my:show-effect=DropInLeft(600) my:hide-effect=DropOutDown(600) ../div I currently have a storyboarded presentation that applies sequenced effects to various elements on a timeline. Trying to manage the effects procedurally is a chore, but with .callMethod() its as simple as adding time and actions to the element: div my:timeline-effects=03:fadeIn;09:scrollContent(0.4);15:scrollContent(0.4);2 1:scrollContent(bottom);30:Bounce().Puff() ../div ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Thickbox CSS - Including in Thickbox.js?
Nate, Here is a question I have, and perhaps this is doable (I can't see why not), but why don't the *box scripts like Thickbox, Lightbox, etc, just write the CSS in the Javascript file, and eliminate the need to include a CSS file (or it's contents in your CSS)? I'm just giving a general answer to why API developers may choose to go w/an external stylesheet over programming the stylesheets via the API. I think the reason most people like the idea of an external style sheet is that it allows you to have different style sheets for different purposes--without needing to touch the API. The disadvantage code rewritten this way has, is that it's often impossible to style multiple instances of the same plug-in on the same page in a different style--which can sometimes be necessary. The code has to allow for some way to customize the class declarations. I've only run into a few times when this has been necessary and it's usually w/DHTML menus. -Dan ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?
On 1/16/07, Daniel McBrearty [EMAIL PROTECTED] wrote: (I think that's right ... now I mention it I'm not quite sure if $ is an object reference or an operator ... ) $ is an alias to a function named jQuery, which returns a jQuery object. If you're familiar with Object Oriented Programming, you can think of $(...) and jQuery(...) as sort of like constructor functions. Actually, now that I think about it var $foo = jQuery(#foo); is just a shortcut for var $foo = new jQuery(#foo); From the jQuery source: var jQuery = function(a,c) { // If the context is global, return a new object if ( window == this ) return new jQuery(a,c); // rest of jQuery function. Typical usage of jQuery(...) will trigger the code on line 4 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Jquery Birthday
On 16/01/07, Karl Swedberg [EMAIL PROTECTED] wrote: On Jan 16, 2007, at 5:25 AM, Sam Collett wrote: My French is limited to what translation sites give me... grammer, rather than the words is what is hard (as individual words can be looked up easily, but stringing them together to form a coherent sentence is the challenge). Those with English as a first language can have poor grammer, so your English is fine. Also, those with good grammar can have poor spelling. :) http://www.englishrules.com/writing/2005/spelling-grammar.php (just a little teasing. all in good fun.) --Karl Going a bit off topic here The Firefox spell checked picked it up and I ignored it for some reason. What I find an issue sometimes is fonts (Arial particularly) that are ambiguous with L's next to i's - Illinois. Sadly Google uses Arial. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] what's the difference betweendocument.getElementById('id') and $('#id') ?
Now that it is laid out in front of me it's pretty obvious, but when you come into the thing cold, these things are not obvious. I think it would be a good idea to explicitly state what the object is, and that $ refers to it (I think that's right ... now I mention it I'm not quite sure if $ is an object reference or an operator ... ) - anyhow just a bit of clarification of the basics. It's neither of the above. :-) $ is not an operator. In JavaScript, the $ character can be used in names in the same way as a letter. $ is also not a jQuery object or a reference to one. at all. It is a *function* that returns a jQuery object. A good way to think of the $ function is that it's just like a constructor function (e.g. Date or Array), except you don't use the new operator with it, you just call it. Consider this code: // Give the $ function a more self-explanatory name var createQueryObject = $; // Create a query object for a specified query string var myQueryObject = createQueryObject('#test'); // Call a method of the query object myQueryObject.hide(); That is the same as: $('#test').hide(); Note also that $ and jQuery (used as a name in JavaScript code) are the same thing. So you could also write this code as: jQuery('#test').hide(); Or: var myQueryObject = jQuery('#test'); myQueryObject.hide(); -Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Dylan Verheul's Autocomplete Mod...
Good idea with the UNION statement Dan. Wouldn't have thought about running the query that way. andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan G. Switzer, II Sent: Tuesday, January 16, 2007 2:16 PM To: 'jQuery Discussion.' Subject: Re: [jQuery] Dylan Verheul's Autocomplete Mod... Sean, Dan, this looks great. I like the Ajax/array flexibility. Do you have some sample backend code that populates the ajax listbox? (e.g. your autocomplete.cfm) Here's the URL to the AJAX template: http://www.pengoworks.com/workshop/jquery/autocomplete_ajax.cfm?q=sp That currently returns: Sparta|896 Spencer|897 Spencerville|898 Spring Valley|899 Springboro|900 Springfield|901 The code basically expects a pipe delimited list of options separated by new lines. The pipe delimited list is then split into an array. Also, how do you match content in the middle of a string? (typing 'rica' will bring up 'Africa') I haven't had much luck with matchSubset or matchContains... Well, the matchSubset actually is a cache checking option. It's designed to expand the cache search. The matchContains is what you want to set to 1. This should make sure the JS portion of the code actually searches for the matches anywhere in the string. On top of that, your AJAX page also needs to return matches for both exact (matches at the start of the string) and contain (matches anywhere in the string.) The way I handle this is to provide exact returns first and then contain matches second. My SQL would look something like: select 1 as ExactMatch, UserId, Name from User where Name like 'Dan%' union select 0 as ExactMatch, UserId, Name from User where UserId not in ( select UserId from User where Name like 'Dan%' ) and Name like '%Dan%' order by ExactMatch desc, Name asc This allows me to show exact/best matches at top and other interesting matches at the bottom. The code that I'm using needed to allow users to search by either last name or first name. For users who type the last name in first (which is the way the results are returned) then those exact matches appear right at top. I'll try to actually write some documentation when I get a chance. I was trying to find Dylan's original post to the mailing list where he documented the plug-in, but I couldn't find it when I went back to look for it. It almost looked like the post was archived. -Dan ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1 regression: $(a, c)... if c is a jQuery object, c = document...
This will be fixed - we're planning on a 1.1.1 release this weekend to fix all the outstanding issues with 1.1. --John On 1/16/07, Rich Manalang [EMAIL PROTECTED] wrote: I know this has already been reported... http://jquery.com/dev/bugs/bug/804 ... but does anyone know if this will be fixed or if it's going to be how it is moving forward? Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
[jQuery] jQuery 1.1: can't get click event to cancel default action and stop bubbling...
I don't know if others are having as tough a time moving to 1.1 as I am, I hope I'm doing something stupid. Anyway, here's my latest find... I was using the toggle() function to toggle a div in an open/close state, but then after the 1.1 upgrade, the toogle wasn't canceling the default action on the a tag that it was attached to (the a tag has an href). So, I put in a ticket for this (http://jquery.com/dev/bugs/bug/828/). So, as a workaround, I thought I'd try using the click event instead (even though I know that toggle uses the click event internally). Here's my code: $(.maxmin).unbind().bind('click',function() { var p = $(this).parents(.container); var pb = $(.content,p[0]); if (pb.css('display') != 'none') { pb.hide(); $.get(scriptURI,{tab:$.query(tab),pageletname:p.attr (id),min:1}); } else { pb.show(); $.get(scriptURI,{tab:$.query(tab),pageletname:p.attr (id),min:0}); } return false; }) Notice the return false at the end of the function... this is supposed to stop bubbling and cancel the default action it's not. Is anyone else experiencing this with 1.1? Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] [plugin] jdMenu - Finally Released!
Aaron Heimlich schrieb: jQuery does some basic normalization to ensure the event object you receive complies with the W3C DOM2 Spec (and yes, event.target vs. event.srcElement is one of them). See http://docs.jquery.com/Events_%28Guide%29 for more info (Note: there don't seem to be any pages linking here[1]. I actually had to search to find it). The plan is to add mouse and keyboard normalization to jQuery core and the offset stuff to the dimensions plugin, and documenting that stuff on the page. I also want to document the guts of jQuery's event system there, there is so much work to do... -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery 1.1: can't get click event to cancel default action and stop bubbling...
Hi John. I created a test page, but can't reproduce it on that page. However, I can give you access to the app that this is running on so you can see for yourself. I'll email send the info to your gmail acct. Thx! Rich On 1/16/07, John Resig [EMAIL PROTECTED] wrote: Do you have a demo of this running anywhere - perhaps a simpler one that doesn't use Ajax? I haven't been able to duplicate this. --John On 1/16/07, Rich Manalang [EMAIL PROTECTED] wrote: I don't know if others are having as tough a time moving to 1.1 as I am, I hope I'm doing something stupid. Anyway, here's my latest find... I was using the toggle() function to toggle a div in an open/close state, but then after the 1.1 upgrade, the toogle wasn't canceling the default action on the a tag that it was attached to (the a tag has an href). So, I put in a ticket for this ( http://jquery.com/dev/bugs/bug/828/). So, as a workaround, I thought I'd try using the click event instead (even though I know that toggle uses the click event internally). Here's my code: $(.maxmin).unbind().bind('click',function() { var p = $(this).parents(.container); var pb = $(.content,p[0]); if (pb.css('display') != 'none') { pb.hide(); $.get(scriptURI,{tab:$.query(tab),pageletname: p.attr(id),min:1}); } else { pb.show(); $.get(scriptURI,{tab:$.query(tab),pageletname:p.attr(id),min:0}); } return false; }) Notice the return false at the end of the function... this is supposed to stop bubbling and cancel the default action it's not. Is anyone else experiencing this with 1.1? Rich ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Thickbox CSS - Including in Thickbox.js?
Nate Cavanaugh schrieb: Any thoughts before I give this a go? I don't want to waste an hour doing something if someone else has tried it and found it impossible. I prefer a mixed approach: Hardcode any necessary styles with JS. For example, a tooltip[1] needs absolute positioning and a resonable high z-index. Style everything else via stylesheets, using IDs and classes: There can by only one tooltip instance at a time, so it is safe to give it an ID (#tooltip). Subelements of the tooltip are referenced by tag names or classes (h3, p.body, p.url). The plugin allows to add extra classes to the tooltip when applied to certain elements, allowing you to give one tooltip several styles. I think Stefan Petre (Interface) prefers the JS approach: Put everything into JS, require no additional CSS files. Works quite well, too, and is easier to manage with lots of plugins used. [1] http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ -- Jörn Zaefferer http://bassistance.de ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] click and dblclick-problem
Dave Methvin schrieb: click works fine when i doubleclick the item the doubleclick gets execute, BUT click gets executed twice BEFORE. That's the way the events work. By the time it figures out you wanted a double-click, it has already delivered a click. You can avoid doing the click action by using setTimeout in the click() handler for say 400ms, and only execute the click action if the timer expires. Your double-click handler should cancel the timer and perform the double-click action. You cannot make the click timeout shorter than the double-click time, which in Windows is configurable by the user. So don't try to make the click timeout short. Maybe there is a cleaner solution. From the DOM Level 2 Events Spec: If multiple clicks occur at the same screen location, the sequence repeats with the detail attribute incrementing with each repetition. This event is valid for most elements. http://www.w3.org/TR/DOM-Level-2-Events/events.html So you could try to handle single and double click with the click event via the event.detail property: $('#click-me').bind('click', function(e) { if (e.detail == 2) { alert('Double click'); } else if (e.detail == 1) { alert('Single click'); } }); There is no double click in the specification by the way. -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Thickbox CSS - Including in Thickbox.js?
I suggest that if you're going to include CSS in your JS, only do what's necessary for the functionality (z-index, positioning are great examples); leave the *styling* to an external file where it belongs. Jörn Zaefferer wrote: Nate Cavanaugh schrieb: Any thoughts before I give this a go? I don't want to waste an hour doing something if someone else has tried it and found it impossible. I prefer a mixed approach: Hardcode any necessary styles with JS. For example, a tooltip[1] needs absolute positioning and a resonable high z-index. Style everything else via stylesheets, using IDs and classes: There can by only one tooltip instance at a time, so it is safe to give it an ID (#tooltip). Subelements of the tooltip are referenced by tag names or classes (h3, p.body, p.url). The plugin allows to add extra classes to the tooltip when applied to certain elements, allowing you to give one tooltip several styles. I think Stefan Petre (Interface) prefers the JS approach: Put everything into JS, require no additional CSS files. Works quite well, too, and is easier to manage with lots of plugins used. [1] http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] Testing for presence of ID
John Resig schrieb: I'd try something like this: $(function() { var field = $(#second_field_to_enter)[0]; if ( field ) { field.focus(); } else { $(#first_field_to_enter)[0].focus(); } }); That might get you at your desired goal. --John Hey John, I thought you're guy writing the shortest JavaScript code in the world. What about: $(function() { var field = $(#second_field_to_enter)[0] || $(#first_field_to_enter)[0].focus(); field.focus(); }); ;-) -- Klaus ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/