[jQuery] Re: fadeIn w/jQuery 1.1.3?
The fade in message is not hidden. Try: $('#warning').css('opacity', 0).fadeIn(2000); or $('#warning').fadeOut(2000).fadeIn(2000); -- Brandon Aaron On 7/3/07, Priest, James (NIH/NIEHS) [C] [EMAIL PROTECTED] wrote: -Original Message- From: John Resig [mailto:[EMAIL PROTECTED] Sent: Monday, July 02, 2007 3:17 PM Brandon just committed a fix for this to SVN. If you could try it, and let us know if it works for you, that'd be good (if you can). http://code.google.com/p/jquery Sorry for the delay - came in this morning - checked out /trunk and did 'ant build' and tried the jquery.js file. I still get the same behaviour. FadeIn does nothing. FadeOut works as expected. :( I also stripped everything out to a basic HTML file and still see the same thing. -- script type=text/javascript language=javascript src=jquery.js/script script type=text/javascript $(document).ready( function(){ $(#warning).fadeIn(2000); $(#warning2).fadeOut(2000); }); /script div id=warningpFADE IN/p/div div id=warning2pFADE OUT/p/div -- Jim
[jQuery] Re: ReBinding
If you have updated to jQuery 1.1.3 you can use the new behavior plugin. It attaches events based on the selector even after the DOM has been updated. http://jquery.com/plugins/project/behavior/ -- Brandon Aaron On 7/3/07, DXCJames [EMAIL PROTECTED] wrote: I am building a app that has a lot of $.posts so it requires me to rebind alot.. for some reason i have an infinite loop in IE but not FF and i cant figure out how it happened.. anyway.. do you think instead of binding functions to the locations, just using onclick= and just having functions for the actions? which would take out the need to rebind every time something loads something, which by the way happens ALOT! I could always leave the things that have no need to be rebound alone.. and have the other actions be functions that are called by from onclick, onkeypress, ect. Thanks in advanced!!!
[jQuery] Re: OT: iPhone Interface in JavaScript
And if you use the minified version and gzip it it is only 11kb! Go! Go! HTTP Compression! -- Brandon Aaron On 7/3/07, Rey Bango [EMAIL PROTECTED] wrote: Some of you may have seen this but in case you missed it, David Cann created a cool littel iPhone interface that can help you determine what your app would look like using Apple's wonder phone. You can check it out here: http://davidcann.com/iphone/ I got the link from an site listed on Ajaxian which used it to build an iPhone version of NewYorkOnTap.com (http://www.newyorkontap.com/mobileDemo.aspx). The thing that stood out was his mention of how he got around ATT's slow Edge network: It's a bar and subway finder for New York City, and I implement a number of techniques to overcome some of the short coming of ATT's edge network. Virtually the entire site is composed from a single javascript file of just under 25k. By reusing components and keeping server refreshes to an absolute minimum while pulling data in via ajax, I was able to create a pretty responsive component that feels like it belongs on the iPhone (i hope!). With jQuery sitting at 20kb, its definitely positioned to be the library of choice for iPhone apps. Rey...
[jQuery] Re: 1.1.3 breaks opacity effects in IE?
I just checked in a fix for the IE opacity issues. Sorry guys ... we did so much testing and preparing for this one ... just can't catch them all I suppose. I think we have one more major issue to squash in 1.1.3 and then we will do another bug fix release. In the mean time just grab the latest from SVN if you can. -- Brandon Aaron On 7/2/07, Mike Alsup [EMAIL PROTECTED] wrote: Sorry about that, Sam. You're quite right. I was testing with the wrong release. The opacity is not working correctly in IE7. Is IE6 working? Virtual PC is giving me fits at the moment. Mike On 7/2/07, Sam Collett [EMAIL PROTECTED] wrote: The blocking is fine, it's just the background is completely black (or whatever colour you set for the overlay): http://www.texotela.co.uk/blockUI.php On Jul 2, 1:29 pm, Mike Alsup [EMAIL PROTECTED] wrote: This also affects the blockUI plugin which also uses opacity. Sam, BlockUI doesn't have any problems with 1.1.3. I'm seeing the same issue that Gordon pointed out with IE7 and animations, but blockUI works fine. Mike
[jQuery] Re: 1.1.3 breaks opacity effects in IE?
I saw the bug report for this ... do you have a test case? I can't reproduce this one. -- Brandon Aaron On 7/2/07, weepy [EMAIL PROTECTED] wrote: I also had a problem, this time only with IE6 line 1587 == return elem.filter ? (parseFloat( elem.filter.match(/ opacity=([^)]*)/)[1] ) / 100).toString() : ; was causing an error as my filter didnt have opacity= string in it. i fixed by changing to : == return elem.filter ? (parseFloat( (elem.filter.match(/ opacity=([^)]*)/) || [100]) [1] ) / 1 00).toString() : ;
[jQuery] Re: sprintf or printf for jquery?
You might wanna check this out: http://bassistance.de/jquery-plugins/jquery-plugin-format/ On 7/2/07, Robert O'Rourke [EMAIL PROTECTED] wrote: Hi there, I'm having fun with Kelvin Luck's datePicker plugin but I've run into a snag where I need to display a number with a leading 0 if it's only 1 character for the thing to work. I'm pulling out the startDate and endDate from the maximum bounds of the select elements I'm using. Does jQuery have something like printf() that will do this for me? There are a couple of functions out there that people have written but they're pretty meaty for my purposes. I was looking at http://www.vladdy.net/Demos/printf.html but the code is beyond me. Cheers, Rob -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: fadeIn w/jQuery 1.1.3?
On 7/2/07, John Resig [EMAIL PROTECTED] wrote: http://code.google.com/p/jquery Returns 404 Not Found -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: fadeIn w/jQuery 1.1.3?
That should be: http://code.google.com/p/jqueryjs/ On 7/2/07, Aaron Heimlich [EMAIL PROTECTED] wrote: On 7/2/07, John Resig [EMAIL PROTECTED] wrote: http://code.google.com/p/jquery Returns 404 Not Found -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: window.onresize event
This blog post from Jonathan Snook might help you out some. http://snook.ca/archives/javascript/ie6_fires_onresize/ Also, you could set a flag using setTimeout ... if the resize function gets called before the setTimeout runs ... reset it. Something along the lines of this: function doSomething() { alert(I'm done resizing for the moment); }; var resizeTimer = null; $(window).bind('resize', function() { if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(doSomething, 100); }); -- Brandon Aaron On 7/2/07, Marshall Salinger [EMAIL PROTECTED] wrote: Is there a way to simulate the behavior of FireFox with an window.onresize event in IE? Where the event only fires at the end of the onresize method? It appears that doing too many calculations on a layout while resizing the window in IE makes it slow down considerably until it finally makes all the calculations and renders the changes. FireFox works great because it waits until the resizing is done. Thanks, Marshall
[jQuery] Re: Interface Plugin - Pulsate and Bounce Newline Problems
BTW ... this is fixed in the upcoming jQuery 1.1.3. :) -- Brandon Aaron On 6/29/07, Adam Greene [EMAIL PROTECTED] wrote: hi Nathan, I ran into the same issue as well. The jQuery.fx method is setting the effected element to display:block, and that is the root of your troubles. I'm not an expert in css, but for my jQuery pulsate call on a span, I added this to its style: display:inline !important; which overrides the inline 'display:block' that jQuery.fx addess to the span element. I hope that helps. Regards, Adam On Jun 19, 4:13 pm, cfdvlpr [EMAIL PROTECTED] wrote: Has anyone else noticed that when they use these functions on an span element that contains text, it will kick your span to a new line while the effect is taking place? It's almost as if a br is inserted temporarily. Any way to fix this?
[jQuery] Re: validate() not working in IE(6 7)
There is a known bug with Validate and jQuery 1.1.3a. -- Brandon Aaron On 6/28/07, Luc Pestille [EMAIL PROTECTED] wrote: Hi all, For some reason, the validate() plugin has somehow stopped working for me in IE. It did at a point in the past, but as it was working I didn't pay attention to it and carried on developing the rest of the site. I thought it might be a bug with jQuery 1.1.3a and validate() v1 RC1, so I updated to validate() v1.1, but still no joy. Taking out TinyMCE also has no effect. Everything works as I'd expect in FF. Are there any known bugs with validate() v1.1 and IE? Thanks, *Luc Pestille* Web Designer [image: in2 is part of the BWP Group] in2, Thames House, Mere Park, Dedmere Road, Marlow, Bucks, SL7 1PB tel: +44 (1628) 899700 | fax: +44 (1628) 899701 | email: [EMAIL PROTECTED] | web: www.in2.co.uk This message (and any associated files) is intended only for the use of jquery-en@googlegroups.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not jquery-en@googlegroups.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author jquery-en@googlegroups.com and do not necessarily represent those of the company. inline: in2logo_long.gif
[jQuery] Re: Dimensions - scrollTop
On 6/27/07, Glen Lipka [EMAIL PROTECTED] wrote: I dont understand how scrollTop works. Look at this demo page. http://www.commadot.com/jquery/dimensions/ Scroll to the bottom and click the box. Shouldn't it have something in ScrollTop? It is the window that has the scroll offset in this case. If you have a div with overflow auto and scroll it, it will also have a scrollTop. $(window).scrollTop(); And with 1.0 you can set the scrollTop. $(window).scrollTop(100); To illustrate how scrollTop works on an element just go to the visual offset test page ( http://brandonaaron.net/jquery/plugins/dimensions/test/offset_visual.html) and run this line of code in firebug. $('#relative3').scrollTop(100).scrollTop(); I tried $(body).scrollTop() too. I think this plugin is really powerful and useful, but the documentation is really small right now. The examples are lacking but there are inline docs which explain the API. I am working on finalizing 1.0 and the I will write some better docs with examples soon. It will take time since this is a pretty powerful plugin. If anyone would like to help write some docs and/or put together some examples, it would be much appreciated. -- Brandon Aaron
[jQuery] Re: Dimensions - scrollTop
That kind of effect should not be in the dimensions plugin but rather in a UI plugin. Demos would help out so much. -- Brandon Aaron On 6/27/07, Glen Lipka [EMAIL PROTECTED] wrote: Ahh, I see. Thank you. In terms of setting the ScrollTop, is it possible for that to take a Duration parameter so it could do a slow scroll? Maybe even take easing? Its alot less jarring on the user that way. (Although certainly not for all circumstances) Im excited to swap out for 1.0. I can help make demos if that helps. Not sure how much I can do with my limited technical ability. Glen On 6/27/07, Brandon Aaron [EMAIL PROTECTED] wrote: On 6/27/07, Glen Lipka [EMAIL PROTECTED] wrote: I dont understand how scrollTop works. Look at this demo page. http://www.commadot.com/jquery/dimensions/ Scroll to the bottom and click the box. Shouldn't it have something in ScrollTop? It is the window that has the scroll offset in this case. If you have a div with overflow auto and scroll it, it will also have a scrollTop. $(window).scrollTop(); And with 1.0 you can set the scrollTop. $(window).scrollTop(100); To illustrate how scrollTop works on an element just go to the visual offset test page (http://brandonaaron.net/jquery/plugins/dimensions/test/offset_visual.html ) and run this line of code in firebug. $('#relative3').scrollTop(100).scrollTop(); I tried $(body).scrollTop() too. I think this plugin is really powerful and useful, but the documentation is really small right now. The examples are lacking but there are inline docs which explain the API. I am working on finalizing 1.0 and the I will write some better docs with examples soon. It will take time since this is a pretty powerful plugin. If anyone would like to help write some docs and/or put together some examples, it would be much appreciated. -- Brandon Aaron
[jQuery] Re: Unexpected call to method or property access
I think this might be the same bug that is currently causing issues for the validation plugin with 1.1.3a. I hope to find time to fix it tonight. -- Brandon Aaron On 6/26/07, Gordon [EMAIL PROTECTED] wrote: Update: Replacing the 1.1.3a jQuery library with 1.1.2 seems to fix the problem, this would seem to suggest a bug in the new version is causing my problem. On Jun 26, 3:16 pm, Gordon [EMAIL PROTECTED] wrote: I am working on code that will dynamically add some controls to a form. As these controls are meant to be unobtrusive (they add an address lookup field to the form that won't work without javascript) the HTRML code is to be left out of the form itself and added by the script. A (cut down) versio nof the HTML looks like this: form action=# method=post fieldset blah blah blah /fieldset fieldset class=alt id=addinfo-address legendAddress/legend pAddress/p input type=hidden id=address-prefix value=card. / label for=line-1 span class=labelAddress (1): spanRequired/span/span input class=fvRequired type=text name=card.line-1 id=line-1 value= / /label label for=line-2 span class=labelAddress (2):/span input class=fvOptional type=text name=card.line-2 id=line-2 value= / /label label for=line-3 span class=labelAddress (3): /span input class=fvOptional type=text name=card.line-3 id=line-3 value= / /label label for=line-4 span class=labelAddress (4): /span input class=fvOptional type=text name=card.line-4 id=line-4 value= / /label label for=postcode span class=labelPostcode: spanRequired/span/span input class=fvRequired type=text name=card.postcode id=postcode value= / /label labelinput type=submit value=Choose Delivery Address #187; class=button //label /fieldset /form My Javascript looks like this: function addLookupFields () { $('#addinfo-address').before (fieldset style=\display: none;\ class=\highlight\ id=\address-lookup\legendAddress Finder/ legendpAddress Finder/plabel for=\address-info\span class= \label\Postcode: /spaninput id=\address-info\ maxlength= \255\ type=\text\ //labellabelinput id=\find-address\ type= \button\ class=\button\ value=\Find Address\ //label/ fieldset); return ($('#address-lookup')); } $(document).ready (function () { addLookupFields ().slideDown ('slow'); }); This works in FireFox, Opera, Safari but in Internet Explorer it causes a script error, Unexpected call to method or property access. Can anyone help with this?
[jQuery] Re: How to Rotate an Image 90 Degrees
On 6/26/07, Su [EMAIL PROTECTED] wrote: swfIR? http://www.swfir.com/ swfIR, IIRC, is geared towards text, though. The only way I know of to do image rotation in JavaScript is with canvas[1] or SVG[2], both of which don't have enough browser support to make the effort worthwhile (assuming you're doing this for a public web site). Flash seems to be the best way to what you're looking for. [1] http://developer.mozilla.org/en/docs/HTML:Canvas [2] http://developer.mozilla.org/en/docs/SVG -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: How to Rotate an Image 90 Degrees
Since when does IE have native canvas support? On 6/26/07, Erik Beeson [EMAIL PROTECTED] wrote: JavaScript is with canvas[1] or SVG[2], both of which don't have enough browser support to Huh? Canvas works on IE6 (with excanvas), IE7, FF since 1.x, Safari and Opera. What other browsers are you looking for? --Erik -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: How to Rotate an Image 90 Degrees
Check out the excanvas project: http://excanvas.sourceforge.net/ -- Brandon Aaron On 6/26/07, Aaron Heimlich [EMAIL PROTECTED] wrote: Since when does IE have native canvas support? On 6/26/07, Erik Beeson [EMAIL PROTECTED] wrote: JavaScript is with canvas[1] or SVG[2], both of which don't have enough browser support to Huh? Canvas works on IE6 (with excanvas), IE7, FF since 1.x, Safari and Opera. What other browsers are you looking for? --Erik -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: How to Rotate an Image 90 Degrees
On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: r u kidding... IE doesnt... excanvas simulates canvas behavior in IE. Which goes back to what I said about their not being enough browser support for the effort to be worthwhile (ON PUBLIC FACING WEB SITES). If you can convince your IE users to download and install excanvas, then more power to you. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: How to Rotate an Image 90 Degrees
On 6/26/07, Erik Beeson [EMAIL PROTECTED] wrote: You misunderstand. It's a javascript file that you include on your page just like jQuery. It's no more installed than jQuery. Just fine for general public use. Well then, I stand corrected. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: jCarouselLite - my first plugin - anxiously awaiting comments
You need to use the outerWidth and outerHeight methods of the Dimensions plugin. The width and height just return the actual width and height according to the box model. -- Brandon Aaron On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: thanks glen, but dimensions also return the same result as does jquery's height() and width() method... I checked dimesion's source and it seems to delegate the call to jquery core's width() / height() method, if the call was not for document or window. So, still i am getting the width and height without the margin... :(.. Is there anything else i am missing here. -GTG On 6/26/07, Glen Lipka [EMAIL PROTECTED] wrote: Are you using the dimensions plugin? It might be worth using. Alot of plugins depend on it. Glen On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: friends, In the process of developing this jCarouselLite plugin, i am facing a problem. When i retrieve the width or height of an element that has a margin associated with it, then the returned width/height does not take the margin into account. Can anyone help me here? Thanks -GTG On 6/26/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: I'm having the same problem with my plug-in... -Dan -- *From:* jquery-en@googlegroups.com [mailto: [EMAIL PROTECTED] *On Behalf Of *Karl Swedberg *Sent:* Tuesday, June 26, 2007 10:11 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: jCarouselLite - my first plugin - anxiously awaiting comments I'm so sorry about that. Unfortunately, your guess is as good as mine. I see that it is listed in the Projects list when I click on the Issues link in the left-hand nav. Probably your best bet is to Submit an Issue for it. In the Projects select list, choose jQuery Plugins Website. Mike Hostetler, who is managing the plugins repository, is keeping an eye on this list and fixing bugs as he has time. If anyone else has an idea for Ganeshji, please chime in! :) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jun 26, 2007, at 1:11 AM, Ganeshji Marwaha wrote: hi karl, i tried adding it to http://jquery.com/plugins/ page. Everthing went thru fine, but the plugin doesn't show up. Is there something that i am doing wrong? -GTG On 6/25/07, *Karl Swedberg* [EMAIL PROTECTED] wrote: be sure to add it to http://jquery.com/plugins/ (without the docs.), too! The docs plugin page is deprecated. (Not gone away, just deprecated.) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jun 25, 2007, at 3:20 PM, Mike Alsup wrote: Just register and then you can add it yourself. BTW, I like this plugin. Cheers! Mike How do i add this plugin to the jquery plugins page (http://docs.jquery.com/Plugins). -- -GTG
[jQuery] Re: jCarouselLite - my first plugin - anxiously awaiting comments
Sorry I thought you where looking for offsetWidth which is what outerWidth method does. -- Brandon Aaron On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: thanks glen... but i don't completely agree, because technically, according to the box model, width does not include border, padding, margin etc. But the total box's width, (not the element's width property) accounts for width+border+padding+margin. This is how a box is seen by the browser AFAIK. So, it is understandable that jquery's width() method returns the elements width style alone . But why is dimension's plugin explicitly intended to give the width+padding+border without including the margin? maybe because that is what offsetWidth property returns and that is what outerWidth means probably... no idea. It would be great if someone knew the answer. Regardless, thank u very much for the calculation suggestion. it works.. i used offsetWidth + margin-left + margin-right and it works like a charm. Dont know what will happen when percent values are specified though. got to try that out as well ;) -GTG On 6/26/07, Glen Lipka [EMAIL PROTECTED] wrote: But margin shouldn't be included in width. According to box model that is outside the box. http://www.w3.org/TR/REC-CSS2/box.html Hmm, is there something that computes it all? http://www.redmelon.net/tstme/box_model/ -- not helpful but cool to play with. You could do it on your own, offset + margin-left + margin-right Glen On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: hey, thanks for putting together a demo page in no time... Still, in your settings the margin is not included. When i include the margin, the outerWidth returns the result excluding the margin. :(( - GTG On 6/26/07, Glen Lipka [EMAIL PROTECTED] wrote: http://www.commadot.com/jquery/dimensions/ Im too slow. But I made a little test page to see what outputs what. Change the settings in firebug and click the box. Glen On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: thanks brandon... lemme try that now i will keep u posted on how it goes... On 6/26/07, Brandon Aaron [EMAIL PROTECTED] wrote: You need to use the outerWidth and outerHeight methods of the Dimensions plugin. The width and height just return the actual width and height according to the box model. -- Brandon Aaron On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: thanks glen, but dimensions also return the same result as does jquery's height() and width() method... I checked dimesion's source and it seems to delegate the call to jquery core's width() / height() method, if the call was not for document or window. So, still i am getting the width and height without the margin... :(.. Is there anything else i am missing here. -GTG On 6/26/07, Glen Lipka [EMAIL PROTECTED] wrote: Are you using the dimensions plugin? It might be worth using. Alot of plugins depend on it. Glen On 6/26/07, Ganeshji Marwaha [EMAIL PROTECTED] wrote: friends, In the process of developing this jCarouselLite plugin, i am facing a problem. When i retrieve the width or height of an element that has a margin associated with it, then the returned width/height does not take the margin into account. Can anyone help me here? Thanks -GTG On 6/26/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: I'm having the same problem with my plug-in... -Dan -- *From:* jquery-en@googlegroups.com [mailto: [EMAIL PROTECTED] *On Behalf Of *Karl Swedberg *Sent:* Tuesday, June 26, 2007 10:11 AM *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: jCarouselLite - my first plugin - anxiously awaiting comments I'm so sorry about that. Unfortunately, your guess is as good as mine. I see that it is listed in the Projects list when I click on the Issues link in the left-hand nav. Probably your best bet is to Submit an Issue for it. In the Projects select list, choose jQuery Plugins Website. Mike Hostetler, who is managing the plugins repository, is keeping an eye on this list and fixing bugs as he has time. If anyone else has an idea for Ganeshji, please chime in! :) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Overlay plugin?
I got this error on FF 2.0.0.4 (Mac OS 10.4.10): e.css is not a function http://www.commadot.com/jquery/easebox/easeBox.js Line 59 Stack trace: showZoom(a matt-big.jpg)easeBox.js (line 59) (no name)()easeBox.js (line 27) (no name)(click clientX=0, clientY=0)jquery-latest.js (line 1398) handle(click clientX=0, clientY=0)jquery-latest.js (line 1302) e.css(z-index,1001); On 6/24/07, Glen Lipka [EMAIL PROTECTED] wrote: dimScreen is great. Check it out: http://www.commadot.com/jquery/easebox/ Although, I changed it slighly to use $(window).width() instead of $(document).width() This might only work with the dimensiosn plugin included. Glen On 6/23/07, Glen Lipka [EMAIL PROTECTED] wrote: It should be Rey Bingo! That's exactly it. Awesome. Thanks. :) Glen On 6/23/07, Rey Bango [EMAIL PROTECTED] wrote: dimScreen: http://docs.jquery.com/Plugins/dimScreen Glen Lipka wrote: I can't find it, but I vaguely remember someone had a plugin that just puts a 50% opacity overlay over the page. Sort of like a thickbox thing, but without all the other stuff. Does anyone know where it is? Glen -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: how could I unbind .hover() ?
The hover bind a mouseover and mouseout event and you can remove them by doing the following: $('div').unbind('mouseover').unbind('mouseout'); -- Brandon Aaron On 6/22/07, March [EMAIL PROTECTED] wrote: i did something like this: $('div').hover(function(){ // do something },function(){ // do something else }); but after some event, i need to disable the hover effect, is there any easy way to do this? thanks -- Zacky Ma www.marchbox.com
[jQuery] Re: how could I unbind .hover() ?
Unfortunately this won't work when using the hover helper method. The hover helper method assigns an anonymous method to both the mouseover and mouseout events. This anonymous function then decides if it should fire the given mouseover or mouseout functions provided to .hover(). -- Brandon Aaron On 6/22/07, Erik Beeson [EMAIL PROTECTED] wrote: In addition to Brandon's suggestion, you could also used named functions instead of anonymous functions if you only want to remove the hover events instead of all mouseover/mouseout events: function hoverOn() { ... } function hoverOff() { ... } $(...).hover(hoverOn, hoverOff); $(...).unbind('mouseover', hoverOn).unbind('mouseout', hoverOff); But probably the easiest way to deal with it is to have your hover functions check some state before doing the hover effects, and then don't worry about unbinding them: $(...).hover(function() { if(/* check for something */) { // do hover stuff here } }, function() { if(/* check for something */) { // do unhover stuff here } }); The check would be specific to your application. --Erik On 6/22/07, March [EMAIL PROTECTED] wrote: i did something like this: $('div').hover(function(){ // do something },function(){ // do something else }); but after some event, i need to disable the hover effect, is there any easy way to do this? thanks -- Zacky Ma www.marchbox.com
[jQuery] Re: Hash to array
var obj = {var:value, othervar:value}; var string = ''; for(var i in obj) { string += (i + '=' + obj[i] + ','); } // the loop leaves a comma dangling at the end of string, chop it off string = string.substring(0, string.length-1); On 6/22/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Warning this is a real noobie question. if you don't mind my asking: what is the simplest way to convert a hash into a string via jquery or javascript , so that obj= { var:value, othervar:value} turns into var=value,othervar=value ? thank you for your time! Alexandre Ce message Envoi est certifié sans virus connu. Analyse effectuée par AVG. Version: 7.5.476 / Base de données virus: 269.9.4/860 - Date: 21/06/2007 17:53 -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Ajax call - lost event handlers
On 6/21/07, Klaus Hartl [EMAIL PROTECTED] wrote: Brandon is working on a behavior plugin, that takes care of that and will bind handlers automatically. It is true and it will be officially released once jQuery 1.1.3 is released. If you don't mind using jQuery 1.1.3 alpha and getting your hands dirty with inline docs and minimal examples ... then you can start using it now. You can grab the latest here: http://jquery.com/plugins/project/behavior And see the example/test here: http://brandonaaron.net/jquery/plugins/behavior/test/test.html -- Brandon Aaron
[jQuery] Re: Ajax call - lost event handlers
I would highly suggest grabbing the latest from SVN instead of the jQuery 1.1.3a download. -- Brandon Aaron On 6/21/07, AJ [EMAIL PROTECTED] wrote: It is true and it will be officially released once jQuery 1.1.3 is released. If you don't mind using jQuery 1.1.3 alpha and getting your hands dirty with inline docs and minimal examples ... then you can start using it now. Wow, thanks! I am in a real crisis with a site right now, so I'll go ahead and try it with 1.1.3 and see how it goes. Will post any findings here later tonight. AJ
[jQuery] Re: Ajax call - lost event handlers
If you need something that works *right now* with 1.1.2, I suggest you take a look at event delegation[1]. [1] http://icant.co.uk/sandbox/eventdelegation/ On 6/21/07, Klaus Hartl [EMAIL PROTECTED] wrote: AJ wrote: It is true and it will be officially released once jQuery 1.1.3 is released. If you don't mind using jQuery 1.1.3 alpha and getting your hands dirty with inline docs and minimal examples ... then you can start using it now. Wow, thanks! I am in a real crisis with a site right now, so I'll go ahead and try it with 1.1.3 and see how it goes. Being in a crisis is not the right time to play with nightly builds ;-) --Klaus -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: create an empty jquery object
I believe it's var $emptyObj = jQuery([]); On 6/20/07, Gordon [EMAIL PROTECTED] wrote: Just a quick question, is there a way to quickly create a jQuery object that contains no elements at all so you can add() them as needed later in the script? -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: getJSON w/ PHP
This assumes, of course, that you: A) Are using PHP 5.2 B) Have the json extension installed from PECL[1] If neither of those apply to you, then there a bunch of pure PHP packages listed in the PHP section near the bottom of http://www.json.org. [1] pecl.php.net/package/JSON On 6/18/07, Michael Geary [EMAIL PROTECTED] wrote: json_encode should also produce valid JSON, which this isn't: {ok:true,state:'OUT-DECOMMISSIONED'} That is a valid JavaScript object literal, so it will work in most cases when the JSON code is being loaded by JavaScript, but if you ever need to feed JSON into a strict JSON parser it won't work. Valid JSON for this would be: {ok:true,state:OUT-DECOMMISSIONED} IOW, all labels must be quoted, and all quotes are double quotes, not single quotes. See http://json.org/ for the full syntax. -Mike -- *From:* Jake, json_encode is very cool, and it looks like it would take care of everyone's problems... THANKS! On 6/18/07, Jake McGraw [EMAIL PROTECTED] wrote: I think Jake nailed it, when using php and json, why not use json_encode? Observe: echo json_encode(array(ok=true,state=OUT-DECOMMISSIONED)); php-json is native in PHP 5.2 and above, and available as a plugin here: http://aurore.net/projects/php-json/ and will always* produce valid json from arrays. - jake * - As much as I've used it, I haven't come across a single problem. On 6/18/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: do you have variables named OUT and DECOMMISSIONED? or did you mean 'OUT-DECOMMISSIONED' as in ? echo {ok:true,state:'OUT-DECOMMISSIONED'}; ? On 6/18/07, Brad Perkins [EMAIL PROTECTED] wrote: I'm trying to use getJSON to return some JSON from a PHP page. I can see that the request is returning the expected response with Firebug, but the getJSON callback isn't firing? My PHP is simply ? echo {ok:true,state:OUT-DECOMMISSIONED}; ? Do a need to set a special content type before returning the JSON? -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Lame fix but working - google toolbar takes over the div
This is already dealt with in 1.0 Final, but it's a good tip for people still using older versions. --Aaron On 6/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hey, in jorn's plugin and in serval more, if you put a div named email or firstname or whatever its writes ANNOYING message such as Google can fill this field for you (and i say : no thanks ;)) anyway i slove it with in that way lets say you have labelemail/labelinput type=text name=emailaddress just stick a comment within it: labele!--blahblah--mail/labelinput type=text name=emailaddress and its should work hope its helps -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Content peeking through popup in IE - should bgiframe help?
Sorry I don't have the answer but the bgiframe is primarily to fix z-index issues in IE with select elements. -- Brandon Aaron On 6/15/07, Scott Sauyet [EMAIL PROTECTED] wrote: Okay, I've been staring at this too long now... help! I have a div that is in-line when JS is off. With JS on, JQuery unobtrusively hides the div, inserts an external link and a close button to toggle it on and off. It works fine everywhere except in IE. I've tested FF2, OP9, and SF3, all on WinXP/SP2. It works fine in those. But in IE7, IE6, and IE5.5, the content underneath the div shows through. This is not just select boxes. A plain H2 element and an IMG are are visible. I thought this was what bgiframe was for, so I've tried to use that, but it doesn't seem to have any effect. Perhaps I'm not using it correctly?I've tried several versions of JQuery; they've made no difference. Right now it's running against HEAD (rev. 2089.) I have a sample page at: http://scott.sauyet.com/issues/2007-06-15a/ You can download a zip of everything at: http://scott.sauyet.com/issues/2007-06-15a.zip Any solutions? Suggestions? Words of condolence? :-) Thanks everyone, -- Scott
[jQuery] Re: @mike: blockUI fix
On the topic of blockUI ... could you change the name of the file to match the folder name: jquery.blockUI.js This will allow you to add a build task to the build.xml so you can quickly provide a min, pack and/or zipped version. -- Brandon Aaron On 6/14/07, Mike Alsup [EMAIL PROTECTED] wrote: Thanks, Gilles! I knew I didn't have that working quite right so I appreciate the patch. Cheers! Mike On 6/14/07, Gilles (Webunity) [EMAIL PROTECTED] wrote: Mike, i've seen that you implemented the tab question i asked for. However, when testing it, i came to the conclusion that you could still tab out of the element, but not back into it. As i can't access SVN from work, i thought i'd post the fix here. I've tested this on the simple dialog example of your site, but adding this extra line: jQuery.blockUI.defaults.allowTabToLeave = 0; // event handler to suppress keyboard/mouse events when blocking handler: function(e) { //-Gilles // Previous allowTabToLeave code did not work. You could tab out, but not tab back in. // This code works different. If you want to tab, and you aren't allowed to leave, it sets // the focus back on the element you are showing. if (e.keyCode e.keyCode == 9 ! $.blockUI.defaults.allowTabToLeave) { if ($(e.target).parents('div.blockMsg').length 0) { return true; } else { // For some reason, calling the focus function did not work here. var v = $(':input:visible:enabled', $.blockUI.impl.pageBlock) [0]; if (v) v.focus(); // Suppress old tabby key return false; } } //-Gilles if ($(e.target).parents('div.blockMsg').length 0) return true; return $ (e.target).parents().children().filter('div.blockUI').length == 0; },
[jQuery] Re: mouseover/mouseout vs. hover
$(document).ready is the original and is what happens behind the scenes ... the shortcut is because we don't like typing. :) -- Brandon Aaron On 6/14/07, Charlie Concepcion [EMAIL PROTECTED] wrote: Thanks Rafael... Thanks Everyone! It works great, man I'm loving this simple jQuery syntax. One more question though... why use the shorcut version vs. document.ready? I mean if this is the case why'd they even make document.ready? On Jun 14, 5:10 pm, Rafael Santos [EMAIL PROTECTED] wrote: $(function(){ //shortcut for $(document).ready(){fn} $(#nav li).hover(function(){ $(this).addClass(over); }),function(){ $(this).removeClass(over); }) }); 2007/6/14, Charlie Concepcion [EMAIL PROTECTED]: Ok I am new to this so here's my old code: $(document).ready(function(){ $(#nav li).mouseover(function(){ $(this).addClass(over);}) .mouseout(function(){ $(this).removeClass(over);}); }); I need that in hover version. I'm assuming it's supposed to be much shorter. On Jun 14, 4:57 pm, Rafael Santos [EMAIL PROTECTED] wrote: I think u can use both, hover and mouseover. jQuery uses javascript to treat it. 2007/6/14, Charlie Concepcion [EMAIL PROTECTED]: I'm new to jQuery and I have to say I love it! I hate javascript but now I like it cuz of query. Anyways enough of that :) I'm a CSS developer also. I know that the :hover pseudo element doesn't work in IE 6 so I always have to use javascript using mouseover/mouseout events. My question is, in jQuery is hover using the CSS or using acting as a backend mouseover event? Final question... what should i use hover or mouseover... making sure it works on IE7, Firefox and IE6. Thanks! -- Rafael Santos Sá :: webdeveloperwww.rafael-santos.com -- Rafael Santos Sá :: webdeveloperwww.rafael-santos.com
[jQuery] Re: JS regular expressions for matching decimal numbers
You're very welcome. Glad I could help. On 6/13/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Aaron Heimlich wrote: Try this: /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/ Thanks, that works great. -- Jörn Zaefferer http://bassistance.de -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Request to all developers: Put version number in file name please
Yeah we just need to do that for the min version as well. I prefer to use the min version and gzip ... better results. jQuery is only 11kb with this technique. Back to the original topic ... the plugins directory of the repository also uses ant to build files. These ant tasks are setup to take advantage of the jquery.plugin_name.js standard. Changing the naming scheme would cause problems. It is however, very important to keep a version number and at least a revision number and last modified date in the header ... even for compressed plugins. If it isn't in the plugin authoring guide ... it should be. Perhaps even a note about how to add the svn properties like $REV$. -- Brandon Aaron On 6/13/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Ⓙⓐⓚⓔ wrote: I thought about that! I tend to download both versions ... I sometimes want to look at what I'm using! The latest build script adds the copyright header, including the version, to all packed scripts. Very handy. -- Jörn Zaefferer http://bassistance.de
[jQuery] Re: outerHTML
Here is a link to a post not too long ago with an outerHTML plugin for jQuery. http://groups.google.com/group/jquery-en/msg/62a2e93f55119d48 -- Brandon Aaron On 6/13/07, Sean Catchpole [EMAIL PROTECTED] wrote: Can anyone else get the outerHTML of a html object? I can't seem to get it anymore. document.getElementById('log').outerHTML returns undefined. I'm using FF2. ~Sean
[jQuery] Re: Release: Validation plugin 1.0 final
Thats awesome Jorn ... great work! -- Brandon Aaron On 6/13/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Its out! A version of the jQuery validation plugin that I call 1.0 final: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ I hope to improve the versioning of the plugin from this point on. On my list of possible milestone targets are more sophisticated event-handling per-element, a lot of integration examples with other plugins and libraries like date- and timepicker, masked input plugin and richtext editors like TinyMCE and FCKEditor. A long term target is to provide the necessary integration code for different serverside frameworks like CakePHP, Rails or JSF. -- Jörn Zaefferer http://bassistance.de
[jQuery] Re: SlickSpeed CSS Selector TestSuite
On 6/12/07, Benjamin Sterling [EMAIL PROTECTED] wrote: (I thought it was on learningjquery.com, but could not find it) an article a couple months back. Could you be thinking of http://aheimlich.freepgs.com/javascript/jquery-11-selector-speeds (server seems to be a bit funky today, so watch out). -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: JS regular expressions for matching decimal numbers
Try this: /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/ Tests: /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(10); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(10.1); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(100.1); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(100.1543); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,000.1543); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,0s300.1543); false /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,000); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,00); false /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(100.); false /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,000,000); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,000,000.2345); true /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,000,00.2345); false /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,00,000.2345); false /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(1,00,000.); false On 6/12/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Hi, has anybody some regular expressions at hand that work in JS to match decimal numbers, eg. 100, 100.4 or 100,120.124 Thanks for sharing. -- Jörn Zaefferer http://bassistance.de -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: SlickSpeed CSS Selector TestSuite
On 6/12/07, Karl Swedberg [EMAIL PROTECTED] wrote: It has a link to a speed test I threw together, and also to Aaron's enhancement. Just so nobody's confused, Karl's link[1] and my Firebug-enhanced speed test[2] both deal with jQuery 1.0, not 1.1. I have yet to upgrade my Firebug-enhanced test to jQuery 1.1. [1] http://www.learningjquery.com/2006/12/quick-tip-optimizing-dom-traversal [2] http://aheimlich.freepgs.com/tests/jquery/speed-test-firebug/ -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: SlickSpeed CSS Selector TestSuite
On 6/12/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: Plus, what happens if you have: div id=bam / span id=bam / What if you need to retrieve the span tag? If it's checking #bam first, won't it only find the div / element? The DOM2 has this to say: getElementById introduced in DOM Level 2 Returns the Element whose ID is given by elementId. If no such element exists, returns null. Behavior is not defined if more than one element has this ID. Source: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBId I would think that the first one the browser finds is selected, but I can't be certain of that as I've never actually tried to do this. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: SlickSpeed CSS Selector TestSuite
On 6/12/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: This just isn't exactly intuitive and can be confusing to people who'd expect a valid CSS selector rule to work in jQuery. Except that, while the selectors are syntactically valid, you can't have duplicate IDs on the same page, so you're basically at the mercy of how the browser decides to handle this situation. As has been said before, scripting on top of an invalid DOM is asking for trouble. If you cannot avoid doing this (i.e. the HTML is generated by a CMS that you have no control over), then $([EMAIL PROTECTED]'bam']).append( -- pink); is probably the best workaround. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: encodeURIComponent localized for custom encoding
Be sure to add this to trac. -- Brandon Aaron On 6/9/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote: I also added to the patch renaming the parameter 'xml' and sometimes 'r' to 'xhr'. I think it makes it easier to read. http://jqueryjs.googlecode.com/svn/branches/jake-dev/src/ajax/ajax.js On 6/7/07, Mike Alsup [EMAIL PROTECTED] wrote: I like this patch. Jörn? Brandon? John? Anyone? alternate encoding done cleanly... http://jqueryjs.googlecode.com/svn/branches/jake-dev/src/ajax/ajax.js a small patch allows escape (or other) instead of encodeURIComponent while localizing all calls to encodeURIComponent this patch seems to make the packed size of jQuery even smaller. $.pair is used in param (serialize) and can easily be overriden. as in $.pair = function(f,v) {return escape(f) + = + escape(v)}; $.ajax({ url: /test.cgi, data: {foo:'Jörn'}, success: function(){console.log(arguments)} }) -- Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
[jQuery] Re: Can a ThickBox appear over the top of my Flash content?
It is possible but you have to set wmode=transparent on the flash. One catch is that the element that shows up over flash can't have any opacity or it doesn't work in Safari or Firefox mac. :( -- Brandon Aaron On 6/8/07, Karl Swedberg [EMAIL PROTECTED] wrote: Actually, Adobe itself wasn't able to do this last time I checked. When CS3 came out, I looked at their announcement on adobe.com. They had a JavaScript drop-down menu that was hidden by the Flash component on the page. It's like Flash objects get z-index: gazillion or something. Now, however, their menu seems to be working correctly, laying on top of the Flash object. Obviously they aren't using Thickbox, but I think the same issue is at work there, namely getting other things to layer over Flash objects. You might be able to glean some valuable info by looking at how they're handling it. Just go to adobe.com and hover over any of the items in the top, horizontal menu. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jun 8, 2007, at 12:02 PM, Alexandre Plennevaux wrote: Note that i could never get it to work on safari http://codylindley.com/thickboxforum/comments.php?DiscussionID=36page=1#Com ment_213 -Original Message- From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.comjquery-en@googlegroups.com] On Behalf Of Oddish Sent: vendredi 8 juin 2007 15:50 To: jQuery (English) Subject: [jQuery] Can a ThickBox appear over the top of my Flash content? Since the link in the thickbox QA is broken, could someone explain how I can make my thickboxes appear over the top of my flash content? Thanks in advance! Ce message Envoi est certifié sans virus connu. Analyse effectuée par AVG. Version: 7.5.472 / Base de données virus: 269.8.11/838 - Date: 7/06/2007 14:21
[jQuery] Re: Getting the window/frame size with JQuery .. help
The dimensions plugin extends the built-in height and width methods to work on the window and document. You can use them like this: $(window).width() or $(window).height() $(document).width() or $(document).height() http://jquery.com/plugins/project/Dimensions -- Brandon Aaron On 6/8/07, moazzamk [EMAIL PROTECTED] wrote: Hi, Does anyone know how to get the height and width of a window. In Firefox, I can do this.innerHeight and it wil show it but it requires a lot of code in IE. If anyone can tell me how to do it with jquery, I'd really appreciate it. Thanks, Moazzam
[jQuery] Re: Ajax script loading issue
It is related to this bug: http://dev.jquery.com/ticket/975 -- Brandon Aaron On 6/8/07, Rey Bango [EMAIL PROTECTED] wrote: Anyone? Rey Bango wrote: A buddy of mine sent me an email asking if I would look into a problem he was having. He's calling a page via $.ajax() using a 'get' to return some text and some javascript. The javascript is a simple alert box; nothing fancy. The script works fine in FF but fails to fire the alertbox in IE. So I tweaked it myself by adding dataType: 'html' to the ajax call. The code now works in IE but fires the alertbox twice when called in FF. Any ideas as to why this would occur? My buddies code: http://www.intoajax.com/joe/joe.htm My code: http://www.intoajax.com/joe/rey.htm Rey... -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com
[jQuery] Re: Ajax script loading issue
It is still not fixed. -- Brandon Aaron On 6/8/07, Rey Bango [EMAIL PROTECTED] wrote: Was this address in v1.1.3? Rey... Brandon Aaron wrote: It is related to this bug: http://dev.jquery.com/ticket/975 -- Brandon Aaron On 6/8/07, *Rey Bango* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Anyone? Rey Bango wrote: A buddy of mine sent me an email asking if I would look into a problem he was having. He's calling a page via $.ajax() using a 'get' to return some text and some javascript. The javascript is a simple alert box; nothing fancy. The script works fine in FF but fails to fire the alertbox in IE. So I tweaked it myself by adding dataType: 'html' to the ajax call. The code now works in IE but fires the alertbox twice when called in FF. Any ideas as to why this would occur? My buddies code: http://www.intoajax.com/joe/joe.htm My code: http://www.intoajax.com/joe/rey.htm Rey... -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://www.iambright.com -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com
[jQuery] Re: Possible Plugin for Adding New Event Types
It is true that jQuery can already handle custom events quite well. This is more for normalizing existing events and enabling the usage of the bind syntax. -- Brandon Aaron On 6/7/07, SeViR [EMAIL PROTECTED] wrote: With jQuery is very simple make new event plugins. This is a sample plugin that I made for my organisation: (sorry comments in spanish :$) /** * @fileoverview * Crea nuevos eventos para la pulsación de las teclas: * INTRO, DELETE, ARROWS, PAGINA arriba y abajo * * @author ATICA * @version 0.1 * @requires jQuery.js */ jQuery.fn.extend({ /** * Evento para la pulsación de la tecla Intro * @param {function} función a ejecutar en el evento */ intropress: function(f){ $(this).bind(intropress,f); $(this).keydown(function(e){ if(e.keyCode==13){ $(this).trigger(intropress);} }); return this; }, /** * Evento para la pulsación de la tecla Suprimir * @param {function} función a ejecutar en el evento */ deletepress: function(f){ $(this).bind(deletepress,f); $(this).keydown(function(e){ if(e.keyCode==46){ $(this).trigger(deletepress);} }); return this; }, /** * Evento para la pulsación de la tecla flecha izquierda * @param {function} función a ejecutar en el evento */ leftpress: function(f){ $(this).bind(leftpress,f); $(this).keydown(function(e){ if(e.keyCode==37){ $(this).trigger(leftpress);} }); return this; }, /** * Evento para la pulsación de la tecla flecha derecha * @param {function} función a ejecutar en el evento */ rightpress: function(f){ $(this).bind(rightpress,f); $(this).keydown(function(e){ if(e.keyCode==39){ $(this).trigger(rightpress);} }); return this; }, /** * Evento para la pulsación de la tecla flecha arriba * @param {function} función a ejecutar en el evento */ uppress: function(f){ $(this).bind(uppress,f); $(this).keydown(function(e){ if(e.keyCode==38){ $(this).trigger(uppress);} }); return this; }, /** * Evento para la pulsación de la tecla flecha abajo * @param {function} función a ejecutar en el evento */ downpress: function(f){ $(this).bind(downpress,f); $(this).keydown(function(e){ if(e.keyCode==40){ $(this).trigger(downpress);} }); return this; }, /** * Evento para la pulsación de la tecla página abajo * @param {function} función a ejecutar en el evento */ pagedownpress: function(f){ $(this).bind(pagedownpress,f); $(this).keydown(function(e){ if(e.keyCode==34){ $(this).trigger(pagedownpress);} }); return this; },/** * Evento para la pulsación de la tecla página arriba * @param {function} función a ejecutar en el evento */ pageuppress: function(f){ $(this).bind(pageuppress,f); $(this).keydown(function(e){ if(e.keyCode==33){ $(this).trigger(pageuppress);} }); return this; }, }); Brandon Aaron escribió: I recently created an plugin/extension for jQuery to use the following syntax for binding events. $('input').bind('mouseover focus', fn); So you can bind multiple event types to the same function quickly. It also applies to .one and .unbind. However, this got me thinking about writing a plugin that would allow us to add new event types ... like mouseenter and mouseleave. So instead of using .hover, you could do this: $(...).bind('mouseenter', fn); or $(...).bind('mouseenter', fn1).bind('mouseenter', fn2); or $(...).unbind('mouseenter', fn1); or $(...).trigger('mouseenter'); etc... So I'm curious about what the jQuery community thinks about this idea? I've built out a proof-of-concept but it is by no means production ready. You can see it in action here: http://www.brandonaaron.net/jquery/plugins/events_extension/test/test.html We could also hook up the mousewheel event in the same way. $(...).bind('mousewheel', fn); Are there other events that could be added/normalized with this plugin? BTW ... Here is the blog post about binding multiple event types: http://blog.brandonaaron.net/2007/06/05/bind-multiple-events-simultaneously-with-jquery/ http://blog.brandonaaron.net/2007/06/05/bind-multiple-events-simultaneously-with-jquery/ -- Brandon Aaron -- Best Regards, José Francisco Rives Lirola sevir1ATgmail.com SeViR CW · Computer Design http://www.sevir.org Murcia - Spain
[jQuery] Re: QuickTime control bar disappearing after .remove() and .load()
Cool, looks like you have it working. Well, here's a couple notes in conclusion. My original problem was this: when embedding a QuickTime object in IE, if you remove the DOM object that contains the QuickTime, then try to make the exact same DOM object with a new QuickTime, the QuickTime control bar fails to appear. An attempt was made to avoid jQuery, and remove/add the QuickTime DOM objects directly with JS, hoping that this would solve the problem. Sadly, after two days of attacking the DOM, I found that the problem still exists. Thankfully, I found a workaround. It's a bad workaround, but it works, it's reliable, and, well, it's the ONLY thing I've seen that's working: I put the QuickTime in an iframe. Which makes me feel a little dirty. But that iframe can be added and removed a thousand times over, and IE properly kills the QuickTime when the iframe is destroyed. So, I'm willing to call this case closed. A little disappointing, but closed. Thanks for all your help, Mike. This is part of a project that's going to see some widespread use, and I'll make sure you get some troubleshooting credit. Aaron
[jQuery] Re: dimensions plugin documentation
It is true that the only documentation is within the file and that it needs more. I hope to write some better documentation soon. -- Brandon Aaron On 6/7/07, pd [EMAIL PROTECTED] wrote: Hello Apologies if I've missed something simple but I can't seem to find simple documentation for dimensions.js other than that inside the actual file. I need a bit more than that. Am I missing something or is this plugin lacking a bit of documentation (no doubt due to over-worked, over-stressed developers, which is understandable)?
[jQuery] Re: ANN: jQuery-Powered Sites: The List Continues to Grow
Looks like Ted Serbinski is part of the team behind it. http://tedserbinski.com/ -- Brandon Aaron On 6/7/07, Joel Birch [EMAIL PROTECTED] wrote: On 08/06/2007, at 7:25 AM, m3avrck wrote: Here's another to add: http://www.mothersclick.com -- one of the largest sites online for moms :-) Mamma-mia, what an achingly beautiful site! Anyone know who designed and developed it? Joel.
[jQuery] Re: QuickTime control bar disappearing after .remove() and .load()
Actually you don't need to go that low-level. Take a peak at the generate method here: http://malsup.com/jquery/media/jquery.media.js I'm sorry, I've gone over the JS a thousand times and I'm not making any progress. My JS just isn't that strong. Looking over the generate method, it looks like I should be able to do something like this: var movieBuild = document.createElement(object type='video/ quicktime' width='500' height='500' date='serve/sample.mov'/ object); ... and append children to that, and then append _that_ as a child to the body to display the movie. But no matter what I do, I'm getting drowned by error messages (for invalid characters, seemingly no matter how I write the line). Can you, in fact, create an element this way?
[jQuery] Re: QuickTime control bar disappearing after .remove() and .load()
Yes, that method or creating the element should work just fine. Can you post a sample page? Maybe there's just a minor typo or something causing the problem. Sure. http://www.andcuriouser.com/sandbox/jqueryqt/test.html The error: Error: uncaught exception: [Exception... String contains an invalid character code: 5 nsresult: 0x80530005 (NS_ERROR_DOM_INVALID_CHARACTER_ERR) location: http:// www.andcuriouser.com/sandbox/jqueryqt/test.html Line: 7] Thanks, Aaron
[jQuery] Re: QuickTime control bar disappearing after .remove() and .load()
anything else won't work as well. Right now, my sample code is FF-only until I can get that up and running (since FF is better for JS debugging). After that, I'll work on IE (using the double-object method). Apple's method works, but it doesn't validate. Compare it to this: object classid=clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B codebase=http://www.apple.com/qtactivex/qtplugin.cab; width=?php echo $moviewidth; ? height=?php echo $movieheight; ? param name=src value=?php echo $filename ? / param name=controller value=true / param name=autoplay value=false / !--[if !IE]-- object type=video/quicktime data=?php echo $filename ? width=?php echo $moviewidth; ? height=?php echo $movieheight; ? param name=autoplay value=false / param name=controller value=true / /object !--![endif]-- /object Anyway, this doesn't have any bearing on my JS problem. Aaron
[jQuery] Re: Input Selector
Try this (totally untested): $(form table tr.required).find([EMAIL PROTECTED]''], [EMAIL PROTECTED]'']).filter(function() { return this.required != false; }); see http://docs.jquery.com/DOM/Traversing#filter.28_filter_.29 info my usage of $().filter() On 6/6/07, Glen Lipka [EMAIL PROTECTED] wrote: I want to construct a selector that finds empty elements in a required tr. However, I want to ignore inputs that have an expando value required=false Something like: $(form table).find([EMAIL PROTECTED]'']).not([EMAIL PROTECTED]'false']); Does this look right? I also want to find selects that have a value of too. :) Would that be: $(form table).find( tr.required [EMAIL PROTECTED]''],[EMAIL PROTECTED]''],).not([EMAIL PROTECTED]'false']); How do you tell the currently selected item in the select? Glen -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Possible Plugin for Adding New Event Types
I recently created an plugin/extension for jQuery to use the following syntax for binding events. $('input').bind('mouseover focus', fn); So you can bind multiple event types to the same function quickly. It also applies to .one and .unbind. However, this got me thinking about writing a plugin that would allow us to add new event types ... like mouseenter and mouseleave. So instead of using .hover, you could do this: $(...).bind('mouseenter', fn); or $(...).bind('mouseenter', fn1).bind('mouseenter', fn2); or $(...).unbind('mouseenter', fn1); or $(...).trigger('mouseenter'); etc... So I'm curious about what the jQuery community thinks about this idea? I've built out a proof-of-concept but it is by no means production ready. You can see it in action here: http://www.brandonaaron.net/jquery/plugins/events_extension/test/test.html We could also hook up the mousewheel event in the same way. $(...).bind('mousewheel', fn); Are there other events that could be added/normalized with this plugin? BTW ... Here is the blog post about binding multiple event types: http://blog.brandonaaron.net/2007/06/05/bind-multiple-events-simultaneously-with-jquery/ -- Brandon Aaron
[jQuery] Re: Remove DOM siblings after current item
All you need is general sibling combinator like this: $('#appendExtraAppointments ~ li').remove(); More info on the selector. http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#general-sibling-combinators http://docs.jquery.com/DOM/Traversing/Selectors -- Brandon Aaron On 6/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have the following DOM: ul liblah 1/li li id=appendExtraAppointmentsblah 2/li liblah 3/li liblah 4/li /ul I would like to remove the li elements after the li id=appendExtraAppointmentsblah 2/li. I tried doing something like this, but it didn't work: $('#appendExtraAppointments').siblings().not($('li').prev).remove(); Any ideas? Thanks!
[jQuery] Re: Problem getting first paragraph
Here is the mouse wheel plugin to help get you started with that. :) http://jquery.com/plugins/project/mousewheel -- Brandon Aaron On 6/5/07, sebastianw wurtz [EMAIL PROTECTED] wrote: Thx guys both solutions work very good and my guestbook look perfect. The next i want to do is study to resolve howto implent something like a pagination withount next page, only with the mousewheel and ajax callback But, this is other story ;) thx again - Mensaje original De: Joel Birch [EMAIL PROTECTED] Para: jquery-en@googlegroups.com Enviado: martes 5 de junio de 2007, 12:34:18 Asunto: [jQuery] Re: Problem getting first paragraph On 06/06/2007, at 1:30 AM, Joel Birch wrote: $('p:first','#book .page').each(function(){ /* do stuff ... */ }); Actually, :first may only ever return one element, maybe this works better: $('p:eq(0)','#book .page').each(function(){ /* do stuff ... */ }); Sorry for the hit-and-miss postings. I'll stop now. Joel. -- *Preguntá. Respondé. Descubrí.* Todo lo que querías saber, y lo que ni imaginabas, está en *Yahoo! Respuestas* (Beta). *Probalo ya! http://ar.answers.yahoo.com*
[jQuery] Re: Ext Calendar on top of jQuery
On 6/5/07, IGx89 [EMAIL PROTECTED] wrote: This doesn't seem to have made it into the v1.1.3a test release; any chance of making the final? It's there alright: http://dev.jquery.com/browser/tags/1.1.3a/src/event/event.js?rev=1938#L57 And here's the latest: http://dev.jquery.com/browser/trunk/jquery/src/event/event.js#L64 On Apr 17, 12:52 pm, Brandon Aaron [EMAIL PROTECTED] wrote: Moving to addEventListener and attachEvent is on the todo list. When will it be done? Soon :) It will involve a lot of regression testing to make sure we don't cause any problems in the transition. -- Brandon Aaron On 4/17/07, mdelmarter [EMAIL PROTECTED] wrote: Hi John and all, I am using Ext with jQuery which is working perfectly together - except in one area. There is an issue with the Calendar when moving between months, it basically moves one month and then the onclick event no longer works. This issue is documented on the Ext forums and seems to be a problem with jQuery using legacy event handlers instead of addEventListener / attachEvent. I am wondering if there is any movement on this issue John? Is there likely to be a resolution or should I forget about using the Ext Calendar? Does anybody else have a fix that can be used here? To read about the issues on the Ext forums: http://extjs.com/forum/showthread.php?t=4683 http://extjs.com/forum/showthread.php?t=3245page=2 To see an example of the issue I have a calendar buried in a blog entry on my site - open the sample application by clicking on the screenshot and then click on the dropdown menu button. You will see that moving between months stops working after the first click. The sample app was built with Ext 1.0 Beta 2, but nothing has changed since then: http://matthew.delmarters.com/weblog/injecting-javascript-and-css-int... An update on this topic would be appreciated :) Regards, Matthew- Hide quoted text - - Show quoted text - -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Bug in jQuery implementation of EXT, works with other libraries.
Thanks for the kind words and testing out jQuery 1.1.3a! Hopefully the last couple of bugs in 1.1.3a will be resolved soon and 1.1.3 will be out the door. -- Brandon Aaron On 6/5/07, cdomigan [EMAIL PROTECTED] wrote: Can I just say that I've started using Jquery 1.1.3a with Ext and it's a HUGE improvement. Most bugs are gone and animations are smooth as silk - thanks to everyone behind this release! Chris
[jQuery] Re: select value lost after clone in IE
Could you please create a new ticket for this? Thanks. -- Brandon Aaron On 6/4/07, Jesse Skinner [EMAIL PROTECTED] wrote: It seems that after a jQuery clone(), the value of select boxes are lost in IE (but not Firefox). Try this out: div select option value=0one/option option value=1 selected='selected'two/option /select /div $(function(){ $('div').clone(true).appendTo('body'); }); The first option will be selected in the cloned select. Doing something like this fixes the problem (as long as there is only one select box), though I suspect there needs to be a better fix in jQuery explicitly: $(function(){ var old = $('div'); var clone = old.clone(true); var select_val = $('select', old).val(); $('select', clone).val(select_val); clone.appendTo('body'); }); Cheers, Jesse www.thefutureoftheweb.com
[jQuery] Re: QuickTime control bar disappearing after .remove() and .load()
I've found that it is somewhat unreliable to add object elements using innerHTML. For my media plugin I resorted to using DOM methods to add media in IE. For an example, look at the generate method at the bottom of this file: http://malsup.com/jquery/media/jquery.media.js Thanks for your suggestion. I'm fairly new to jQuery, so I appreciate some patience. I assume that .html() and .append() are DOM functions, while .load() uses innerHTML? I tried to test things out this way (IE-only Object method): script src=thickbox/jquery-latest.pack.js type=text/javascript/ script body divAbove movie/div div id='TB_movie'/div divBelow movie/div script type=text/javascript var o = object classid=\clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B \ codebase=\http://www.apple.com/qtactivex/qtplugin.cab\; width= \200\ height=\100\param name=\src\ value=\serve/sample.mov\ / param name=\controller\ value=\true\ /param name=\autoplay\ value=\false\ //object; // $(#TB_movie).append(o); $(#TB_movie).html(o); /script /body ... but if you check the results: http://www.andcuriouser.com/sandbox/jqueryqt/test2.html ... they're anything but what I'd expect. Not only do I not get the control bar, but I also get the QuickTime stuck in the top-left corner of the screen, though space is still reserved for it in the appropriate place.
[jQuery] Re: onfocus filter question
If you actually create a function reference instead of passing an anonymous function, they will not be duplicated. var fn = function(e) { alert('in textfield'); }; $('input.text').bind('focus', fn); In the near future, once jQuery 1.1.3 is released, you would be able to use the behavior plugin and it would automagically bind the events to new elements as they are added. It would look like this: $('input.text').behavior('focus', function() { alert('in textfield'); }); Then whenever a new element that matches that selector is added, it will bind the event to it. You can find the behavior plugin here (requires jQuery Rev 1845+): http://brandonaaron.net/jquery/plugins/behavior/ -- Brandon Aaron On 5/31/07, John R [EMAIL PROTECTED] wrote: I have a table with rows of input fields that is dynamic in that the user can add / remove rows. I'm trying to trigger a function whenever the user clicks in any of the fields, so for example I use this: $(input.text).focus( function() { alert(In textfield); } ); After a row is dynamically added, I need to reapply this so the new rows fields will trigger the function as well, but if I just use that line again then the original rows get triggered twice. So, I'm trying to figure out how to filter out all the fields that already have a focus event attached. Basically, how do I say Give me all input.text's that don't have an onfocus set? Thanks John
[jQuery] Unbind not working in IE6
Demonstration code: code script src=thickbox/jquery-latest.pack.js type=text/javascript/ script script type=text/javascript function TB_keyCatch() { $(document).keydown(function(e) { alert(triggering hit); $(document).unbind( keydown ); TB_keyCatch(); }); // keydown } // TB_keyCatch() TB_keyCatch(); /script /code Essentially, if I'm understanding things right, this should trigger the alert when a key is hit, kill the binding, and reload it, waiting for the next hit. In Firefox, it works as expected. In IE, I end up with an endless loop of alert boxes. What's causing the hiccup? I'm guessing it's the fact that it's looking for a key down, and IE is still assuming the key is down when the function is called. I tried using keypress instead of keydown, but keypress doesn't seem to register the left and right arrow keys, which is exactly what I need (and keydown is catching them just fine).
[jQuery] Re: FIX: Firefox throwing NS_ERROR_XPC_JS_THREW_STRING when using input.focus()
Nice, thanks for the info. I have encountered this a few times myself. -- Brandon Aaron On 6/1/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote: While this isn't specifically related to jQuery, it certainly could affect jQuery users, so I thought I'd post the link. It appears Firefox 1.5 (and lower--I don't believe it exists in v2) has an internal bug with dynamically created input / elements and later invoking the focus() method on the field. It will occasionally throw the error NS_ERROR_XPC_JS_THREW_STRING and cause browser freezes. This apparently is a bug in the code relating to Firefox's native autocomplete functionality and can be worked around by adding the attribute autocomplete=off to the elements. NOTE: This doesn't happen every time, it's a seemingly random occurrence. For more detail on the problem, see this link: http://www.activewidgets.com/javascript.forum.3865.1/finally-solved-ns_error _xpc_js_threw_string.html I'm posting this just because I'm sure I've seen this problem crop up from time to time and just never realized it was the culprit. I also thought this would be useful to other JS developers, since it's quite possible many of you are creating dynamic input / elements. -Dan
[jQuery] Re: Unbind not working in IE6
The problem is that even though you're unbinding the old one and attaching a new one, the new one will still be executed, since we're still within a 'keydown' event. You're exactly right. Thanks for taking a look. I found a way to rewrite things so that the functions doesn't have to call itself, and now things work as expected. Aaron
[jQuery] Re: jQuery and Prototype Conflicts
You shouldn't need to call noConflict more than once. Could you post up an example? -- Brandon Aaron On 6/1/07, DaveG [EMAIL PROTECTED] wrote: I'm using prototype and jQ on the same page. I'm using noConflict(). script src=/javascripts/jquery.js type=text/javascript/script script type=text/javascript jQuery.noConflict(); /script Everything is happy. Until I use prototypes Ajax.Update(). The response is a bunch of javascript calls that include calls to prototype routines, like Element.show(). It seems that I need to include a call to noConflict() at the start of the response, otherwise $ does not point to prototype. Am I doing something fundamentally wrong here? Why do I need subsequent calls to noConflict()? ~ ~ Dave
[jQuery] Re: embedding script behaviour different in IE and FF
It is an issue with the evalScripts() method within jQuery. Here is a ticket about this particular bug: http://dev.jquery.com/ticket/975 -- Brandon Aaron On 5/30/07, weepy [EMAIL PROTECTED] wrote: Hi, I'm using $.ajax to pull down some HTML and insert it into the dom. The HTML has some embedded script - in IE it gets fired once, but in FF in gets fired twice - once when it's parsed by jQuery and again when it's inserted into the DOM. I've put a proof of concept here : http://labs.parkerfox.co.uk/jquery/test_ajax.html. On IE there's one popup that says from test, but on FF, there's two. Not sure what happens in Safari. Any one know how to fix these issues ?
[jQuery] Re: Improving performance in FireFox/Opera
jQuery 1.1.3 aims to provide huge performance boost to multiple animations. Feel free to give jQuery 1.1.3a a whirl and let us know if that helps out any. -- Brandon Aaron On 5/31/07, Gordon [EMAIL PROTECTED] wrote: I am working on a project that involves a varying, but potentially quite large number of elements being animated at once, with each element's top, left, width and height all changing together. I use FireFox as my main development browser due to the range of developer-friendly plugins available, and also test in IE and Opera. My code runs as intended in all three but there are some issues with smoothness. In Internet explorer the animation remains smooth under all the cicsumstances I've bee able to throw at it with my test suite. In Firefox, however, the move animation is a little choppy, and in Opera it is EXTREMELY choppy! I am planning to include an option where the user can turn animation effects off but it would be nice to try and get the performance up in the non IE browsers. If you guys have any tips or advice you can offer I would appreciate hearing it.
[jQuery] Re: Improving performance in FireFox/Opera
IE and Safari actually can handle animations very well. Perhaps it is because they have more access to system resources than the other browsers. I'm not exactly sure of the whys but IE does tend to handle timers better. Firefox has some severe issues with timers, especially with lots of them. I'm not really sure whats up with opera. It is usually very fast with JavaScript. -- Brandon Aaron On 5/31/07, Gordon [EMAIL PROTECTED] wrote: Okay, I'll give it a try, once I've gotten a link. I understand that the animate() function in 1.1.2 starts a timer for every element attribute being animated, so if you're doing width, height, top, left you fire four timers per element being moved. Is this correct? I'm assuming one of the 1.1.3 improvements is reducing timer usage, yes? That's kind of got me curious, can IE handle lots of timers running at once better than FireFox? Or does IE do a better job with animation because it's tied into Windows and can access the graphical subsystem at a lower level than the cross-platform Firefox and Opera can? On May 31, 2:32 pm, Brandon Aaron [EMAIL PROTECTED] wrote: jQuery 1.1.3 aims to provide huge performance boost to multiple animations. Feel free to give jQuery 1.1.3a a whirl and let us know if that helps out any. -- Brandon Aaron On 5/31/07, Gordon [EMAIL PROTECTED] wrote: I am working on a project that involves a varying, but potentially quite large number of elements being animated at once, with each element's top, left, width and height all changing together. I use FireFox as my main development browser due to the range of developer-friendly plugins available, and also test in IE and Opera. My code runs as intended in all three but there are some issues with smoothness. In Internet explorer the animation remains smooth under all the cicsumstances I've bee able to throw at it with my test suite. In Firefox, however, the move animation is a little choppy, and in Opera it is EXTREMELY choppy! I am planning to include an option where the user can turn animation effects off but it would be nice to try and get the performance up in the non IE browsers. If you guys have any tips or advice you can offer I would appreciate hearing it.
[jQuery] Re: JQuery DOM manipulation: memory leaks?
I think I just fixed this leak in revision [2010] of jQuery. It had to do with the global cache of events. Please grab the latest from SVN to see if that fixes the issue. -- Brandon Aaron On 5/31/07, Ruchi [EMAIL PROTECTED] wrote: Hi, I'm a JS and JQuery newbie and I'm trying to resolve a memory leak that comes in IE for my code. Basically, I add elements to the DOM dynamically based on a list of items that I receive from a backend server. I used JQuery to create the list dynamically but noticed that the memory taken by IE keeps on increasing every time the code is executed. I read up on JS memory leaks, and while I'm still grappling to understand the issues entirely, I found the pattern below to eliminate memory leaks. !-- Pattern to JS avoid memory leaks from http://www.codeproject.com/jscript/leakpatterns.asp-- [Exhibit 11 - DOM insertion re-ordered - no leaks] html head script type=text/javascript function LeakMemory(){ var hostElement = document.getElementById(hostElement); // Do it a lot, look at Task Manager for memory response for(i = 0; i 5000; i++){ var parentDiv = document.createElement(div onClick='foo()'); var childDiv = document.createElement(div onClick='foo()'); hostElement.appendChild(parentDiv); parentDiv.appendChild(childDiv); parentDiv.removeChild(childDiv); hostElement.removeChild(parentDiv); parentDiv = null; childDiv = null; } hostElement = null; } /script /head body input type=button value=Memory Leaking Insert onclick=LeakMemory() / div id=hostElement/div /body /html When I execute the code above, the memory taken by IE remains constant. My translation of the above pattern using JQuery is below. However this piece of code leaks memory - every time I execute it, the memory taken by IE increases. --- html head script type=text/javascript src=../jsp/assets/scripts/jquery.js/ script script type=text/javascript src=../jsp/assets/scripts/ selector.js/script script type=text/javascript src=../jsp/assets/scripts/ajax.js/ script script type=text/javascript src=../jsp/assets/scripts/event.js/ script script type=text/javascript src=../jsp/assets/scripts/fx.js/ script script type=text/javascript src=../jsp/assets/scripts/iutil.js/ script script type=text/javascript src=../jsp/assets/scripts/ifx.js/ script script type=text/javascript function LeakMemory(){ var hostElement = $(#testJquery); // Do it a lot, look at Task Manager for memory response for(i = 0; i 1000; i++){ var parentDiv = $('div id=abc1234/div'); var childDiv = $('div id=efg1234/div'); parentDiv.text(test content); parentDiv.attr({title: my test tooltip }); parentDiv.bind(click, function(){ alert( $(this).text() ); }); childDiv.text(test content 1); childDiv.attr({title: my test tooltip 1 }); childDiv.bind(click, function(){ alert( $(this).text() ); }); hostElement.append(parentDiv); parentDiv.append(childDiv); childDiv.remove(); parentDiv.remove(); parentDiv = null; childDiv = null; } hostElement = null; } /script /head body input type=button value=Memory Leaking Insert onclick=LeakMemory() / div id=testJquery/div /body /html Please help and let me know in case my usage of JQuery is incorrect. Any suggestion to resolve this issue and avoid potential pitfalls with memory leaks would be greatly appreciated. Thanks in advance, Ruchi
[jQuery] Re: IE selector bug/error - now reproducable.
I'm not able to reproduce this in FF. Your using jQuery 1.1.3a? Is your HTML valid? Could you post up the test page for the group to look at? A workaround might be to use .find(). $('.search-advanced').find('#classtest').hide(); -- Brandon Aaron On 5/30/07, Luc Pestille [EMAIL PROTECTED] wrote: Following on, I was testing something unrelated, after moving back to FF, and it seems that the bug is the same in FF - ID selectors after a space break anything! Someone tell me I'm not going mad? *Luc Pestille* Web Designer -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Luc Pestille *Sent:* 30 May 2007 11:53 *To:* jquery-en@googlegroups.com *Cc:* John Resig *Subject:* [jQuery] Re: IE selector bug/error - now reproducable. I think I've found a bug in jQuery with regards to IE -a blank .html page, with just the latest uncompressed jquery.js and a script file (linked in the header) that looks like this: /* ![CDATA[ */ // when the DOM is ready to be manipulated do some voodoo. $(document).ready( function(){ $(.search-advanced #classtest).hide(); }); /* ]] */ produces an error in IE6 and IE7 (the line number is different in IE7); --- Line 968 Error: 'getElementById' is null or not an object --- however, these selectors produce no such error; $(#search-advanced .classtest).hide(); $(.search-advanced .classtest).hide(); $(#search-advanced).hide(); So it looks like IE doesn't like double ID selectors, or an ID selector after a space. Anyone seen this before, or can reproduce it? I'd rather not have to re-write bits of my site to use classes instead of IDs. *Luc Pestille* Web Designer -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Luc Pestille *Sent:* 29 May 2007 09:51 *To:* jquery-en@googlegroups.com *Subject:* [jQuery] Re: IE selector bug/error? Anyone have any idea on this? Non-existant selctors are breaking IE, which is fairly bad news for me! Thanks, *Luc Pestille* Web Designer -- *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Luc Pestille *Sent:* 23 May 2007 15:19 *To:* jquery-en@googlegroups.com *Subject:* [jQuery] IE selector bug/error? I've found something that I can't get around; in IE6, these selectors won't do anything for me; 1. $(#admin-jobs #discipline_client_row).hide(); 2. $(#admin-jobs #discipline_client_row).hide(); whereas this works fine (as you'd expect); 3. $(#discipline_client_row).hide(); In IE, number 1 gives me the error (when that div doesn't exist on the page): --- Line: 184 Error: 'getElementById' is null or not an object --- but number 2 reports no error, despite not finding the div on the page. Has anyone come across this before? Any help would be appreciated, IE is starting to drive me in to a coma. Thanks, *Luc Pestille* Web Designer In2 Thames House Mere Park Dedmere Road Marlow Bucks SL7 1PB Tel 01628 899700 Fax 01628 899701 e: [EMAIL PROTECTED] i: www.in2.co.uk This message (and any associated files) is intended only for the use of jquery-en@googlegroups.com and may contain information that is confidential, subject to copyright or constitutes a trade secret. If you are not jquery-en@googlegroups.com you are hereby notified that any dissemination, copying or distribution of this message, or files associated with this message, is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and deleting it from your computer. Messages sent to and from us may be monitored. Any views or opinions presented are solely those of the author [EMAIL PROTECTED] and do not necessarily represent those of the company. [image: in2 logo] inline: jointbrand_emailsigs_I.gif
[jQuery] Re: $(document).ready limits
Are you using the defer attribute on any of your scripts? -- Brandon Aaron On 5/30/07, weepy [EMAIL PROTECTED] wrote: Hi I have a project where I am using Ajax to squirt some HTML and script into the DOM. The script currently has a document.ready around it which appears to fire ok when in FF but not in IE Does any one have any experience of this ? weepy
[jQuery] Re: $(document).ready limits
Yes it is. It has been known to cause problems when used in conjunction with jQuery scripts that use ready. It is rare that the ready method doesn't work properly in IE. Could you maybe post up a simplified test case? Try to narrow it down. -- Brandon Aaron On 5/30/07, weepy [EMAIL PROTECTED] wrote: no - is defer an IE thing ? On May 30, 1:36 pm, Brandon Aaron [EMAIL PROTECTED] wrote: Are you using the defer attribute on any of your scripts? -- Brandon Aaron On 5/30/07, weepy [EMAIL PROTECTED] wrote: Hi I have a project where I am using Ajax to squirt some HTML and script into the DOM. The script currently has a document.ready around it which appears to fire ok when in FF but not in IE Does any one have any experience of this ? weepy
[jQuery] Re: IE selector bug/error - now reproducable.
On 5/30/07, Luc Pestille [EMAIL PROTECTED] wrote: Brandon - it's not a question of HTML validity - the error shows up even with the most basic of HTML page. It might be a moot point though, 1.1.13amight have already fixed it... Could you please post or attach that most basic HTML page where the error shows up? -- Brandon Aaron
[jQuery] Re: Widgetbox variables, problems with $()
The $ is just an alias for jQuery. That means you can use jQuery() instead of $(). Or you could even create a different alias like this. var $j = jQuery; Then you can use $j() instead of $(). And just to be safe you might want to call jQuery.noConflict() to restore the $ back to its original owner. I just re-opened up my blog with a post about this yesterday. http://blog.brandonaaron.net/2007/05/29/using-jquery-with-other-libraries/ -- Brandon Aaron On 5/30/07, MrNase [EMAIL PROTECTED] wrote: I just released a Farbtastic Widget on Widgetbox.com During the creation of the Widget, the website allows you to specify parameters. They all look like: var userlanguage = ${config.userlanguage}; Here is the problem: Because of the $, jQuery doesn't work anymore. Is there a way to fix it? Their help says: These parameters are passed via the query string: http://yourwidget.com?param=value How (besides $()) can I access the parameters? (The Url to the widget is: http://www.widgetbox.com/widget/farbtastic-widget )
[jQuery] Re: Widgetbox variables, problems with $()
That is what the jQuery.noConflict() is for. :) Just do this: var $j = jQuery.noConflict(); -- Brandon Aaron On 5/30/07, MrNase [EMAIL PROTECTED] wrote: As I see now, the problem still exists. jQuery doesn't know what to do with - var userlanguage = ${config.userlanguage}; I would need to tell jQuery that ${config.userlanguage} has nothing to do with jQuery. :-( ---dominik On 30 Mai, 23:08, MrNase [EMAIL PROTECTED] wrote: var $j = jQuery; wow thank you! ---dominik
[jQuery] Re: Help Test jQuery 1.1.3
I've added a new patch to the ticket based on Volker's patch. Can you please confirm that it does indeed fix the problem? http://dev.jquery.com/ticket/1143 -- Brandon Aaron On 5/24/07, Jean-Francois Hovinne [EMAIL PROTECTED] wrote: Thanks for your quick reply, John, and sorry for annoying you with that issue, but it seems to be a major blocker for WYMeditor to work correctly with jQuery in MSIE. I did test the fix you propose (this.mergeNum = null). The attribute is still there, i.e. mergeNum=null for each element. This isn't the only problem. WYMeditor uses designMode, and (I don't know exactly why) MSIE sometimes creates extra DIVs when mergeNum attr is present, while editing. The HTML code quickly becomes ugly and difficult to clean up. Thus Volker's patch seemed to be a good solution. Thanks, Jean-François On 24 mai, 22:10, John Resig [EMAIL PROTECTED] wrote: Did you test it against the test suite? And did you test it for speed changes? The reason why this is being done, in the first place, is purely for speed reasons. Added extra checks or loops significantly slows down the speed of jQuery selectors. The mergeNum technique is the fastest means of checking for unique-ness in a set of elements. If you can find a method that's just as fast, but doesn't have the property, then we'll by all means use it. Additionally, while your patch does change some things around, it doesn't change the fact that the mergeNum property will still be added to some elements, thus still effecting applications like Wymeditor. It just doesn't happen in this very specific case (which is what your patch is attempting to work around). My suggestion would be to add the following code to Wymeditor to remove the property: $(...).find(*).each(function(){ this.mergeNum = null; }); I mentioned this before, but I still think it's the best solution. It's a very specific problem with a very specific solution. --John
[jQuery] Re: massive jquery memory leak in firefox 2.x: load() or empty()?
Is the memory given back after a refresh? -- Brandon Aaron On 5/29/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I assume this is a memory leak: $(#id).empty(); $(#id).load(url, params, callback) increases more and more the memory usage of firefox even if the content is replaced (in my case about 0.5mb per request). since the dev mailinglist did not work for me I post it in here. any sugestions? is this problme related to .empty() or to .load()? -- mot --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups jQuery (English) group. To post to this group, send email to jquery-en@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jquery-en?hl=en -~--~~~~--~~--~--~---
[jQuery] Re: Dev and plugins lists
No I believe they are in the process of being transitioned to Google Groups. Feel free the post anything to this list for now. -- Brandon Aaron On 5/29/07, Mika Tuupola [EMAIL PROTECTED] wrote: Are the dev and plugins lists up at the moment? -- Mika Tuupola http://www.appelsiini.net/~tuupola/
[jQuery] Re: trigger $(document).ready manually
ready() is just a special method that handles the DOM Ready event. I can't think of a use-case where one would need to force the call to ready but you can do so by calling jQuery.ready(). Once the function runs, it won't run again. I'm not sure what, if any, the consequences of doing this are. Perhaps the problem can be solved in a better way? -- Brandon Aaron On 5/29/07, MathiasBank [EMAIL PROTECTED] wrote: Good evening, It is possible to call 1. $('#field').trigger(click); 2. $(document).trigger(myOwnEvent); But it seems, that this is not possible to call $(ducument).trigger(ready); Is ready not an event? (Yes, I mean ready from $ (document).ready(function() {...})). I need to recall this event, because I have changed a big part of my page. Mathias
[jQuery] Re: getting DOM values
You can access the regular dom properties/methods by extracting the element from the jQuery collection. $('#foo').get(0).clientWidth You can also just use bracket notation. $('#foo')[0].clientWidth You could also use the Dimensions plugin which helps abstract some cross browser issues with widths, heights and offsets. http://jquery.com/plugins/project/dimensions -- Brandon Aaron On 5/29/07, pd [EMAIL PROTECTED] wrote: Hi BjQ (before jQuery) I can do this: document.getElementById('foo').clientWidth to get a DOM value that Firebug tells me is set to something other than 'undefined'. I can't figure out how to the do same in AjQ (after jQuery). I've tried the following: $('#foo').attr('clientWidth') but keep getting undefined. Am I trying the wrong syntax? If so, what syntax will achieve the results I'm after?
[jQuery] Re: getting DOM values
Here are the docs for .get( Number ) http://jquery.bassistance.de/api-browser/#getNumber -- Brandon Aaron On 5/29/07, pd [EMAIL PROTECTED] wrote: Thanks guys, super-fast reply :) Is this documented anywhere? I've scanned through the API and didn't see anything for what seems to be a pretty fundamental requirement from a JS library, don't you think? I understand if people haven't had the time to include this in the doco though.
[jQuery] Re: CSS3 support
We don't support any declarations that the browser itself doesn't support. However, there are plugins (lots of them) that solve lots of different problems. There are several plugins that handle rounded corners. Here is one of them: http://www.malsup.com/jquery/corner/ -- Brandon Aaron On 5/28/07, pd [EMAIL PROTECTED] wrote: Hi All I know I'm dreaming and it's probably not realistic but on the front of the jQuery site is the following proclamation: CSS3 Compliant · Supports CSS 1-3 and basic XPath Should that proclamation really say CSS3 Compliant (selectors) because AFAIK jQuery doesn't appear to support any CSS3 declarations like border-radius for example. I understand there are a thousand and one whacky ways for JS to manipulate the DOM into presenting rounded corners and this is generally a bad thing in terms of separation of content and style. Has jQuery ever considered implementing one of these or are they just really too evil?
[jQuery] Re: Question about scroll in dimensions plugin
Very cool! Thanks for keeping us in the loop. :) -- Brandon Aaron On 5/28/07, Wizzud [EMAIL PROTECTED] wrote: Brandon, just an update in case you are interested. I've made a few changes to the YUI visual test page to try and find out where YUI was going wrong in Firefox. My test page can now switch between dimensions and the YUI adapter, but more interestingly it can disable the borders on the target divs. I wanted to see which of the borders was affecting (or not) the YUI calculations, and it appears that targetting divs with/without borders has varying results, in both FireFox and IE. (Of course, dimensions works perfectly!). I am playing with the YUI adapter a bit so there's an extra switch to turn my mods on/off. Brandon Aaron wrote: Thanks for putting the page back up. I'm impressed that YUI gets almost all of them correct. The last time I checked (a while back) none of the major libraries had it down yet. -- View this message in context: http://www.nabble.com/Question-about-scroll-in-dimensions-plugin-tf3777343s15494.html#a10835171 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: OOP's *this* messing up $().each()'s *this*
In this particular snippet you just need to reference mainvar instead of this.mainvar. ... $(this).html(mainvar[_i]); ... If you declared mainvar like this: ... this.mainvar = new Array(example, array); ... Then you would just need to create a reference to the original 'this' object to access it. ... this.functionname = function() { var self = this; $('td.number').each(function(_i) { $(this).html(self.mainvar[_i]); }); } ... -- Brandon Aaron On 5/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Confusing title, but whatever. So basically I'm working on my first OOP script, and I just ran into a bit of trouble while trying to reiterate over an amount of td's, using each() function classname() { var mainvar =new Array(example,array); this.functionname = function() { $('td.number').each(function(_i) { $(this).html(this.mainvar[_i]); }); } } So how would I go about doing this? Is there an alternate way in Javascript to reference without using this.variable or this.function? Or is there a jquery solution? I'm really at a loss...
[jQuery] Re: addClass and removeClass not working in IE6
This is an issue with your CSS. IE6 doesn't seem to like the .class#id selector. You might need to rethink your approach. Perhaps keep the unordered list and add the class to the li. That way you can reference each part like this: .class #id Hope that helps. -- Brandon Aaron On 5/26/07, patcoll [EMAIL PROTECTED] wrote: Hey guys, I got a brainteaser. My issue is that jQuery is not processing addClass or removeClass at all when called from hover() in IE6. alert() calls show the correct data is being passed through to these functions, but to no avail. My limited test suite shows that it works in Firefox 2 (Mac), Safari 2 and IE7. I have prepared a test case that I'd like to submit for review: http://patcoll.com/jqueryTest/ I also reopened ticket #1098 on Trac. http://dev.jquery.com/ticket/1098 Any help would be greatly appreciated. Thanks! Cheers, Pat
[jQuery] Re: Problem with globalEval
Hmmm I'm curious ... which cell phone browsers will show the script? Do you have or know of any articles on the topic? -- Brandon Aaron On 5/27/07, Matt Stith [EMAIL PROTECTED] wrote: True, but alot of cell phone browsers will show the scripts if its not commented out. On 5/27/07, RobG [EMAIL PROTECTED] wrote: On May 28, 5:10 am, Matt Stith [EMAIL PROTECTED] wrote: The HTML comments are to hide the script from older browsers that dont understand javascript. The use of HTML comments inside script elements hasn't been needed since Navigator 2 or IE 3. I doubt that anyone is still using those browsers and if they are, they have far more serious problems that seeing a bit of script source. -- Rob
[jQuery] Re: Question about scroll in dimensions plugin
Thanks for putting the page back up. I'm impressed that YUI gets almost all of them correct. The last time I checked (a while back) none of the major libraries had it down yet. BTW ... my updated demo is at: http://brandonaaron.net/jquery/plugins/dimensions/test/offset_visual.html Since the server change I'm having problems getting to the previous test page. -- Brandon Aaron On 5/26/07, Wizzud [EMAIL PROTECTED] wrote: YUI getXY demo reinstated (see initial post for link). Brandon Aaron wrote: This is now fixed and you can grab the latest from svn and/or here: http://jquery.com/plugins/project/dimensions In the future feel free to contact me off list for questions about dimensions. :) I am still curious to see the comparison of yui getxy with dimensions offset you put together. -- Brandon Aaron -- View this message in context: http://www.nabble.com/Question-about-scroll-in-dimensions-plugin-tf3777343s15494.html#a10814455 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: Printing pages manipulated by jQuery
Print style sheets are a unique beast. For example you can't expect background (colors or images) to print. Once using JavaScript to manipulate your page you have to be careful to understand how that is going to impact your print style sheet. Inline styles will overwrite styles in the print style sheet. You will need to use the !important key word on any rules that might be overwritten and with IE you can always hook into the onbeforeprint and onafterprint events. In the end you'll realize that you are very, very limited to what you can do when printing. You might find this ALA article helpful: http://alistapart.com/stories/goingtoprint/ -- Brandon Aaron On 5/26/07, Feed [EMAIL PROTECTED] wrote: Hello all, I've used jQuery to manipulate, stripe and add hover effect to all tables in my website (dozens of tables). There's a print button in my website and I didn't remember to test it until now. OMG, all the striping is gone. I'm not a programming guru, in fact I'm a designer but I have to deal with code often. Well, is there way to make jQuery actually MAKE the changes to the HTML code instead of making it on the fly (only viewable in the monitor)? I know, it's not a server-side language, but I'm kinda desperated right now.
[jQuery] Re: Effect Queueing Plugin
Nice. I believe it is worth polishing up! Keep at it. -- Brandon Aaron On 5/25/07, Erik Beeson [EMAIL PROTECTED] wrote: Hello all, In response to a thread yesterday, I put together a little framework for effect queueing. My version yesterday, and subsequently Brandon's version aswell, don't correctly deal with effects applied to multiple elements, like when using classes instead of IDs. See here, and notice how the later effects all bunch up and don't run sequentially: http://erikandcolleen.com/erik/jquery/fxQueue/ba/test.html This version deals with that correctly. Other features include: * Multiple queues that can run simultaniously * Pausing/resuming of queues * Works with any effect (just requires the effect function to take an on effect finished callback as its last parameter) like show, hide, animate, Pulsate, Puff, Grow, etc * Additional effects can be added to queues after they've been created I've only tested it on FF1.5/Win and IE6 (I'll test OS X when I get home later today), and for some reason one of the demo pages doesn't work right on IE6. Plugin src (with a little inline documentation!) and a couple of examples can be had here: http://erikandcolleen.com/erik/jquery/fxQueue/ I mainly did this as an exercise for myself, so it won't hurt my feelings if it turns out this isn't really very useful, or if it's already been implemented in SVN or whatever. Is this useful to anybody? Is it worth polishing up a little more? --Erik
[jQuery] Re: 15 second delay with IE
Not at all. I actually believe you might get better results using the min version plus gzip. -- Brandon Aaron On 5/25/07, Bil Corry [EMAIL PROTECTED] wrote: R. Rajesh Jeba Anbiah wrote on 5/25/2007 6:26 AM: Mostly the problem is with the packed version. Try using the original version. At least for me, the packed version is extremely quirky. Is there a reason to use the packed version if JavaScript files are compressed and served via mod_gzip? - Bil
[jQuery] Re: Effect Queueing Plugin
Looks great in Safari 2! On 5/25/07, Erik Beeson [EMAIL PROTECTED] wrote: Check this out: http://erikandcolleen.com/erik/jquery/fxQueue/random.html Only tested on FF. I think that's doing what you want. The plugin doesn't have a concept of doing animations sequentially vs simultaniously; it only does sequentially. But the plugin does make it easy to use any animation function. So for the simultanious part, I created a custom animation function (called randomAnimation) that just randomly moves/resizes stuff. The only tricky bit it to make sure you only call the callback function in randomAnimation when the last item is finished animating. Check out the source to see how it's done. I also fixed a few substantial flaws in the fxQueue plugin. Feedback is always welome. --Erik On 5/25/07, Gordon [EMAIL PROTECTED] wrote: I just downloaded it and am experimenting, so far I'm really impressed. Thanks for the effort, it really is appreciated. I do have one question though, I'm not sure if this is possible or not, but I need to be able to animate a group of objects together, but with unique effects (they all need to move to different locations). This moving effect will be bookended with a fadeout effect beforehand for elements that are not included in the user's selection, and a fade in effect afterward for elements that were excluded the previous selection but which are to be reincluded this time around. I'll cut and paste what I put in the other thread for you because I think it gets across what I'm thinking a bit better. In reflection, I think what I need is a queue into which classes of animations can be inserted. All the animation events in a class get executed together, but each class in the queue is executed one after the other. Maybe something like this: animQueue.addClass ('hideClass'); animQueue.addAnim ('hideClass', $('.toHide').fadeOut ('slow')); animQueue.addClass ('moveClass'); $('.moveClass').each (function (){ animQueue.addAnim ('moveClass', $(this).animate ({ top: Math.floor (Math.random () * 1000), left: Math.floor (Math.random () * 1000) },(Math.floor (Math.random () * 1000) + 500) )); }); animQueue.addClass ('showClass'); animQueue.addAnim ('showClass', $('.toShow').fadeIn ('slow')); animQueue.execute (); Obviously the syntax is totally made up and possibly totally not appropiate for what I'm trying to describe, but I hope yo ucan get the gist of what I'm gatting at here. Is it possible to do this with your plugin? Because, if so, then you've come up with pretty much the perfect solution. :) On May 25, 4:08 pm, Erik Beeson [EMAIL PROTECTED] wrote: Hello all, In response to a thread yesterday, I put together a little framework for effect queueing. My version yesterday, and subsequently Brandon's version aswell, don't correctly deal with effects applied to multiple elements, like when using classes instead of IDs. See here, and notice how the later effects all bunch up and don't run sequentially:http://erikandcolleen.com/erik/jquery/fxQueue/ba/test.html This version deals with that correctly. Other features include: * Multiple queues that can run simultaniously * Pausing/resuming of queues * Works with any effect (just requires the effect function to take an on effect finished callback as its last parameter) like show, hide, animate, Pulsate, Puff, Grow, etc * Additional effects can be added to queues after they've been created I've only tested it on FF1.5/Win and IE6 (I'll test OS X when I get home later today), and for some reason one of the demo pages doesn't work right on IE6. Plugin src (with a little inline documentation!) and a couple of examples can be had here:http://erikandcolleen.com/erik/jquery/fxQueue/ I mainly did this as an exercise for myself, so it won't hurt my feelings if it turns out this isn't really very useful, or if it's already been implemented in SVN or whatever. Is this useful to anybody? Is it worth polishing up a little more? --Erik -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Feature/Plugin request - Animation queue
I just updated the test to include an empty selector as well. -- Brandon Aaron On 5/24/07, Brandon Aaron [EMAIL PROTECTED] wrote: Here is a pretty quick and dirty implementation of an fxqueue: http://brandonaaron.net/jquery/plugins/fxqueue/ You can see the test page here: http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html And I just checked it into the plugins SVN. http://jqueryjs.googlecode.com/svn/trunk/plugins/fxqueue/ Let me know if it works, doesn't work ... etc. :) -- Brandon Aaron On 5/24/07, Gordon [EMAIL PROTECTED] wrote: I've already posted on this topic before, but I really am gettign quite desperate as the project deadline looms and I still don't have a solution. I need several animations to happen, but I need them to happen in sequence rather than all at once (first animation: hide unselected items. Second animation: Move visible items to new locations to occupy space taken by unselected items/make space for currently hidden selected items. Third animation: Reveal currently hidden selected items). I tried using the callback method, but this has a serious drawback for my purposes, in that if one of the animations in the chain doesn't occur (because no items were unselected but some new ones were selected, for example) then all subsequent animations don't occur either. If a jQuery selector returns 0 results then applied effects aren't executed. What I need is some code that will ececute my animations one after the other, but which doesn't depend on all animations in the chain being triggered for the subsequent animations to play. Is there a plugin for doing this? Or is it slated as a new feature for jQuery? Or has anyone else come up with a solution to the problem? Sorry to keep asking this but like I said, it's getting pretty urgent.
[jQuery] Re: Feature/Plugin request - Animation queue
Glad it is working for you. :) I just updated it to fix the scope of the callback and you can now pass params just like you can with animate. Check the new test page to see. http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html -- Brandon Aaron On 5/24/07, Gordon [EMAIL PROTECTED] wrote: Brandon, you're a total lifesaver :) On May 24, 2:41 pm, Brandon Aaron [EMAIL PROTECTED] wrote: I just updated the test to include an empty selector as well. -- Brandon Aaron On 5/24/07, Brandon Aaron [EMAIL PROTECTED] wrote: Here is a pretty quick and dirty implementation of an fxqueue: http://brandonaaron.net/jquery/plugins/fxqueue/ You can see the test page here: http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html And I just checked it into the plugins SVN. http://jqueryjs.googlecode.com/svn/trunk/plugins/fxqueue/ Let me know if it works, doesn't work ... etc. :) -- Brandon Aaron On 5/24/07, Gordon [EMAIL PROTECTED] wrote: I've already posted on this topic before, but I really am gettign quite desperate as the project deadline looms and I still don't have a solution. I need several animations to happen, but I need them to happen in sequence rather than all at once (first animation: hide unselected items. Second animation: Move visible items to new locations to occupy space taken by unselected items/make space for currently hidden selected items. Third animation: Reveal currently hidden selected items). I tried using the callback method, but this has a serious drawback for my purposes, in that if one of the animations in the chain doesn't occur (because no items were unselected but some new ones were selected, for example) then all subsequent animations don't occur either. If a jQuery selector returns 0 results then applied effects aren't executed. What I need is some code that will ececute my animations one after the other, but which doesn't depend on all animations in the chain being triggered for the subsequent animations to play. Is there a plugin for doing this? Or is it slated as a new feature for jQuery? Or has anyone else come up with a solution to the problem? Sorry to keep asking this but like I said, it's getting pretty urgent.
[jQuery] Re: Feature/Plugin request - Animation queue
Pretty cool stuff Brandon! Small typo though: jquery.fxqueue.js line 37: $this = $( args.shift() ); should be var $this = $( args.shift() ); On 5/24/07, Brandon Aaron [EMAIL PROTECTED] wrote: Glad it is working for you. :) I just updated it to fix the scope of the callback and you can now pass params just like you can with animate. Check the new test page to see. http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html -- Brandon Aaron On 5/24/07, Gordon [EMAIL PROTECTED] wrote: Brandon, you're a total lifesaver :) On May 24, 2:41 pm, Brandon Aaron [EMAIL PROTECTED] wrote: I just updated the test to include an empty selector as well. -- Brandon Aaron On 5/24/07, Brandon Aaron [EMAIL PROTECTED] wrote: Here is a pretty quick and dirty implementation of an fxqueue: http://brandonaaron.net/jquery/plugins/fxqueue/ You can see the test page here: http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html And I just checked it into the plugins SVN. http://jqueryjs.googlecode.com/svn/trunk/plugins/fxqueue/ Let me know if it works, doesn't work ... etc. :) -- Brandon Aaron On 5/24/07, Gordon [EMAIL PROTECTED] wrote: I've already posted on this topic before, but I really am gettign quite desperate as the project deadline looms and I still don't have a solution. I need several animations to happen, but I need them to happen in sequence rather than all at once (first animation: hide unselected items. Second animation: Move visible items to new locations to occupy space taken by unselected items/make space for currently hidden selected items. Third animation: Reveal currently hidden selected items). I tried using the callback method, but this has a serious drawback for my purposes, in that if one of the animations in the chain doesn't occur (because no items were unselected but some new ones were selected, for example) then all subsequent animations don't occur either. If a jQuery selector returns 0 results then applied effects aren't executed. What I need is some code that will ececute my animations one after the other, but which doesn't depend on all animations in the chain being triggered for the subsequent animations to play. Is there a plugin for doing this? Or is it slated as a new feature for jQuery? Or has anyone else come up with a solution to the problem? Sorry to keep asking this but like I said, it's getting pretty urgent. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Feature/Plugin request - Animation queue
Ahh good catch! Thanks Aaron. Fixed. I used a semi-colon on the line above instead of a comma. :) -- Brandon Aaron On 5/24/07, Aaron Heimlich [EMAIL PROTECTED] wrote: Pretty cool stuff Brandon! Small typo though: jquery.fxqueue.js line 37: $this = $( args.shift() ); should be var $this = $( args.shift() ); On 5/24/07, Brandon Aaron [EMAIL PROTECTED] wrote: Glad it is working for you. :) I just updated it to fix the scope of the callback and you can now pass params just like you can with animate. Check the new test page to see. http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html -- Brandon Aaron On 5/24/07, Gordon [EMAIL PROTECTED] wrote: Brandon, you're a total lifesaver :) On May 24, 2:41 pm, Brandon Aaron [EMAIL PROTECTED] wrote: I just updated the test to include an empty selector as well. -- Brandon Aaron On 5/24/07, Brandon Aaron [EMAIL PROTECTED] wrote: Here is a pretty quick and dirty implementation of an fxqueue: http://brandonaaron.net/jquery/plugins/fxqueue/ You can see the test page here: http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html And I just checked it into the plugins SVN. http://jqueryjs.googlecode.com/svn/trunk/plugins/fxqueue/ Let me know if it works, doesn't work ... etc. :) -- Brandon Aaron On 5/24/07, Gordon [EMAIL PROTECTED] wrote: I've already posted on this topic before, but I really am gettign quite desperate as the project deadline looms and I still don't have a solution. I need several animations to happen, but I need them to happen in sequence rather than all at once (first animation: hide unselected items. Second animation: Move visible items to new locations to occupy space taken by unselected items/make space for currently hidden selected items. Third animation: Reveal currently hidden selected items). I tried using the callback method, but this has a serious drawback for my purposes, in that if one of the animations in the chain doesn't occur (because no items were unselected but some new ones were selected, for example) then all subsequent animations don't occur either. If a jQuery selector returns 0 results then applied effects aren't executed. What I need is some code that will ececute my animations one after the other, but which doesn't depend on all animations in the chain being triggered for the subsequent animations to play. Is there a plugin for doing this? Or is it slated as a new feature for jQuery? Or has anyone else come up with a solution to the problem? Sorry to keep asking this but like I said, it's getting pretty urgent. -- Aaron Heimlich Web Developer [EMAIL PROTECTED] http://aheimlich.freepgs.com
[jQuery] Re: Feature/Plugin request - Animation queue
Sure but I wonder what that would look like? Could you provide a more detailed use-case? -- Brandon Aaron On 5/24/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Brandon Aaron wrote: Here is a pretty quick and dirty implementation of an fxqueue: http://brandonaaron.net/jquery/plugins/fxqueue/ You can see the test page here: http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html And I just checked it into the plugins SVN. http://jqueryjs.googlecode.com/svn/trunk/plugins/fxqueue/ Let me know if it works, doesn't work ... etc. :) I'd like to fadeIn tooltips, but need to stop/remove the animation on mouseout, because another fadeIn on the same elements could start. There isn't a stop/remove yet, could you add that? -- Jörn Zaefferer http://bassistance.de
[jQuery] Re: Feature/Plugin request - Animation queue
Actualy, the hoverIntent plugin is perfect for this. http://cherne.net/brian/resources/jquery.hoverIntent.html -- Brandon Aaron On 5/24/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: Brandon Aaron wrote: Sure but I wonder what that would look like? Could you provide a more detailed use-case? Sure. Basically it jus this: tooltipElements.hover( function() { tooltip.html( this.title ).fadeIn(); }, function() { tooltip.hide(); }); With that code, hovering over multiple tooltipped elements causes the fadeIn to be queued quite a lot of times, without stopping anytime soon. I'd need something like this: tooltipElements.hover( function() { tooltip.html( this.title ).fadeIn(); }, function() { tooltip.dequeue().hide(); }); While writing this I get the idea that this is a totally different issue... But maybe you can help with this, too :-) -- Jörn Zaefferer http://bassistance.de