[jQuery] www.na3.it
Hello, this is a new site i've made for an architect. It uses the jquery.cycle plugin for most of the slides. Check out the 'projects' page for a sliding accordion menu. If the items for each sub category contains more than 5 items, a 'sliding' interface is created (check the 'design' catgeory). I'm satisfied about the achieved results, what do you think? jQuery rocks!!! Ciao GC
[jQuery] Re: www.na3.it
http://www.na3.it On Mar 31, 10:09 am, GianCarlo Mingati [EMAIL PROTECTED] wrote: Hello, this is a new site i've made for an architect. It uses the jquery.cycle plugin for most of the slides. Check out the 'projects' page for a sliding accordion menu. If the items for each sub category contains more than 5 items, a 'sliding' interface is created (check the 'design' catgeory). I'm satisfied about the achieved results, what do you think? jQuery rocks!!! Ciao GC
[jQuery] Problem validate under IE
http://www.contaflux.ro/gestiune/module/intrari.php I have two problems: 1. This script works good in FF, but it doesn't work in IE6. I have been trying to solve it for 2 day, but i didn't succeed. Please help me. 2. The method resetForm from plugin validate it doesn't work neither in IE6 nor FF. Please help me.
[jQuery] Re: jcarousel scroll breaks in IE6 + IE7
Hi, you should initialize jCarousel like this: jQuery(document).ready(function() { jQuery('#mycarousel').jcarousel({ scroll: 1 }); }); Remove the comma after scroll: 1 IE does not accept a comma after the last entry in hashes. On 25 Mrz., 16:19, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm usingjcarouselfrom sorgalla (http://sorgalla.com) I'm using his static simple example and simply added the scroll: 1, code to make the images scroll one at a time. It works in Firefox but is broken in IE 6 and 7. In both browsers it just shows everything as a list. Here is my code -http://www.trendyminds.com/j/examples/static_simple.html What am I doing wrong? Thanks!
[jQuery] Re: first child of type form control
Thanks Jason :-) How would I handle that if the #elHombre object is inside the form? Cheers, Dug On Mar 27, 12:21 pm, Jason Huck [EMAIL PROTECTED] wrote: Try this: $('#elHombre').next('form').children('input select textarea') [0].focus(); - jason On Mar 27, 6:32 am, DugFalby [EMAIL PROTECTED] wrote: Hi guys, I've got: $('#elHombre').focus(); Which sets focus to a legend at the top of a form. I'd like to do: $('#elHombre').next-instance-of-tag-of-type==inputORtextareaORselect.focus(); The page is set to scroll to the elHombre anchor. The focus needs to be set to thefirstform control that follows the anchor. For example: p id=elHombre This is the introduction/p form label Your name: input type=text //label /form The script would set the focus to the text input box. Thanks all :-) Best, Dug -- DugFalby +44 75 15 66 16 55http://www.donkeyontheedge.com/
[jQuery] Re: first child of type form control
$('form:has(#elHombre)').children('input, select, textarea')[0].focus(); - Richard On Mon, Mar 31, 2008 at 6:12 AM, dug [EMAIL PROTECTED] wrote: Thanks Jason :-) How would I handle that if the #elHombre object is inside the form? Cheers, Dug On Mar 27, 12:21 pm, Jason Huck [EMAIL PROTECTED] wrote: Try this: $('#elHombre').next('form').children('input select textarea') [0].focus(); - jason On Mar 27, 6:32 am, DugFalby [EMAIL PROTECTED] wrote: Hi guys, I've got: $('#elHombre').focus(); Which sets focus to a legend at the top of a form. I'd like to do: $('#elHombre').next-instance-of-tag-of-type== inputORtextareaORselect.focus(); The page is set to scroll to the elHombre anchor. The focus needs to be set to thefirstform control that follows the anchor. For example: p id=elHombre This is the introduction/p form label Your name: input type=text //label /form The script would set the focus to the text input box. Thanks all :-) Best, Dug -- DugFalby +44 75 15 66 16 55http://www.donkeyontheedge.com/
[jQuery] Re: first child of type form control
On second thought, you'll want to use .find, instead of .children, as the elements could likely be within fieldsets and/or divs: $('form:has(#elHombre)').find('input, select, textarea')[0].focus(); Also, here's another way to get the form from the #elHombre: $('#elHombre').parents('form:first').find('input, select, textarea')[0].focus(); - Richard On Mon, Mar 31, 2008 at 6:26 AM, Richard D. Worth [EMAIL PROTECTED] wrote: $('form:has(#elHombre)').children('input, select, textarea')[0].focus(); - Richard On Mon, Mar 31, 2008 at 6:12 AM, dug [EMAIL PROTECTED] wrote: Thanks Jason :-) How would I handle that if the #elHombre object is inside the form? Cheers, Dug On Mar 27, 12:21 pm, Jason Huck [EMAIL PROTECTED] wrote: Try this: $('#elHombre').next('form').children('input select textarea') [0].focus(); - jason On Mar 27, 6:32 am, DugFalby [EMAIL PROTECTED] wrote: Hi guys, I've got: $('#elHombre').focus(); Which sets focus to a legend at the top of a form. I'd like to do: $('#elHombre').next-instance-of-tag-of-type== inputORtextareaORselect.focus(); The page is set to scroll to the elHombre anchor. The focus needs to be set to thefirstform control that follows the anchor. For example: p id=elHombre This is the introduction/p form label Your name: input type=text //label /form The script would set the focus to the text input box. Thanks all :-) Best, Dug -- DugFalby +44 75 15 66 16 55http://www.donkeyontheedge.com/
[jQuery] Re: bind() and thousands of td elements - inline or extrnal?
i did the event delegation by hand and it's pretty easy. (tbody).click(myHandler); function myHandler(e) { var e = e || window.event; var elem = e.target || e.srcElement; if (elem.nodeName.toLowerCase() == td) { // do stuff } } however, the jQuery Listen plugin is much more powerful, i recommend it for event delegation since it will re-bind automatically to any newly created elements. (this plugin superceeds the same author's Intercept plugin) Michael Geary wrote: If you have thousands of td's, that code is going to be very very slow. It makes an array of all the TD elements and then attaches an event handler to every one of them, one by one. You would get *much* better performance by attaching a single event handler to the table itself, then using event.target in the event handler to reference the cell that was clicked. -Mike From: pedalpete I'm not sure exactly what you are trying to do, but I think binding each cell to an external function, or creating an 'anonymous' function inline maybe isn't the best way to go. I have a table with lots of cells, and when the user clicks on a cell, i pass the id of that cell to a script. It's fairly easy, and i think much more efficient than what you are suggesting (but I don't exactly understand what you are trying to do). Here's the basics of how my script works [code] $(td).click(function(){ var id = this.id; } -- View this message in context: http://www.nabble.com/bind%28%29-and-thousands-of-%3Ctd%3E-elements---inline-or-extrnal--tp16352984s27240p16392853.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] xpath or operator
How do you join nodesets or perform a conditional matching on an attribute? The xpath or operator doesn't seem to work (//selector1 | // selector2)=nodeset.
[jQuery] Re: cluetip on Safari Mac throws error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
Yeah, that page works fine, but my page doesn't, although the syntax doesn't seem to have any issues. Page is visible at http://krittickalhost.net/plans/ The ? text is what triggers the cluetip event on hover. It's using the span title method of displaying it. On Mar 30, 9:01 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hmm. Not sure. Might it have something to do with an ajax request? Are you testing it on a page that resides on your local machine? Are you getting the same error on this page? ...http://plugins.learningjquery.com/cluetip/demo/ It's working fine for me here with Safari 3.1 Mac. If it's a problem with a page up on a public server, can you provide a link? Thanks, --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 29, 2008, at 10:58 PM, Krittick wrote: Safari on mac is throwing this error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7 When using any method to call the tooltip function. Safari Windows has no issues, nor does any other browser. Any ideas?
[jQuery] fadeTo of image makes text jump to next line
Hello all, I have a fadeTo in an image (icon) located in front of some text. The fade is triggered when i hover over the image. The problem is that, during the fade, the text next to the icon jumps under the icon, to jump back to its original position when the fade is over. Here is the fade code: $(.wijzigen,.verwijderen).hover(function(){ $(this).fadeTo(slow, 1.0); // This should set the opacity to 100% on hover },function(){ $(this).fadeTo(slow, 0.1); // This should set the opacity back to 60% on mouseout }); And here the image + text: img class=verwijderen id=verwijderen_'.$i.' src=remove.pnginput type=checkbox'.$qry['titel'].'/div' How can i avoid this? Many thanks! Matt
[jQuery] counter like 1 of 10 for jcarousel
hello; i need to make a function: it should get the length of an array then everytime i click next it should increase its count until the length array ends. the next and prev hits would be placed just under this 1 of 10 counter. can anyone guide me on how to do this? i checked the Cycle plugin wich as this function but it's a bit too hard for me now to extract it...
[jQuery] Validator plugin submit with HREF
Hi all, I am trying to use an anchor link to submit my form using the Validator plugin, (so I can change the button to a graphic). I would like to know what to put into the HREF to submit to the Validator code. Currently I have: href=javascript:$(this).validate(); This doesn't seem to work correctly, here is my full block of code in case you would like to check. I would greatly appreciate any help or links. $(document).ready(function(){ $(:submit[id$='_replace']).each(function() { var submitID = $(this).attr(id); var submitValue = $(this).attr(value); $(this).replaceWith( [ 'a class=replace ' , submitID , ' id=' , submitID , ' href=javascript:$(this).validate();em/em' , submitValue , '/a' ].join('') ); }); return false; }); Thanks again
[jQuery] [validate] mulitpage forms
Hi, I am using a variation of the multipage form in the demo and run into a small problem with the pageRquired function. Seems it does not validate correctly if you add any custom selectors after the pageRequired. I am trying to make one field required depending on whether another field is blank, eg: class={pageRequired: '#field1:blank'} In this case, the validation is completely ignored, even if I have {pageRequired:true}. It will only validate if I have class=pageRequired without the curly brackets. However, if I set it up in rules, it will make the field2 required regardless of the value of field1, eg: $(document).ready(function(){ $(#myform).validate({ rules: { field2: { pageRequired: #field1:blank } }, debug:true }); On a whole the multipage validation works very well but not with any custom selectors such as :blank, :filled etc or by using curly brackets in the class. Is there a way around this? I would really prefer to use inline validation using class statements and still be able to use custom selectors. -- View this message in context: http://www.nabble.com/-validate--mulitpage-forms-tp16339750s27240p16339750.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: learning jquery book source code
thank you, i'll check this out, very good book btw. On 24 mar, 19:26, Karl Swedberg [EMAIL PROTECTED] wrote: On Mar 24, 2008, at 6:45 AM, tetrix wrote: i have downloaded the code source for learning jquery book but this code doesnt include all chapters in the book??? it /should/ include all chapters. Note that chapters 7-9 are in a directory called bookstore You can also see all the code functioning athttp://book.learningjquery.com/ --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com
[jQuery] xpath or operator
Hi, The xpath or operator doesn't seem to work in jdomquery 1.1.3.1. For instance according the the xpath spec this should return one set of nodes:
[jQuery] Re: Chm version of the jQuery api browser
thanks Charles! that will be most useful ! question 1: what jquery version is your API browser based on? Latest? question 2: it might be useful to integrate some update logic (a simple indication that a new version is available on the CHM splash page maybe?) question 3: a chm file is good, yet i 'm dreaming of a desktop widget, that would function a la Launchy/ quicksilver: when hitting alt+space, it pops up a search box, where i enter a search term, suggestions matches are shown on each key stroke, hitting enter shows the relevant page. Would the API format you use be adaptable to do that? Thanks again alexandre On Mon, Mar 31, 2008 at 6:52 AM, char101 [EMAIL PROTECTED] wrote: Hi, This is a chm version of the jquery api browser http://jqueryjs.googlecode.com/svn/trunk/tools/api-browser/ Download here http://peacech.googlepages.com/jquery-20080331.chm [150KB] Python script to create the chm files http://peacech.googlepages.com/tochm.py [8KB] Comments can be posted here http://charupload.wordpress.com/2008/03/31/chm-version-of-jquery-api-browser/ --- Charles -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: bind() and thousands of td elements - inline or extrnal?
On Mar 31, 9:56 am, Leeoniya [EMAIL PROTECTED] wrote: i did the event delegation by hand and it's pretty easy. (tbody).click(myHandler); function myHandler(e) { var e = e || window.event; var elem = e.target || e.srcElement; if (elem.nodeName.toLowerCase() == td) { // do stuff } } You don't need that event stuff in there. jQuery already provides an event object with some cross-browser issues normalized. Thus your snippet can become: function myHandler(e) { if (e.target.nodeName.toLowerCase() == td) { // do stuff } } --Klaus
[jQuery] Re: counter like 1 of 10 for jcarousel
it's like the function here: http://www.designis-fine.com/projects/logos--marks/ On 31 mar, 12:27, tetrix [EMAIL PROTECTED] wrote: hello; i need to make a function: it should get the length of an array then everytime i click next it should increase its count until the length array ends. the next and prev hits would be placed just under this 1 of 10 counter. can anyone guide me on how to do this? i checked the Cycle plugin wich as this function but it's a bit too hard for me now to extract it...
[jQuery] Re: Chm version of the jQuery api browser
On Mar 31, 6:43 pm, Alexandre Plennevaux [EMAIL PROTECTED] wrote: question 1: what jquery version is your API browser based on? Latest? I don't know. It is build from the four xmls found here http://jqueryjs.googlecode.com/svn/trunk/tools/api-browser/ But it does include functions from 1.2. Timestamp from the xml is included in the footer. question 2: it might be useful to integrate some update logic (a simple indication that a new version is available on the CHM splash page maybe?) A chm is just a compressed HTML pages with table of contents and index. So I don't think it can do such thing :-D. question 3: a chm file is good, yet i 'm dreaming of a desktop widget, that would function a la Launchy/ quicksilver: when hitting alt+space, it pops up a search box, where i enter a search term, suggestions matches are shown on each key stroke, hitting enter shows the relevant page. Would the API format you use be adaptable to do that? I have no idea, but google desktop search can index chm files (or at least there is a plugin for that).
[jQuery] Re: cluetip on Safari Mac throws error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
When I open your page in Firefox, I immediately get the following error message in the Firebug console: An invalid or illegal string was specified code: 12 The Safari error is a little different, I see. I wonder if it might have something to do with the permissions that are set for that file on your server? Just a guess here, but since the script is doing some DOM modification, maybe you have something set that doesn't allow for that. Perhaps you could try temporarily setting the file to 777 and see what happens. If that doesn't work, you could try isolating where that error is coming from. For example, if you think it's the cluetip script, you could remove all of your other script references (except the core jquery one, of course). Then use a selector that points to a single element. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 31, 2008, at 1:06 AM, Krittick wrote: Yeah, that page works fine, but my page doesn't, although the syntax doesn't seem to have any issues. Page is visible at http://krittickalhost.net/plans/ The ? text is what triggers the cluetip event on hover. It's using the span title method of displaying it. On Mar 30, 9:01 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hmm. Not sure. Might it have something to do with an ajax request? Are you testing it on a page that resides on your local machine? Are you getting the same error on this page? ...http://plugins.learningjquery.com/cluetip/demo/ It's working fine for me here with Safari 3.1 Mac. If it's a problem with a page up on a public server, can you provide a link? Thanks, --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 29, 2008, at 10:58 PM, Krittick wrote: Safari on mac is throwing this error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7 When using any method to call the tooltip function. Safari Windows has no issues, nor does any other browser. Any ideas?
[jQuery] Re: www.na3.it
Very nice -- clean and smooth. Congrats, GianCarlo! --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 31, 2008, at 4:09 AM, GianCarlo Mingati wrote: Hello, this is a new site i've made for an architect. It uses the jquery.cycle plugin for most of the slides. Check out the 'projects' page for a sliding accordion menu. If the items for each sub category contains more than 5 items, a 'sliding' interface is created (check the 'design' catgeory). I'm satisfied about the achieved results, what do you think? jQuery rocks!!! Ciao GC
[jQuery] Re: Fading images 'slow' on mouseover
Not a problem, Nat. And glad you like the book. :-) If anyone else is following this thread, just wanted to say that my first solution for Nat at learningjquery.com was insufficient. I posted another one yesterday that seems to have done the trick: http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-35454 --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 27, 2008, at 10:24 AM, Nat wrote: Thanks for that Karl, I posted it on your site 1st and put it here aswell. Will look into it. Like your book by the way! On Mar 27, 1:53 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi Nat, I provided an answer to the same question you posted here: http://www.learningjquery.com/2007/02/more-showing-more- hiding#commen... It might not be a complete solution, but I think it will point you in the right direction. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 27, 2008, at 7:10 AM, Nat wrote: Hi there, Does anyone know of a way to have an image that when you rollover it, it fades into another image? Additionally, I would like the fade to be fast onmouseover and slow onmouseout. I have tried this lots of times and the issue that I keep getting is that I have to let the fades complete before you can initiate the fade again. In other words if I set onmouseout fade to 'slow' if I rollover the image again before this 'slow' fade has completed, nothing happens. I have to let the fade complete before you can rollover again. I would like to know if there is a way to interrupt the fade so that if it half complete, the fadeOut is stopped and immediately starts the fadeIn My pathetic attempts are: a href=http://www.pictureandword.com/test_platform/ index.htmlHere! /a And the .js file is: a href=http://www.pictureandword.com/test_platform/ effects.jsHere! /a It is cluncky, to say the least. ANY help would be great. (Thanks to Ariel Flesher for trying to help me with this before, sorry, I'm just too stupid!) Thanks.
[jQuery] Re: Modals - What's everyone using?
Richard's response pretty much covers everything. Two simple options - complete flexibility. If there are any features that you think would make UI Dialog better, just create a ticket or post to the jquery-ui group :-) On Mar 30, 2:12 pm, Shelane [EMAIL PROTECTED] wrote: Scott, can you expand on this? Without setting any options, it's not good for forms, but there are options to make it so? What setting for the overlay option or change to the stylesheet should be made? On Mar 30, 5:51 am, Scott González [EMAIL PROTECTED] wrote: The UI Dialog plugin defaults to a transparent overlay and can be customized via the overlay option or stylesheets. On Mar 29, 4:56 pm, Rey Bango [EMAIL PROTECTED] wrote: I want to build a modal window with a form in it but don't want to use the blacked out effect similar to many lightbox implementations. What's everyone using for this type of functionality? Rey...
[jQuery] Re: Plugin pattern
Thanks Ariel, Good alternative you suggest, but its really a alternative that is not solve the problem, I would divide to make thing easy and will create another trouble... I´ll gonna try a different manner... very thanks for suggest... On Mar 29, 11:38 am, Ariel Flesler [EMAIL PROTECTED] wrote: You can't.. or you'll lose the `this`. Unless you do: $(seletor).project().ajax().remote(); and each method returns the `this`. Cheers -- Ariel Fleslerhttp://flesler.blogspot.com/ On Mar 28, 11:23 am, alexanmtz [EMAIL PROTECTED] wrote: Hi everyone, Im working in a big project of ajax and I would like to use a plugin pattern thats not working in pratice... All javascript in the project I would like to transform in a jQuery plugin. But to achieve this I need to separate in categories in libraries for this site Im working So, I wanna to make this: $(seletor).project.ajax.remote(); $(seletor).helpers.options(); But when Im creating a plugin like this: $.fn.project.ajax.remote = function() { //code } Its not working... Using extend I reach it, but extending methods of jQuery objects I cant do that. I need this because I create a ajax library just for the site and a lot of thing, so we need this pattern... How I can accomplish this thanks everyone...
[jQuery] Re: Fading image memory leak (what am I doing wrong?)
What version of jQuery are you using? --John On Mar 30, 12:24 am, markie [EMAIL PROTECTED] wrote: Hi, So I have this script that copies a node, then uses an ajax call to load a new image into the new node. Then once the image is done loading, fades the old image out. After that, it removed the old node. Works great on my mac, but IE has a horrible memory leak. I verified the leak with DRIP. It's definitely is happening when this function is being called. Any assistance would be spiffy. function doImageSetup() { var imgDiv = $(#image_div span.img_hold); // get target var newish = imgDiv.clone(); // clone newish.css(z-index, -1); // set it behind imgDiv imgDiv.parent().prepend(newish); // append it to newish.load(getimg.php, function(){ doImageFade(imgDiv, newish);}); load image } function doImageFade(o, n) { ni = n.children(img); // select image in new div ni.load(function(){ // once the new image is finished loading o.children(img).fadeOut(2000, function(){ // fade out old img and then o.remove(); // get rid of it n.css(z-index, 0); // move new div forward setTimeout(doImageSetup(), 1); // 10 second timer }); }); }
[jQuery] Re: flexigrid plugin - help for server side script
hello paulo, I am having numerous problems in implementing the basic flexigrid, Example 3 on http://webplicity.net/flexigrid/ I somehow managed to make the ASP page write the required xml back. The problem now I am facing is with the display, the navigation buttons on the toolbar at the bottom is not functioning. Can you please advice. Regards Mick On Mar 28, 8:50 pm, Paulo [EMAIL PROTECTED] wrote: Hi, This is the developer of theFlexigrid, still a little busy on a project, but I updated the site with a sample php code. Hope that helps. License: its free to use for commercial or personal. On Mar 24, 8:13 am, Web Specialist [EMAIL PROTECTED] wrote: Flexigrid(http://webplicity.net/flexigrid/) is a very nice grid plugin with several awesome features. I like it, really. But plugin developer doesn't show us your server side php script to pagination. I'll want to migrate that code to ColdFusion. If developer listens me please show us that script. Cheers
[jQuery] Re: Problem width tabs + splitter
The demo is in http://elcirculorojo.890m.com/index.html Can you send an example of your code? Cesar. On Mar 27, 9:52 pm, Rav [EMAIL PROTECTED] wrote: Hi I am having the same problem , I am not able to add splitter in tab, is it possible for you to share the code Rav On Mar 7, 7:56 pm, cesar [EMAIL PROTECTED] wrote: Thanks for the advice Klaus...I fixed the errorbut what happened when I call jquery twice? cesar. On Mar 7, 6:43 pm, Klaus Hartl [EMAIL PROTECTED] wrote: On Mar 7, 1:22 pm, cesar [EMAIL PROTECTED] wrote: The version of tabs is2.7.4 Ok, this should be compatible with jQuery 1.1.3.1. But in the demo some of the javascript files load an (error) html page causing a syntax error, so I can't tell anything reliable until this isn't fixed. Apart from that I saw that you're including jQuery twice. You should avoid that. --Klaus- Hide quoted text - - Show quoted text -
[jQuery] toolbar buttons do not function
Hello Folks, I am having numerous problems in implementing the basic jquery flexigrid, Example 3 on http://webplicity.net/flexigrid/ I somehow managed to make the ASP page write the required xml back. The problem now I am facing is with the display, the navigation buttons on the toolbar at the bottom of the flexigrid is not functioning. Can someone please advice. Regards mick
[jQuery] Deep Extend edits all objects?
This is kind of long, so thank you so much if you read it all. I am building a plugin and running into a problem. Here goes: In my options, I am passing a nested object: $.aPlugin.defaults = { image: { url: myImage.gif, width: 20px, height: 15px }, color: red } A user can override defaults via metadata: div class=plugin {image:{url:'newImage.gif'}}/div //no spaces in the metadata! div class=plugin {color:'blue'}/div this.opts has already been extended with the defaults. Now I extend it with metadata, if any: // true sets the extend to deep extend this.metaOpts = $.metadata ? $.extend(true, {}, this.opts, $ (this).metadata()) : this.opts; I call the plugin, like so: $(.plugin).aPlugin(); and then I log this.metaOpts to the console, because at this point, something goes very, very wrong. Here is what I get: Object (1) image (Object) url: myImage.gif //this is the default image value, even though this value has been redefined in the metadata color: red Object (2) image (Object) url: myImage.gif color: blue //the metadata overwrite shows up here. What I *expect* is that in Object 1, url will be set to newImage.gif, because I have redefined it in the metadata. Odd thing is, if I log this.metaOpts.image.url to the console, I get the correct values, like so: newImage.gif //object 1's image.url value is correct myImage.gif Has anyone encountered a problem like this? Does this have something to do with the way that deep extend works? Is it a scope issue? I am hopelessly confused at this point. -- Mist S. Boyer
[jQuery] How do I unsubscribe from googlegroups?
I don't want to leave the group but I want to read it online instead. I went to the Google Groups for jquery and changed my preference to No email but I'm still getting them. Any idea anyone? -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
[jQuery] Re: jQuery in IE7
I'm no expert, and you don't provide any information about the errors in IE. Random guess: $(document).ready( Have you tried quoting document, i.e $('document')? On Mar 30, 7:27 pm, Tolik Piskov [EMAIL PROTECTED] wrote: Hello! I was trying to start learning jQuery, but faced a problem: ready event doesn't work in IE7, but works fine in Firefox and Safari. ... script type=text/javascript src=./jquery-1.2.2.js/script script type=text/javascript $(document).ready( function() { alert ( test );}); ... I tried different versions: 1.2.2,1.2.3, regular, packed, minified. I guess this is a bug.
[jQuery] Re: Chm version of the jQuery api browser
Hi, Charles, question 2: it might be useful to integrate some update logic (a simple indication that a new version is available on the CHM splash page maybe?) A chm is just a compressed HTML pages with table of contents and index. So I don't think it can do such thing :-D. Have a look at the following article for a fairly simple way to alert users when a new version of the .chm file is available. http://www.writersua.com/mixingonlinechm.htm Pete
[jQuery] Re: How do I unsubscribe from googlegroups?
I haven't waiting. But I think I've tried to do it again but didn't bother to dig into it further when I kept getting emails. I'll check with that Help forum. THanks! On 31/03/2008, Richard D. Worth [EMAIL PROTECTED] wrote: Have you given it a day? I've never done it, but perhaps it takes some time to kick-in. If that doesn't work, you might check with the google groups folks: http://groups.google.com/group/Google-Groups-Guide - Richard On Mon, Mar 31, 2008 at 12:01 PM, Peter Bengtsson [EMAIL PROTECTED] wrote: I don't want to leave the group but I want to read it online instead. I went to the Google Groups for jquery and changed my preference to No email but I'm still getting them. Any idea anyone? -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com -- Peter Bengtsson, work www.fry-it.com home www.peterbe.com hobby www.issuetrackerproduct.com
[jQuery] jqDock Plugin
Transform a set of images into a Mac-like Dock menu, horizontal or vertical, with icons that expand on rollover, and optional labels. (Not particularly new, but I needed it.) demo : http://www.wizzud.com/jqDock/ Feedback welcome.
[jQuery] Re: Custom element attributes generated by a plugin
I'm not an expert on that, but count me in against adding them. Maybe if you include a doctype... :) -- Ariel Flesler http://flesler.blogspot.com On Mar 30, 11:24 am, Eric Martin [EMAIL PROTECTED] wrote: I'm *considering* adding a custom attribute for elements created in a plugin and wanted to know what the general feeling is on this. I'm guessing any opposition to the idea would be based on the fact that it wouldn't validation (if someone were to extract the DOM and run that through a validator), but does that really matter? Since plugins are used by the community, I don't want to do anything that would grossly offend anyone, so I thought I'd just see what the reaction would be. =)
[jQuery] Re: jqDock Plugin
Very nice! Love it. Especially love that you avoided the multiple- hover-effect-queuing problem that so often arises. Great job! --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 31, 2008, at 12:54 PM, Wizzud wrote: Transform a set of images into a Mac-like Dock menu, horizontal or vertical, with icons that expand on rollover, and optional labels. (Not particularly new, but I needed it.) demo : http://www.wizzud.com/jqDock/ Feedback welcome.
[jQuery] Re: jQuery in IE7
It should work fine in IE7. Is your script tag closed after your ready call, you don't show that in your example. script type=text/javascript $(document).ready( function() { alert ( test ); }); /script -- make sure this is here -- Josh - Original Message - From: Tolik Piskov [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Sunday, March 30, 2008 11:27 AM Subject: [jQuery] jQuery in IE7 Hello! I was trying to start learning jQuery, but faced a problem: ready event doesn't work in IE7, but works fine in Firefox and Safari. ... script type=text/javascript src=./jquery-1.2.2.js/script script type=text/javascript $(document).ready( function() { alert ( test ); }); ... I tried different versions: 1.2.2,1.2.3, regular, packed, minified. I guess this is a bug.
[jQuery] Re: Problem validate under IE
Please help me. On Mar 31, 11:29 am, David [EMAIL PROTECTED] wrote: http://www.contaflux.ro/gestiune/module/intrari.php I have two problems: 1. This script works good in FF, but it doesn't work in IE6. I have been trying to solve it for 2 day, but i didn't succeed. Please help me. 2. The method resetForm from plugin validate it doesn't work neither in IE6 nor FF. Please help me.
[jQuery] Re: jQuery in IE7
On 31 мар, 19:14, the_woodsman [EMAIL PROTECTED] wrote: I'm no expert, and you don't provide any information about the errors in IE. Sorry, I just figured out that this is not jQuery's problem. There's something with JavaScript in my IE7. It simply doesn't work.
[jQuery] Re: Deep Extend edits all objects?
I think I have found the problem: When I assign $.extend() to a variable, I don't actually expect $.extend() to alter my source data. I expect my variable to contain a copy of the source data with alterations made to it. Am I using the wrong syntax? I would like to assign the results of $.extend() to a variable, without actually running $.extend(). Thank you! /Mist
[jQuery] Re: Putting data from load() to a variable?
theoretically something like function updateTimer(object_id) { $.get(checkchanges.php,{object_id:object_id}, function(msg) { $(#timer+object_id).append(msg); setTimeout(updateTimer(+object_id+), 1000); }); } is what you're looking for just carry on execution in the callback. there are a lot of other ways to write this, depending on the feeling you're going for. On Mar 30, 8:41 am, unska [EMAIL PROTECTED] wrote: Hey.. I'm having some problems to put the data from the load() function to a variable. I'm currently using the code below but I need some modifications to it. function updateTimer(object_id) { $(#timer+object_id).load(checkchanges.php?object_id=+object_id); setTimeout(updateTimer(+object_id+), 1000); } As you see it puts the checkchanges.php's data to the span called timerX but I want to put the same data to a variable, how can I do this? Someone already suggested me to do it like this: $.ajax({ type: GET, url: checkchanges.php?object_id=+object_id, success: function(msg){ variablex=msg; } }); But that's useless, because the variablex is stuck inside the unnamed function and therefore useless.
[jQuery] clueTip width question
I was under the impression that cluetip would dynamially resize based on the content it contained. I am putting an html page with all of the content set into a table in clueTip. The height is great, but the width is much less than the width of the table. Am I wrong thinking that it should size to the table? I haven't set anything for width in my js file. Thanks!!
[jQuery] Re: assigning data from $.getJSON() to a global variable?
thanks Mike! my code was actually within a JS function that is supposed to return a value i forgot about the A in ajax :) i ended up using $.ajax() to force the ajax request to be synchronous so that it would get the value from the ajax request, but I set the $.ajax() option async to false (with the quotes). i kept banging my head until I realized that I wrapped the boolean false in quotes. removed the quotes, everything worked, and banged my head a little more for making a simple mistake ;) thanks, -norm On Mar 27, 5:43 pm, Michael Geary [EMAIL PROTECTED] wrote: That should work just fine. However... You didn't show the code that tries to use the globalX variable, and that is probably where the problem lies. Does the overall flow of your code look like this perhaps? var globalX; function foo() { $.getJSON(jsondata.js,function(data){ globalX = data; }); } alert( globalX ); That won't work, because the alert() is called *before* the asynchronous getJSON callback. OTOH, this would work: var globalX; function foo() { $.getJSON(jsondata.js,function(data){ globalX = data; dataReady(); }); } function dataReady() { alert( globalX ); } Now the alert() is called after the globalX data is ready. But since you have to use a callback like this anyway, you may not need the global variable at all. After all, this code: function foo() { $.getJSON(jsondata.js,function(data){ alert( data ); }); } would obviously work, as would this: var globalX; function foo() { $.getJSON(jsondata.js, dataReady); } function dataReady( data ) { alert( data ); } -Mike -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of funkadelic Sent: Thursday, March 27, 2008 4:19 PM To: jQuery (English) Subject: [jQuery] assigning data from $.getJSON() to a global variable? Hi, Is there a way to take the JSON from a $.getJSON() call and assign it to a var in the global scope? i tried the following but it didn't work: var globalX; function foo() { $.getJSON(jsondata.js,function(data){ globalX = data; }); } thanks
[jQuery] Re: Re-invoking the jQuery config file dynamically
STEVE I ride alongside you in this boat of shame. I have the exact same problem. Portlet interface, two styles of instantiating portlets. Long have I suffered this bug to no avail. I have cheesily and not completely solved the problem by storing the jQuery object in another variable and then extending the jQuery that's not right with a copy of the OK one. However, this sucks. And it doesn't work reliably now that I'm trying to solve it in IE. I've characterised this problem in the past as plugins falling out of jQuery and the bane of my existence on the jQuery-UI group and here, and I've noticed that it seems to happen after the .load() method is called. I've also noticed that it is really cramping my style and making me want to kill myself. Now that there are two of us, can anyone provide some guidance? Advice? Comfort? --adam On Mar 31, 6:50 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am building a portal interface in jQuery (and UI). Each portlet has a sortable drag handle which each feature roll-up/down and close links on hover. I use server-side scripting to build the page on first load. All the drag/rollup/close events are recorded in a DB using ajax, so that the next time the page is hard-loaded the portlets are displayed as they were left. There is also a 'customise this page' link which dynamically adds portlets to the DOM on an event. The portlet code is identical to that used on hard-load, only this time the code is prepended to an existing DOM element. All the jQuery stuff (sorting, roll-up etc.) works properly when the content is 'hard-loaded'. However, when adding portlets to the DOM on an event, all the clever jQuery stuff doesn't work. I'm not sure, but I believe this is because the config javascript waits until $(document).ready. This happens on 'hard-load' but has no effect on DOM stuff added after this. How would you recommend I re-invoke the jQuery javascript after adding a dynamic element to the DOM? Thanks for your help. Regards, Steve
[jQuery] Jquery Selector even and first child (nested tables striping)
Hi, I've ran into a little problem. I'm using the code below to do alternate row striping on a table. $('table.basic tr:even').addClass('even'); The problem is, one of the cells of this table contains another (nested) table. So the tr:even selector is getting messet up, and is applying the row color to the nested table and then skips the actual next row in the table. Is there any way to do :even only on first level tr elements? I tried doing $('table.basic tr:first-child tr:even').addClass('even'); But that doesn't work. Does anyone know how to do this right? Thanks, -Roman
[jQuery] clueTip close button moves on hover
In my clueTip window I am having trouble with the close button moving slightly to the right when it is rolled over. It is in the title and I am using a sticky window that closes on mouse out. I cannot figure out what is causing this. Any ideas would be great! Thanks!
[jQuery] Re: clueTip close button moves on hover
this one sounds like it could be a css problem. are you using text or image for the close? --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 31, 2008, at 2:47 PM, ajobe wrote: In my clueTip window I am having trouble with the close button moving slightly to the right when it is rolled over. It is in the title and I am using a sticky window that closes on mouse out. I cannot figure out what is causing this. Any ideas would be great! Thanks!
[jQuery] Re: clueTip width question
Unfortunately, you can't just have the width be auto, because of the order in which the positioning is calculated. If you don't have one set, it defaults to 275px, or something like that. You might want to try setting #cluetip-inner to overflow: auto; in the stylesheet. That might help. Not sure. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 31, 2008, at 2:37 PM, ajobe wrote: I was under the impression that cluetip would dynamially resize based on the content it contained. I am putting an html page with all of the content set into a table in clueTip. The height is great, but the width is much less than the width of the table. Am I wrong thinking that it should size to the table? I haven't set anything for width in my js file. Thanks!!
[jQuery] Re: Jquery Selector even and first child (nested tables striping)
Use the child combinator to select just the children of a certain element. In your case, assuming you have an tbody element: $('table.basic tbody tr:even').addClass('even'); --Klaus On Mar 31, 8:45 pm, rsmolkin [EMAIL PROTECTED] wrote: Hi, I've ran into a little problem. I'm using the code below to do alternate row striping on a table. $('table.basic tr:even').addClass('even'); The problem is, one of the cells of this table contains another (nested) table. So the tr:even selector is getting messet up, and is applying the row color to the nested table and then skips the actual next row in the table. Is there any way to do :even only on first level tr elements? I tried doing $('table.basic tr:first-child tr:even').addClass('even'); But that doesn't work. Does anyone know how to do this right? Thanks, -Roman
[jQuery] Re: How can I test my javascript?
Flexible selectors should be the main solution. Specially the use of ids, they are fast, and don't depend on dom hierarchy. You can also intercept a key function in jquery, probably $.fn.find. (function( $ ){ var find = $.find; $.find = function( selector ){ var elems = find( selector ); if( elems.length == 0 ) alert( selector + ' yielded no matches' ); //or console.log or any other warning. return elems; }; })( jQuery ); I don't advice this for production, it adds some overhead and may bug a visitor. Could be useful for debugging. -- Ariel Flesler http://flesler.blogspot.com On 31 mar, 13:54, Matt Wilson [EMAIL PROTECTED] wrote: jQuery selectors are fantastic, but any time I change the layout of my site, I need to manually go through each page and make sure everything works. Are they any automated testing tools that I can use? Manual regression tests are killing my productivity.
[jQuery] Re: How can I test my javascript?
There is a tool called Selenium that allows you to record a series of clicks around your website, and then play it back to simulate a user session. It only works on localhost and in Firefox (it's a FF extension), but it's quite useful in that environment. http://selenium-ide.openqa.org/ -- Josh - Original Message - From: Ariel Flesler [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, March 31, 2008 12:54 PM Subject: [jQuery] Re: How can I test my javascript? Flexible selectors should be the main solution. Specially the use of ids, they are fast, and don't depend on dom hierarchy. You can also intercept a key function in jquery, probably $.fn.find. (function( $ ){ var find = $.find; $.find = function( selector ){ var elems = find( selector ); if( elems.length == 0 ) alert( selector + ' yielded no matches' ); //or console.log or any other warning. return elems; }; })( jQuery ); I don't advice this for production, it adds some overhead and may bug a visitor. Could be useful for debugging. -- Ariel Flesler http://flesler.blogspot.com On 31 mar, 13:54, Matt Wilson [EMAIL PROTECTED] wrote: jQuery selectors are fantastic, but any time I change the layout of my site, I need to manually go through each page and make sure everything works. Are they any automated testing tools that I can use? Manual regression tests are killing my productivity.
[jQuery] JSeclipse?
Has there been any progress in creating a JQuery library xml file, or whatever is needed for the JSEclipse plugin? Does anyone know of where I could find it? Google only reports old news posts, and I was wondering if anyone has done anything with it since.
[jQuery] Re: Jquery Selector even and first child (nested tables striping)
Ok, found a solution if anyone else is searching! $('table.basic tr:nth-child(even)').addClass('even'); -Roman On Mar 31, 2:45 pm, rsmolkin [EMAIL PROTECTED] wrote: Hi, I've ran into a little problem. I'm using the code below to do alternate row striping on a table. $('table.basic tr:even').addClass('even'); The problem is, one of the cells of this table contains another (nested) table. So the tr:even selector is getting messet up, and is applying the row color to the nested table and then skips the actual next row in the table. Is there any way to do :even only on first level tr elements? I tried doing $('table.basic tr:first-child tr:even').addClass('even'); But that doesn't work. Does anyone know how to do this right? Thanks, -Roman
[jQuery] Re: How can I test my javascript?
Depending on your needs I also recommend Selenium; highly (both the IDE and the server for running automated tests). Keep your markup clean and your semantics correct and layout neutral (e.g., sub_nav is far better than left_nav as an Id) and changing your layout may not have any effect, or minimal, on your JS anyway.
[jQuery] Re: clueTip close button moves on hover
image...Here is the css: .cluetip-jtip h3#cluetip-title { margin: 0 0 0px; padding: 0px 0px; font-size: 10px; font-weight: normal; background-color: #CC; color: #333; height:10px; } .cluetip-jtip div#cluetip-close { text-align: right; margin: 0 0px 0px; color: #900; } Thanks! On Mar 31, 3:21 pm, Karl Swedberg [EMAIL PROTECTED] wrote: this one sounds like it could be a css problem. are you using text or image for the close? --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 31, 2008, at 2:47 PM, ajobe wrote: In my clueTip window I am having trouble with the close button moving slightly to the right when it is rolled over. It is in the title and I am using a sticky window that closes on mouse out. I cannot figure out what is causing this. Any ideas would be great! Thanks!- Hide quoted text - - Show quoted text -
[jQuery] Re: cluetips - dynamic data filtering
No ideas?
[jQuery] Changing the click trigger inside itself is causing undesired results.
I have a button, when clicked this button invokes a function that changes the buttons html, and it's click. The problem is it somehow maintains the old trigger code. Before I put the click functions in their own functions (rather than just adding function(){} to the parameter) it would gain code every click, so if you clicked the button 4 times the code would execute both trigger functions 4 times, then if you clicked it a fifth time it would do both functions 5 times. I can't think of any way to resolves this besides reverting to javascript code, and even then I'm not sure if it will work. I looked at the jquery source, but couldn't figure out what the triggers code was doing. (To me it looked like it was defining a bunch of function that took in functions, but with no connection to the javascript triggers ) Anyways this is my code: $(function() { resetcButton(); }); function resetcButton() { $(#cButton).click(closeButton); } function closeButton() { $(#cButton) }
[jQuery] Re: clueTip width question
That throws scroll bars on it. Without this the content flows outside of the window. Guess is can't be done? On Mar 31, 3:25 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Unfortunately, you can't just have the width be auto, because of the order in which the positioning is calculated. If you don't have one set, it defaults to 275px, or something like that. You might want to try setting #cluetip-inner to overflow: auto; in the stylesheet. That might help. Not sure. --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Mar 31, 2008, at 2:37 PM, ajobe wrote: I was under the impression that cluetip would dynamially resize based on the content it contained. I am putting an html page with all of the content set into a table in clueTip. The height is great, but the width is much less than the width of the table. Am I wrong thinking that it should size to the table? I haven't set anything for width in my js file. Thanks!!- Hide quoted text - - Show quoted text -
[jQuery] Re: cluetips - dynamic data filtering
By the way - that first line should read, ...THANKS for the hard work...
[jQuery] Changing the click trigger inside itself is causing undesired results.
I have a button, when clicked this button invokes a function that changes the buttons html, and it's click. The problem is it somehow maintains the old trigger code. Before I put the click functions in their own functions (rather than just adding function(){} to the parameter) it would gain code every click, so if you clicked the button 4 times the code would execute both trigger functions 4 times, then if you clicked it a fifth time it would do both functions 5 times. I can't think of any way to resolves this besides reverting to javascript code, and even then I'm not sure if it will work. I looked at the jquery source, but couldn't figure out what the triggers code was doing. (To me it looked like it was defining a bunch of function that took in functions, but with no connection to the javascript triggers ) Anyways this is my code: -- $(function() { $(#cButton).click(closeButton); }); function closeButton() { alert('close hit'); $(#cButton) .html(Cancel) .click(cancelButton); } function cancelButton() { alert('cancel hit'); $(#cButton) .html(Close) .click(closeButton); } -- When you hit the button the first time it gives the 'close hit' alert, but if you hit it a second time it will give the 'close hit' alert first, then give the 'cancel hit' alert. Any idea?
[jQuery] Re: bind() and thousands of td elements - inline or extrnal?
with the Listen plugin i have something like this: $(tbody).listen(click, td, function(e) { $(this).addClass(edit).html(input type='text' /); $(input, $(this)).each(function() {$(this).focus()}); }) is it appropriate to use $(this).addClass instead of $(e.target).addClass inside the handler? it seems to work using $(this) but i'm not sure if that's the intended implementation. thaks, Leon -- View this message in context: http://www.nabble.com/bind%28%29-and-thousands-of-%3Ctd%3E-elements---inline-or-extrnal--tp16352984s27240p16399033.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Modals - What's everyone using?
If I try the first I get this error: missing : after property id Line 1 $('#example1').dialog({modal: true, overlay: { background-color: 'gray', opacity: 0.5 } }); On Mar 30, 3:55 pm, Richard D. Worth [EMAIL PROTECTED] wrote: By default the UI Dialog is not modal. You can make it modal be setting the modal option to true. That also enables the overlay option, which you can set to a css hash. Example: $(el).dialog({ modal: true, overlay: { background-color: 'gray', opacity: 0.5 } }); If you want to do it via a stylesheet: .ui-dialog-overlay { background-color: gray; opacity: 0.5 } - Richard On Sun, Mar 30, 2008 at 2:12 PM, Shelane [EMAIL PROTECTED] wrote: Scott, can you expand on this? Without setting any options, it's not good for forms, but there are options to make it so? What setting for the overlay option or change to the stylesheet should be made? On Mar 30, 5:51 am, Scott González [EMAIL PROTECTED] wrote: The UI Dialog plugin defaults to a transparent overlay and can be customized via the overlay option or stylesheets. On Mar 29, 4:56 pm, Rey Bango [EMAIL PROTECTED] wrote: I want to build a modal window with a form in it but don't want to use the blacked out effect similar to many lightbox implementations. What's everyone using for this type of functionality? Rey...
[jQuery] Re: Modals - What's everyone using?
I think you will have to put quotes around background-color. -- Josh - Original Message - From: Shelane [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, March 31, 2008 3:09 PM Subject: [jQuery] Re: Modals - What's everyone using? If I try the first I get this error: missing : after property id Line 1 $('#example1').dialog({modal: true, overlay: { background-color: 'gray', opacity: 0.5 } }); On Mar 30, 3:55 pm, Richard D. Worth [EMAIL PROTECTED] wrote: By default the UI Dialog is not modal. You can make it modal be setting the modal option to true. That also enables the overlay option, which you can set to a css hash. Example: $(el).dialog({ modal: true, overlay: { background-color: 'gray', opacity: 0.5 } }); If you want to do it via a stylesheet: .ui-dialog-overlay { background-color: gray; opacity: 0.5 } - Richard On Sun, Mar 30, 2008 at 2:12 PM, Shelane [EMAIL PROTECTED] wrote: Scott, can you expand on this? Without setting any options, it's not good for forms, but there are options to make it so? What setting for the overlay option or change to the stylesheet should be made? On Mar 30, 5:51 am, Scott González [EMAIL PROTECTED] wrote: The UI Dialog plugin defaults to a transparent overlay and can be customized via the overlay option or stylesheets. On Mar 29, 4:56 pm, Rey Bango [EMAIL PROTECTED] wrote: I want to build a modal window with a form in it but don't want to use the blacked out effect similar to many lightbox implementations. What's everyone using for this type of functionality? Rey...
[jQuery] Re: Custom element attributes generated by a plugin
I, too, would have to be counted on the 'not in favour' side. Can you not use a class, or $.data, or $.metadata, or some such? On Mar 30, 3:24 pm, Eric Martin [EMAIL PROTECTED] wrote: I'm *considering* adding a custom attribute for elements created in a plugin and wanted to know what the general feeling is on this. I'm guessing any opposition to the idea would be based on the fact that it wouldn't validation (if someone were to extract the DOM and run that through a validator), but does that really matter? Since plugins are used by the community, I don't want to do anything that would grossly offend anyone, so I thought I'd just see what the reaction would be. =)
[jQuery] Re: Changing the click trigger inside itself is causing undesired results.
You're not doing anything in your code to remove the original click event. To make it work this way, you'd need to make a single recursive function using .unbind() to remove the first click event, add the second, and then on the second click, remove the second click and call itself again to re-bind the first click... $(function(){ clickToggle = function(){ alert('close hit'); $(this).html('Cancel').unbind('click').click(function(){ alert('cancel hit'); $(this).html('Close').unbind('click').click(clickToggle); }); } $('#cButton').click(clickToggle); }); However, another way to accomplish this would be to use jQuery's built- in .toggle() event to specify the even and odd actions: $(function(){ $('#cButton').toggle( function(){ alert('close hit'); $(this).html('Cancel'); }, function(){ alert('cancel hit'); $(this).html('Close'); } ); }); HTH, Jason On Mar 31, 4:38 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a button, when clicked this button invokes a function that changes the buttons html, and it's click. The problem is it somehow maintains the old trigger code. Before I put the click functions in their own functions (rather than just adding function(){} to the parameter) it would gain code every click, so if you clicked the button 4 times the code would execute both trigger functions 4 times, then if you clicked it a fifth time it would do both functions 5 times. I can't think of any way to resolves this besides reverting to javascript code, and even then I'm not sure if it will work. I looked at the jquery source, but couldn't figure out what the triggers code was doing. (To me it looked like it was defining a bunch of function that took in functions, but with no connection to the javascript triggers ) Anyways this is my code: -- $(function() { $(#cButton).click(closeButton); }); function closeButton() { alert('close hit'); $(#cButton) .html(Cancel) .click(cancelButton); } function cancelButton() { alert('cancel hit'); $(#cButton) .html(Close) .click(closeButton);} -- When you hit the button the first time it gives the 'close hit' alert, but if you hit it a second time it will give the 'close hit' alert first, then give the 'cancel hit' alert. Any idea?
[jQuery] Re: Changing the click trigger inside itself is causing undesired results.
I think you may be under the misconception that an event ('click' in this case) can only have one function bound to it at a time - not true. When you bind a function to an event, it stays bound until removed, and will run whenever the event is triggered. If you bind another function (same or different to the first) to that same event, it too stays bound until removed, and it too will run whenever the event is triggered. You seem to be assuming that when you bind a second function to an event, it replaces the first one, but it doesn't. Think of it like a list of things that have to be done when something happens. If you keep adding to the list, that list just gets longer, and *all* things on the list have to happen when the event occurs. The only way to shorten the list is to remove something from it. Same with event handlers. In the sort of flip-flop scenario that you describe above, you might want to look at using $().one('click', ...), which is a special implementation of the bind('click', ...) that removes itself after being triggered. Also, if you are only changing text of an element, just use $ ().text(...) rather than $().html(...). On Mar 31, 9:38 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a button, when clicked this button invokes a function that changes the buttons html, and it's click. The problem is it somehow maintains the old trigger code. Before I put the click functions in their own functions (rather than just adding function(){} to the parameter) it would gain code every click, so if you clicked the button 4 times the code would execute both trigger functions 4 times, then if you clicked it a fifth time it would do both functions 5 times. I can't think of any way to resolves this besides reverting to javascript code, and even then I'm not sure if it will work. I looked at the jquery source, but couldn't figure out what the triggers code was doing. (To me it looked like it was defining a bunch of function that took in functions, but with no connection to the javascript triggers ) Anyways this is my code: -- $(function() { $(#cButton).click(closeButton); }); function closeButton() { alert('close hit'); $(#cButton) .html(Cancel) .click(cancelButton); } function cancelButton() { alert('cancel hit'); $(#cButton) .html(Close) .click(closeButton);} -- When you hit the button the first time it gives the 'close hit' alert, but if you hit it a second time it will give the 'close hit' alert first, then give the 'cancel hit' alert. Any idea?
[jQuery] Is their a way to wait for .animate to finish, before executing something?
code: $(#body).animate({height: 'hide'}, 'fast'); //hide the body, untill get returns... $.get(thehtml, {sid: Math.random()}, function(thepage){ $(#body) .html(thepage) //apply new content... .animate({height: 'show'}, 'slow'); //show the body... }); -- With this code I wanted to hide the div with .animate, then wait untill, the get message returns, then when it does load the return value into the div, and then show it with .animate. The problem is it returns before the hide animate finishes and shows the new contents while still hiding. I want it to show the old content untill it finishes hiding, then when it finishes hiding, I want it to replace the content with the return of the php file, and then do show. Could someone help make this happen. I've never done animations in javascript so I wouldn't know how to piece together the code.
[jQuery] Re: Chm version of the jQuery api browser
On Mar 31, 11:34 pm, Pete Lees [EMAIL PROTECTED] wrote: Have a look at the following article for a fairly simple way to alert users when a new version of the .chm file is available. http://www.writersua.com/mixingonlinechm.htm Hi Pete, thanks for the article. That is cool. A simpler way is to include an image that shows the latest version. But I don't think such thing is necessary since the xml files which this chm is build is not updated often enough (last update is Dec 21, 2007). Also I do not like if chm files connect online, it will usually slow down opening the page. --- Charles.
[jQuery] Re: Thickbox acting up in IE7 and FireFox Mac
There's a new png and the link in the css needs to be adjusted accordingly. On Mar 19, 11:37 pm, dsizemore [EMAIL PROTECTED] wrote: Hi, I'm trying to get Thickbox set up on my site for my login and forgot password forms. Once clicked, these two links will open a Thickbox allowing the user to login or reset their password. I'm using AJAX Content on the Thickbox example page for this:http://jquery.com/demo/thickbox/ The site I'm working on is here:http://www.kentuckygolfing.com/home Problem 1: The problem comes into effect on IE7 and seemingly no other browser that I've tested. If you browse to my test site above and then click login from the top right header area a Thickbox window pops up. If you close this window (without trying to login) and once that Thickbox window closes, you go click on forgot password and just watch what happens to this Thickbox window. It comes up showing the TB_Title field twice. This only happens when you click one link that brings up a Thickbox window and then close and then open up another. If you open one and then close and then refresh and then open up another link, thickbox is fine. Also, I've discovered that this only happens with the AJAX Content example from the Thickbox examples page. If I use an IFrame, this does not happen. The only reason I'm not using an IFrame is because I cannot figure out how, once submit is clicked on the login form or forgot password form, that I can close the thickbox and reload the original page so that the user is logged in. When I use an IFrame with the login form, after submit is clicked, the user gets the confirmation message that they logged in successfully and then it opens up the homepage inside of the thickbox IFrame rather than closing it. So... if someone has any pointers there too, I'm all ears. 2. Last thing I've noticed is that in FireFox on Mac, when Thickbox is loaded, the dark gray overlay in the background of the thickbox does not load. It just stays transparent, but the thickbox still functions correctly, just not overly in the background. Thoughts on how to fix these? Thanks
[jQuery] Re: Problem width tabs + splitter
Hi Your demo works great with some javascript error Thanks Rav On Mon, Mar 31, 2008 at 6:36 AM, cesar [EMAIL PROTECTED] wrote: The demo is in http://elcirculorojo.890m.com/index.html Can you send an example of your code? Cesar. On Mar 27, 9:52 pm, Rav [EMAIL PROTECTED] wrote: Hi I am having the same problem , I am not able to add splitter in tab, is it possible for you to share the code Rav On Mar 7, 7:56 pm, cesar [EMAIL PROTECTED] wrote: Thanks for the advice Klaus...I fixed the errorbut what happened when I call jquery twice? cesar. On Mar 7, 6:43 pm, Klaus Hartl [EMAIL PROTECTED] wrote: On Mar 7, 1:22 pm, cesar [EMAIL PROTECTED] wrote: The version of tabs is2.7.4 Ok, this should be compatible with jQuery 1.1.3.1. But in the demo some of the javascript files load an (error) html page causing a syntax error, so I can't tell anything reliable until this isn't fixed. Apart from that I saw that you're including jQuery twice. You should avoid that. --Klaus- Hide quoted text - - Show quoted text -
[jQuery] Updating select content
I'm trying to improve the speed of my script which is currently using html() to replace content of a select element. The updateSelectOptions() method take an array and create a string of options to replace the select element. function updateSelectOptions(aOptions, fieldID) { if($(select#+fieldID).length){ sOptions = ''; for (var i = 0; i aOptions.length; i++) { sOptions += 'option value=' + aOptions[i].oV + '' + aOptions[i].oT + '/option'; } $(select#+fieldID).html(sOptions); } } I've tried using replaceWith() instead of html() and that improve the script executing from 7sec to about 1.2sec. The only problem with replaceWith() is that I lose the on change event that's bind to the select element. I've tried unbinding the before the replaceWith() and rebinding change event after replaceWith() but the script end up freezing when the change event is triggered for the second time. Does anyone have a suggestion?
[jQuery] Re: Ajax/Safari 3/SSL
You aren't by chance doing a cross-domain ajax call when you do it by SSL are you? In terms of debugging options, you can use Firebug Lite (and sprinkle your code with lots of console.log() statements). http://www.getfirebug.com/lite.html Also, Drosera is a debugger with the WebKit project that works with Safari 3.0: http://trac.webkit.org/projects/webkit/wiki (Doesn't work with 2.0, sadly) JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh Nathanson Sent: Monday, March 31, 2008 5:03 PM To: jquery-en@googlegroups.com Subject: [jQuery] Ajax/Safari 3/SSL Hey all, Does anyone know anything about problems with Safari 3 when using AJAX over SSL? It doesn't seem to work. My AJAX stuff that works in every other browser, and also works in Safari when not going over SSL, utterly fails. I'm just hoping someone might have run across this and have some information. I Googled it but didn't turn up much of anything that was helpful. Are there any options for trying to debug in Safari? -- Josh
[jQuery] Re: Ajax/Safari 3/SSL
Nope, not cross-domain. I'm using a relative url so that shouldn't be an issue. It works fine in all other browsers, SSL or not, though I haven't tried Safari 2 yet. I'll give Firebug lite a go and see if I can nail down where it's failing. -- Josh - Original Message - From: Jeffrey Kretz [EMAIL PROTECTED] To: jquery-en@googlegroups.com Sent: Monday, March 31, 2008 5:46 PM Subject: [jQuery] Re: Ajax/Safari 3/SSL You aren't by chance doing a cross-domain ajax call when you do it by SSL are you? In terms of debugging options, you can use Firebug Lite (and sprinkle your code with lots of console.log() statements). http://www.getfirebug.com/lite.html Also, Drosera is a debugger with the WebKit project that works with Safari 3.0: http://trac.webkit.org/projects/webkit/wiki (Doesn't work with 2.0, sadly) JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh Nathanson Sent: Monday, March 31, 2008 5:03 PM To: jquery-en@googlegroups.com Subject: [jQuery] Ajax/Safari 3/SSL Hey all, Does anyone know anything about problems with Safari 3 when using AJAX over SSL? It doesn't seem to work. My AJAX stuff that works in every other browser, and also works in Safari when not going over SSL, utterly fails. I'm just hoping someone might have run across this and have some information. I Googled it but didn't turn up much of anything that was helpful. Are there any options for trying to debug in Safari? -- Josh
[jQuery] Re: Ajax/Safari 3/SSL
Just for poops and giggles, rather than using a relative url, try giving the full absolute path (https://blabla) in your ajax call. This is only a hunch, it may have no effect. JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh Nathanson Sent: Monday, March 31, 2008 6:36 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Ajax/Safari 3/SSL Nope, not cross-domain. I'm using a relative url so that shouldn't be an issue. It works fine in all other browsers, SSL or not, though I haven't tried Safari 2 yet. I'll give Firebug lite a go and see if I can nail down where it's failing. -- Josh - Original Message - From: Jeffrey Kretz [EMAIL PROTECTED] To: jquery-en@googlegroups.com Sent: Monday, March 31, 2008 5:46 PM Subject: [jQuery] Re: Ajax/Safari 3/SSL You aren't by chance doing a cross-domain ajax call when you do it by SSL are you? In terms of debugging options, you can use Firebug Lite (and sprinkle your code with lots of console.log() statements). http://www.getfirebug.com/lite.html Also, Drosera is a debugger with the WebKit project that works with Safari 3.0: http://trac.webkit.org/projects/webkit/wiki (Doesn't work with 2.0, sadly) JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh Nathanson Sent: Monday, March 31, 2008 5:03 PM To: jquery-en@googlegroups.com Subject: [jQuery] Ajax/Safari 3/SSL Hey all, Does anyone know anything about problems with Safari 3 when using AJAX over SSL? It doesn't seem to work. My AJAX stuff that works in every other browser, and also works in Safari when not going over SSL, utterly fails. I'm just hoping someone might have run across this and have some information. I Googled it but didn't turn up much of anything that was helpful. Are there any options for trying to debug in Safari? -- Josh
[jQuery] JSON $Get.Json Silently Failing
hello, i have rather frustrating problem with $get.Json silently failing; i have a data set that return; but many that fail. after i try and serialize the data and send it back to the client; it never return and the function $get.Json fails to return if i place the JSON serialized objects in an data file and call $get.Json..everything works. but not from the response.write on the fly. is there a way to format the json serialzed return? is there any subtle characters in the json string that could prevent this from occuring? ie. escape, /backslash etc. any help is greatly appriecated! //page.aspx (Fails to return to $Get.JSON JavaScriptSerializer jss = new JavaScriptSerializer(); Response.Write(jss.Serialize(data)); //test.js function testForm() { alert(before); $.getJSON(../json/test.aspx, function(data,textStatus){ //$.getJSON(../jsondata/data_Success.js, function(data,textStatus) { alert(textStatus); result = data.Result; }); alert(after); } //Json object - can anyone see anything wrong with this? {AvailableSlots:2,BookedPlayers:2,MaxPlayers:4,StartingHole: 1,ExtensionData:{},Comments:Time Extract Successful!,Reason:Time Extract Successful!,Result:0}
[jQuery] Need Special Menu Plugin
I need a special menu plugin for admin pages. The problem is that my clients hate frames and iframes, and on slow connections, admin pages for websites that I build need to always show menus and not have to redraw them each time. Previously I was using iframes to fix that. I was putting the menus on the screen, and when they click an option, it then updates the iframe. But now I see that my clients hate that because iframes don't resize in the page, the way I have them. So, I envisioned using jQuery to fix that. I was going to have something like an accordion menu on the left, and when you choose a sub menu item on the left, it then replaces the content on the right using .replaceWith() I'm guessing. And I would pull that content from AJAX. So, if you choose Add User from the accordion menu on the left, then the right side would update with an Add User form. Get it? Frameless frames. Is there already a jQuery plugin for this?
[jQuery] get input value not working.....
Typically (so I've thought), to get the current value of a textbox (input), I would simply use $(#inputid).val(); However, I'm experiencing the initial value being returned instead of a new, typed- in value. Have I just been staring at this too long? I was using jquery 1.2.3 and backed off to 1.2 and still the same thing.
[jQuery] [newb] Creating a list of X quotes randomly
Problem: I am creating a teaser page for a site that is coming soon. We have a list of 20 sentences that describe the site. We want to select 5 of those, at random and without redundancy, and display them in a div. The display part seems easy enough, and should look something like this: $(document).ready() { $(quote_box).append(quote_array) } However, I cannot seem to find any information about randomly loading an array y out of an array x, in jQuery or otherwise. I would like for the script to load array 'x' (the larger array) from an external plain ASCII file with a semi-colon delimiter, but JSON looks like a good compromise. At any rate, I am just looking for an example of loading array y from array x. Filling up x from an external file I can figure out for myself. Coming from a Perl background, I thought things could only get less confusing... ;) (I've searched far and wide for an example of this, but it doesn't seem to exist. I will blog any suggestions you make so that you won't be troubled by such newbishness ever again).
[jQuery] unresponsive script error on long page with many clueTips
Hello, I have a dynamically generated page that can be long or short. Everything is fine when it's short, but when it gets to be *very* long, it gives unresponsive script errors. I believe this is because each entry on the page contains 3 clueTip links. If I have a thousand entries, that's 3,000 clueTips to bind and possibly keep in memory and then unbind when the user leaves the page. That's a lot! Any suggestions on how to prevent these errors? My only thought is that instead of using jquery to bind the clueTips at page load, I can do things the old-fashioned way and trigger the clueTip by linking to a javascript function. Something like: a href='javascript:clueTipFunction()'link/a Will that work? thanks, az
[jQuery] Re: Creating a list of X quotes randomly
On Apr 1, 9:36 am, ab5tract [EMAIL PROTECTED] wrote: Problem: I am creating a teaser page for a site that is coming soon. We have a list of 20 sentences that describe the site. We want to select 5 of those, at random and without redundancy, and display them in a div. The display part seems easy enough, and should look something like this: $(document).ready() { $(quote_box).append(quote_array) } However, I cannot seem to find any information about randomly loading an array y out of an array x, in jQuery or otherwise. If you can generate the quoteArray, and convert an array of strings into the DOM object(s) you want, something like this may help (if you want to maintain order, it will require a fairly simple change): var quote_array = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o']; function genRandomSet(src, n) { var dat = src.concat(); var max = dat.length-1; var set = []; n = (nmax)? n : max; while (n--) { set.push(dat.splice(Math.random()*dat.length|0, 1)); } return set; } alert( genRandomSet(quote_array, 5).join('\n') ); -- Rob