[jQuery] radio button created using dom are not working in IE
Hi, I am facing a strange issue. It's regarding radio button I am using following code to generate radio button but the following code behavesdifferent for different browser. In IE it sshows all selected radio buttons and user can't deselect them. And in Mozilla it shows last button selected. function createRadioButtons(e){ var radio_element = document.createElement('input type=radio name=trim value=a checked'); var tr_element = document.createElement('tr'); var td_element = document.createElement('td'); var td_element2 = document.createElement('td'); td_element.appendChild(document.createTextNode('link')); td_element2.appendChild(radio_element); tr_element.appendChild(td_element); tr_element.appendChild(td_element2); e.appendChild(tr_element); } In above code 'e' is tbody which i m fetching using getElementById() function But strange thing is if i write following code, it works fine in both IE and mozilla function createOnlyRadioButtons(e){ var radio_element = document.createElement('input type=radio name=hood value=a checked'); e.appendChild(radio_element); } Here 'e' is td element. would any one please guide me to solve this problem. Regards, Vishakha
[jQuery] Re: how can i get only the id's of a container's child elements
Glen Lipka wrote: var myString = ; $(#container .item).each(function(i){ myString = myString + , + this.id http://this.id; }); $(#myInput).val(myString); Hope this helps. Glen I like oneliners: var ids = $.map($('#container [EMAIL PROTECTED]'), function() { return this.id; }).join(','); --Klaus
[jQuery] Re: how can i get only the id's of a container's child elements
Klaus Hartl wrote: Glen Lipka wrote: var myString = ; $(#container .item).each(function(i){ myString = myString + , + this.id http://this.id; }); $(#myInput).val(myString); Hope this helps. Glen I like oneliners: var ids = $.map($('#container [EMAIL PROTECTED]'), function() { return this.id; }).join(','); Setting the value was missing: $(#myInput).val( $.map($('#container [EMAIL PROTECTED]'), function() { return this.id; }).join(',') ); --Klaus
[jQuery] jquery.com not available
jquery.com not available for me, anyone else having the same problem? Best regards, Stefan Kilp -- Stefan Kilp SK-Software, Entwicklung Beratung email: [EMAIL PROTECTED] fon : +49 6151 93344-0 fax : +49 6151 93344-20 Herta-Mansbacher-Str. 98 64289 Darmstadt, Germany. -
[jQuery] Re: jquery.com not available
Yep, I keep getting a timed out response. On Jul 9, 9:41 am, Stefan Kilp [sk-software] [EMAIL PROTECTED] wrote: jquery.com not available for me, anyone else having the same problem? Best regards, Stefan Kilp -- Stefan Kilp SK-Software, Entwicklung Beratung email: [EMAIL PROTECTED] fon : +49 6151 93344-0 fax : +49 6151 93344-20 Herta-Mansbacher-Str. 98 64289 Darmstadt, Germany. -
[jQuery] Re: JQuery - CrossBrowser? - Script not working in Firefox
With JQuery supposedly crossbrowser capable, I did not think the script I'm using would have any issues in Firefox. Dumb thought, perhaps. It doesn't seem to execute at all in Firefox. It's the AutoCompleter located at http://www.pengoworks.com/workshop/jquery/autocomplete.htm. It's working well in IE7, but not in Firefox. Are there any additional requirements to get JQuery working in Firefox? Are you saying the examples on that page aren't working for you in Firefox? Firefox is my primary development browser (and was when I made that page) and the examples on that page work fine in both FF v1.5 and v2.0. If those example pages aren't working, then I would suspect you have a plug-in that's causing problems. If the examples on that page are working, then there's another problem with your code. -Dan
[jQuery] loop through elements and stop at first match
Hi I want to loop through the jquery array of objects, stop to loop when it finds the first match, and then continue to loop with another search. In another language I would set a var found = false; before the loop and then set it to true in the loop, but with chaining I'm not sure how to do. Any idea ? Olivier
[jQuery] clear file input field
I need to clear a file input field on onclick event $('#edit-header-image').val(''); but i dosent work for file input type but it works for text fields also tried normal js type document.getElementById('edit-header-image').value= ''; but it dosent clear the field in IE but it dose in firefox i dont know what iam doing wrong , help me with this
[jQuery] Re: jquery.forms incorrect object usage in fileupload() with IE
Yep this new version work perfectly thank's a lot malsup wrote: Thanks for that info, lordb. I just checked in an update which I think will fix the problem: http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js When you get a chance, let me know if it works for you. Mike My form is simplest as possible just the form tag which contain an hidden field form the max file size and the file fild with name=fichier With the modification proposed the fileupload seems to work, so I has send it here to help other people with the same problem. I tried to execute original jquery.forms code with different security level in IE7 and with medium or low level I have no more error ... but for a working code in all case my modification seem to be good. -- View this message in context: http://www.nabble.com/jquery.forms-incorrect-object-usage-in-fileupload%28%29-with-IE-tf4030286s15494.html#a11498119 Sent from the JQuery mailing list archive at Nabble.com.
[jQuery] Re: Drag- Droppables using Interface
I managed to get your code working ( I don't know why it wouldn't work earlier ), but I ended up with some new odd behaviour. When I drag an element from one droppable to another, it appears to be leaving an empty li instead of removing it. Code: $(dragged).remove().clone().appendTo('#' + groupID + ' ul').wrap('li class=character/li'); Demo: http://www.ethowin.net/dragTest.htm I noticed I didn't have firebug installed at home, so I'll download it and see if I can find anything... / Fredrik Benjamin Sterling skrev: A live version of the script can be found on http:// http://www.ethowin.net/dragTest.htm www.ethowin.net/dragTest.htm http://www.ethowin.net/dragTest.htm http://www.ethowin.net/dragTest.htm. I tried using your code, but it neither cloned or removed the dragged element. Hmm... then it probably was not getting an element in correct format, I will look at you code and see if I see anything. Also, the problem is quite random and doesn't seem to happen very often at all, so perhaps I could iterate through all lists on each drag/drop, and delete any found duplicates. But that might lead to some unnecessary overhead when the number or items grows. I agree, there should be better way. -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Scroller ticker...
Hi, I need to develop a scroller ticker, and i think i'll give it a try using jQ :) Before I start this new adveture for me, I thought I'd see if anyone had done anything like it before. I want to do something like this ( http://www.ttnetportugal.pt/portal/_vs_/_lg_/aspx/noticias/Noticias_Iframe.aspx ) I've seen some other tickers here, but they work for a list of items, or from a xlm file I want retrive tickers info from a DataRow. If anyone can give any kind of a hint that would be a good start :)
[jQuery] Manipulating loaded data
Hi all, firstly let me thank you all for supporting such a great library. I am not the most adept programmer so I hope you will help me out by explaining some of the workings of JQuery. Script / $('.galleryList').load(data.dat); $('.gallerySelect').click(function(){ var gallerySelected = $(this).parent('div'); if( gallerySelected.attr('class')=='galleryOut' ) { gallerySelected.removeClass(); gallerySelected.addClass(galleryIn); } else { gallerySelected.removeClass(); gallerySelected.addClass(galleryOut); } }); Body / body div class=galleryList /div /body data.dat / div class=galleryOut id=101 div class=gallerySelectA/div div class=galleryContentB/div div class=galleryEditC/div /div My question is a simple one, I am loading data into the galleryList div and then wish to manipulate it. How can I load this data from an external source and THEN have is answer to Jquery calls? Thanks guys.
[jQuery] Checkboxes and IE
Hi guys! I'm having some trouble with checkboxes in IE... so.. after the pageloading i want to check all and i've tryed with attr({checked : checked}) , attr({checked : true}) , usign dom el.checked=true , but nothing... can someone help me?
[jQuery] Re: jquery.com not available
Yes, same here in Liverpool UK On Jul 9, 9:41 am, Stefan Kilp [sk-software] [EMAIL PROTECTED] wrote: jquery.com not available for me, anyone else having the same problem? Best regards, Stefan Kilp -- Stefan Kilp SK-Software, Entwicklung Beratung email: [EMAIL PROTECTED] fon : +49 6151 93344-0 fax : +49 6151 93344-20 Herta-Mansbacher-Str. 98 64289 Darmstadt, Germany. -
[jQuery] Re: How to change of an input textbox
Try: $(#ID).val(New value); And: variablename = $(#ID).val(); To retrieve it. Regards, Michael Price
[jQuery] Re: JQuery - CrossBrowser? - Script not working in Firefox
The local autocomplete works fine for me (Firefox/2.0.0.4). With the ajax autocomplete...your file @ http://www.pengoworks.com/workshop/jquery/autocomplete_ajax.cfm gives an error in both FF and IE. That page won't work correctly if you call it directly from a browser w/out a q parameter: http://www.pengoworks.com/workshop/jquery/autocomplete_ajax.cfm?q=fair This is just a basic example and I don't do any error checking to simplify the readability of the script. Besides, the error message is pretty clear on what went wrong. -Dan
[jQuery] Re: 3D carousel?
Hi Fred, There is an example of a jQuery 3D Carousel at http://www.activespotlight.com/ You can follow the thread that discussed it here: http://groups.google.com/group/jquery-en/browse_thread/thread/caffe8e606a6bbea/7107419fc74469c9?lnk=gstq=Interface+3d+Carousel+problemsrnum=1# Cheers, David Fred Janon wrote: Has anyone done or know how to do a carousel like the 3D circular carousel in Flash in Amazon? It looks pretty cool. Forgive me if the link doesn't work for you but the carousel shows the best-seller books in a 3D circular carousel. http://www.amazon.com/ref=topnav_gw_/105-7722567-3277224 Fred
[jQuery] Re: 3D carousel?
Cool, thanks David! On 7/9/07, David [EMAIL PROTECTED] wrote: Hi Fred, There is an example of a jQuery 3D Carousel at http://www.activespotlight.com/ You can follow the thread that discussed it here: http://groups.google.com/group/jquery-en/browse_thread/thread/caffe8e606a6bbea/7107419fc74469c9?lnk=gstq=Interface+3d+Carousel+problemsrnum=1# Cheers, David Fred Janon wrote: Has anyone done or know how to do a carousel like the 3D circular carousel in Flash in Amazon? It looks pretty cool. Forgive me if the link doesn't work for you but the carousel shows the best-seller books in a 3D circular carousel. http://www.amazon.com/ref=topnav_gw_/105-7722567-3277224 Fred
[jQuery] Re: Binding problems (click/submit)
Bruce, Do you have a sample page we can look at? I don't see anything obviously wrong with the code, but it's hard to tell without seeing more of the page. Mike I'm having difficulty rebinding both a form submit and a click function upon return of an ajax call.
[jQuery] Re: Using AutoCompleter, how do you pass parameters
One other thing: If the user does not actually select an item from the list and, instead, just tabs out of the field - perhaps because the item that was put into the textbox via the quick-fill was the one he wanted - then the code to populate other fields does not fire. How can I get that code to fire? (The code below does not fire) Yeah, that looks like a bug. Development of this code branch has actually stopped and been replaced with: http://dev.jquery.com/browser/trunk/plugins/autocomplete It looks like this issue is resolved in the latest code base. -Dan
[jQuery] Re: jquery book
Hi GianCarlo, It looks to me like the eBook is available. The page has an Add to Cart button for it. Did you try unsuccessfully to purchase it? If so, it's probably a problem with the publisher's website. If you could contact them (http://www.packtpub.com/contact), that would be great. btw, thanks for buying the book! :-) --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 9, 2007, at 5:20 AM, GianCarlo Mingati wrote: Hi, http://www.packtpub.com/jQuery/book the learning jq book is available. unfortunately this is not true for its PDF version wich i would prefer. GC
[jQuery] Re: 3D carousel?
Fred Janon wrote: Has anyone done or know how to do a carousel like the 3D circular carousel in Flash in Amazon? It looks pretty cool. Forgive me if the link doesn't work for you but the carousel shows the best-seller books in a 3D circular carousel. http://www.amazon.com/ref=topnav_gw_/105-7722567-3277224 http://amazon.com/ref=topnav_gw_/105-7722567-3277224 Hi Fred, There's one in the Interface effects library as well: http://interface.eyecon.ro/demos You can see it demonstrated from the above link, near the bottom of the Technical Demos list. Regards, Michael Price
[jQuery] Re: How to bind a submit form action
FYI, The latest version of the form plugin now does this for you automatically. You can call ajaxForm numerous times without having to worry about unbinding events. Mike After you replace the public element with the new input you need to rewire the form so that the new button is properly recognized. But you don't want double event handlers, so you need to first fully unwire it.
[jQuery] Re: jquery book
got it!! Now the eBook is available. Nice job, well written and easy to understand. I'm sure i'll get better and better from now on. Kinda having a 'new toy' to play with... GC On Jul 9, 2:49 pm, Karl Swedberg [EMAIL PROTECTED] wrote: Hi GianCarlo, It looks to me like the eBook is available. The page has an Add to Cart button for it. Did you try unsuccessfully to purchase it? If so, it's probably a problem with the publisher's website. If you could contact them (http://www.packtpub.com/contact), that would be great. btw, thanks for buying the book! :-) --Karl _ Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jul 9, 2007, at 5:20 AM, GianCarlo Mingati wrote: Hi, http://www.packtpub.com/jQuery/book the learning jq book is available. unfortunately this is not true for its PDF version wich i would prefer. GC
[jQuery] Interface Tooltips and animatons getting queued
I've noticed that animations and such in jQuery tends to queue. When I have many animated elements, each triggered on mouseover ( in this case, Tooltips ), and rapidly move my mouse across several elements, the Tooltips will start showing in the order that the mouse touched them. Is there any way to abort an animation when another one starts, or disable the animation queue?
[jQuery] Re: loop through elements and stop at first match
jQuery's in-built selectors with the custom selector ability should provide you with everything you need without having to loop through the array yourself. What are you trying to search for? On 7/9/07, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: Hi I want to loop through the jquery array of objects, stop to loop when it finds the first match, and then continue to loop with another search. In another language I would set a var found = false; before the loop and then set it to true in the loop, but with chaining I'm not sure how to do. Any idea ? Olivier -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: loop through elements and stop at first match
And what's the point of stopping the loop only to continue it again? _ From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rob Desbois Sent: Monday, July 09, 2007 8:57 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: loop through elements and stop at first match jQuery's in-built selectors with the custom selector ability should provide you with everything you need without having to loop through the array yourself. What are you trying to search for? On 7/9/07, Olivier Percebois-Garve [EMAIL PROTECTED] wrote: Hi I want to loop through the jquery array of objects, stop to loop when it finds the first match, and then continue to loop with another search. In another language I would set a var found = false; before the loop and then set it to true in the loop, but with chaining I'm not sure how to do. Any idea ? Olivier -- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 There's a whale there's a whale there's a whale fish he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
[jQuery] Re: Feature suggestion: animating through stylesheets
Jeroen Coumans wrote: On Jul 5, 9:56 pm, Scott Sauyet [EMAIL PROTECTED] wrote: I don't want to discourage you from trying, but I think it's more complicated than this. Specificity has to do with the number of id's, the number of classes (and pseudo-classes), and the number of elements in the selector. For instance, Simple fix: provide a CSS file with the plugin which the author can integrate themselves. Then selectors can be made as specific as needed, and it would enable lots of CSS-savy designers with little Javascript skills to customize the effects. The problem is that the CSS and the JQuery selectors used are unique to users' sites or even pages. There is no clear way to make selectors that will have a higher specificity than every selector in the user's stylesheet. The advantage of how JQuery (and most all JS tools I've seen) apply styles is that they do it at the DOM level, which will override what's in any other stylesheets. I think Gordon's suggestion of using !important is enough to make the difference, and Sean's implementation using that is already pretty strong. There is a ways to go towards making a generically useful plugin, but the proofs of concept are already quite impressive: http://www.sunsean.com/cssAnimate.html http://www.sunsean.com/animatetest.html The thought of incorporating this into the core is intriguing, but I'm guessing it would be rather difficult, and it does run into the issue that other !important declarations would interfere. For now, I'd love to see a useful plugin that would allow us to use this where appropriate. -- Scott
[jQuery] jquery books, whats the differences
Hi Now that im using jquery more and more for projects I was thinking about buying one or more books ( since there are 3 coming out ) What is the difference between the books target readers etc. I would like a good book that explains jquery and how it works and how to build and setup my own plugins Armand
[jQuery] Re: loop through elements and stop at first match
As Rob suggested, explore what you can do with the selectors available in jQuery. But if those don't do the trick, keep in mind that the jQuery result object is an array. If you want to do something unusual with it that isn't provided by the jQuery selectors, you can access the array elements directly with an ordinary loop or any other code you want to write. This typical jQuery code: // Iterate through all elements with class foo $('.foo').each( function() { var element = this; // do something with element } is essentially the same as: // Iterate through all elements with class foo var $foo = $('.foo'); for( var i = 0, n = $foo.length; i n; ++i ) { var element = $foo[i]; // do something with element } Once you access the array elements directly like this, you have the flexibility to do whatever you want in your code. As a silly example: // Iterate through the middle third of the // foo elements, in reverse order var $foo = $('.foo'), n = $foo.length; var first = n / 3, last = n * 2 / 3; for( var i = last - 1; i = first; i-- ) { var element = $foo[i]; // do something with element } -Mike _ From: Olivier Percebois-Garve I want to loop through the jquery array of objects, stop to loop when it finds the first match, and then continue to loop with another search. In another language I would set a var found = false; before the loop and then set it to true in the loop, but with chaining I'm not sure how to do. Any idea ? Olivier
[jQuery] Re: Feature suggestion: animating through stylesheets
Not exactly sure what you are saying as far as the selectors go, but a plugin should work for now and can be called like: $('.myClass').cssAnimate({params}); and the params should have to be what is in the style sheet and the set the end animation points, ie: assuming the css is: .myClass{ position:absolute; left: 0px; top:0px; } var params = { left : 50, top : 100 } And when $('.myClass').cssAnimate(params); is called, everything with 'myClass' will be moved 50x100. Ultimately the only limitation to this, as I see, is the support for the styles. On 7/9/07, Scott Sauyet [EMAIL PROTECTED] wrote: Jeroen Coumans wrote: On Jul 5, 9:56 pm, Scott Sauyet [EMAIL PROTECTED] wrote: I don't want to discourage you from trying, but I think it's more complicated than this. Specificity has to do with the number of id's, the number of classes (and pseudo-classes), and the number of elements in the selector. For instance, Simple fix: provide a CSS file with the plugin which the author can integrate themselves. Then selectors can be made as specific as needed, and it would enable lots of CSS-savy designers with little Javascript skills to customize the effects. The problem is that the CSS and the JQuery selectors used are unique to users' sites or even pages. There is no clear way to make selectors that will have a higher specificity than every selector in the user's stylesheet. The advantage of how JQuery (and most all JS tools I've seen) apply styles is that they do it at the DOM level, which will override what's in any other stylesheets. I think Gordon's suggestion of using !important is enough to make the difference, and Sean's implementation using that is already pretty strong. There is a ways to go towards making a generically useful plugin, but the proofs of concept are already quite impressive: http://www.sunsean.com/cssAnimate.html http://www.sunsean.com/animatetest.html The thought of incorporating this into the core is intriguing, but I'm guessing it would be rather difficult, and it does run into the issue that other !important declarations would interfere. For now, I'd love to see a useful plugin that would allow us to use this where appropriate. -- Scott -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: jquery book
On Jul 9, 2007, at 8:56 AM, GianCarlo Mingati wrote: got it!! Now the eBook is available. Nice job, well written and easy to understand. I'm sure i'll get better and better from now on. Kinda having a 'new toy' to play with... So glad to hear it, GianCarlo! I'll be posting a blog entry soon on learningjquery.com that details some last-minute changes that the publisher decided to make. Most notably, the book is now two books: 1. Learning jQuery is a 380-page gentle introduction and tutorial. It has 6 chapters introducing the broad jQuery categories (selectors, DOM manipulation, events, ajax, etc.), 3 chapters that provide in- depth examples for working with tables, forms, and shufflers/ rotators, a chapter on plugins (how to create your own and intros to Dimensions, Form, and Interface) and 3 appendices. It's available now at packtpub.com and by the end of the week at amazon.com 2. jQuery Reference Guide is a 250+ page complete reference to the jQuery API and selector expressions (up to v1.1.2), plus individual chapters on the Dimensions plugin, Form plugin, and creating your own plugin (and 3 appendices). This one should be available beginning of August. I'm afraid that some people will be disappointed by the decision to split the book in two, but I think the publisher made it in good faith. Jonathan and I were originally contracted to write approximately 250 pages, and that is what the publisher was using to determine pricing, etc. Once we really got into the writing, though, the book grew and grew until now the combined total is over 600 pages. Also, after the publisher notified us of this change, we went back to work on the reference book, writing a new introductory chapter and splitting the plugins chapter from the tutorial book into three separate chapters and re-writing them to be more reference- like. We've tried really, really hard to make both books valuable in their own right while also complementing each other. I hope that this provides enough information to answer Armand's question from a separate thread, at least about the two books that I've been working on, but if anyone has additional questions, I'd be happy to try to answer them. I can't speak for the other two books, but knowing their authors, I'm sure they will be top quality. As far as I know, they're both shooting for publication before the end of the year. By the way, people who pre-ordered the book on the publisher's web site before this change was made should have been contacted by a rep from PACKT. If not, you can send them a note and ask what the plan is at http://www.packtpub.com/contact/. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: Drag- Droppables using Interface
Fredrik, Sorry I did not get back to you, I am glad to see you got it working. On 7/9/07, Fredrik Karlsson [EMAIL PROTECTED] wrote: It seems I managed to solve the problem. After trying your code again, and removing .wrap() which caused some weird behaviour, everything's working again. Now I'll just have to keep an eye open for duplicate elements. Cheers! On 8 Juli, 16:13, Benjamin Sterling [EMAIL PROTECTED] wrote: A live version of the script can be found on http:// http://www.ethowin.net/dragTest.htm www.ethowin.net/dragTest.htmhttp://www.ethowin.net/dragTest.htm. I tried using your code, but it neither cloned or removed the dragged element. Hmm... then it probably was not getting an element in correct format, I will look at you code and see if I see anything. Also, the problem is quite random and doesn't seem to happen very often at all, so perhaps I could iterate through all lists on each drag/drop, and delete any found duplicates. But that might lead to some unnecessary overhead when the number or items grows. I agree, there should be better way. -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Feature suggestion: animating through stylesheets
I'll whip up a plugin when I get a chance. It will act and feel just like the current $.animate but use classes instead of DOM styling. ~Sean
[jQuery] POT: CSS Selector test
Came across this when running thru w3c.org and thought it was interesting: http://www.css3.info/selectors-test/ I have FF2 running and a lot of the selectors failed and in IE7, even more failed. -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Feature suggestion: animating through stylesheets
Sean, that would be great. On 7/9/07, Sean Catchpole [EMAIL PROTECTED] wrote: I'll whip up a plugin when I get a chance. It will act and feel just like the current $.animate but use classes instead of DOM styling. ~Sean -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Jquery hcal parser
For anyone who's interested, I just uploaded a jquery-based hcal parser: http://thebitterpill.com/07-2007/a-jquery-hcal-parser/
[jQuery] Re: how can i get only the id's of a container's child elements
*boggle*. Ill have to study that. Looks complicated. Glen On 7/9/07, Klaus Hartl [EMAIL PROTECTED] wrote: Klaus Hartl wrote: Glen Lipka wrote: var myString = ; $(#container .item).each(function(i){ myString = myString + , + this.id http://this.id; }); $(#myInput).val(myString); Hope this helps. Glen I like oneliners: var ids = $.map($('#container [EMAIL PROTECTED]'), function() { return this.id; }).join(','); Setting the value was missing: $(#myInput).val( $.map($('#container [EMAIL PROTECTED]'), function() { return this.id; }).join(',') ); --Klaus
[jQuery] Re: jquery books, whats the differences
Mine is (working title) jQuery for Designers. jQuery has improved the lives of web developers, information architects, UX designers, and graphic artists (in addition to programmers). It allows for a much more iterative prototyping process that can be managed by the design team on their own. My book is focused on real world scenerios, and jQuery solutions, with design principles to explain why (and why not) to use advanced techniques in these circumstances. The other books will be much more technical than mine. I don't show how to build your own plugin. From a jQuery standpoint its a primer. However, a primer is enough to radically change the way the design team works. Im literally working on the whole thing now, so alot of the paint is still wet. Glen On 7/9/07, Armand Datema [EMAIL PROTECTED] wrote: Hi Now that im using jquery more and more for projects I was thinking about buying one or more books ( since there are 3 coming out ) What is the difference between the books target readers etc. I would like a good book that explains jquery and how it works and how to build and setup my own plugins Armand
[jQuery] jQuery + AjaxCFC Tutorial Part 1
Hi folks, Just wanted to let y'all know that I've written the first of a two (possibly three) part tutorial on using Rob Gonda's AjaxCFC with jQuery http://cjordan.us/index.cfm/2007/7/8/jQuery--AjaxCFC-Tutorial-Part-1-Setting-Up-Your-AJAX-Call. Part two will be about manipulating complex data returned from a CFC. The tentative part three will be about debugging using AjaxCFC. I hope people will find this useful. Chris -- http://www.cjordan.us
[jQuery] Re: Jquery hcal parser
On 7/9/07, Baxter [EMAIL PROTECTED] wrote: For anyone who's interested, I just uploaded a jquery-based hcal parser: http://thebitterpill.com/07-2007/a-jquery-hcal-parser/ Very cool. I'm going to play with this. I think jQuery and microformats are a great match. Has anyone else done work along these lines that I'm not aware of? - Richard
[jQuery] Re: Jquery hcal parser
I agree. One of the reasons I wanted it to do it with jquery is because dealing with microformats generally involves a lot of picking through looking for that class or this id, which jQuery really excels at. On Jul 9, 10:50 am, Richard D. Worth [EMAIL PROTECTED] wrote: On 7/9/07, Baxter [EMAIL PROTECTED] wrote: For anyone who's interested, I just uploaded a jquery-based hcal parser: http://thebitterpill.com/07-2007/a-jquery-hcal-parser/ Very cool. I'm going to play with this. I think jQuery and microformats are a great match. Has anyone else done work along these lines that I'm not aware of? - Richard
[jQuery] Re: how can i get only the id's of a container's child elements
Glen Lipka wrote: *boggle*. Ill have to study that. Looks complicated. Glen Glen, it's not complicated at all :-) I'm using jQuery's $.map method to translate one array - the result set $('#container [EMAIL PROTECTED]') - into another array, containing all the ids of the items in there. What gets into the resulting array is controlled by what is returned by the translater function given as second argument to $.map: function() { return this.id; } Knowing that $.map returns another array, I can then use the Array.join method to concatenate the array items into a string: $.map( ... ).join(','); I haven't actually tested the whole thing. It may be necessary to convert the result set into a real array: $('#container [EMAIL PROTECTED]').get() I chose another selector by the way to match only descendants that do actually have an id. --Klaus
[jQuery] Re: Scroller ticker...
I like newsticker: http://www.texotela.co.uk/code/jquery/newsticker/ ~Sean
[jQuery] Re: Feature suggestion: animating through stylesheets
Lurvely I have a real world example where I can immediately try this out on: http://64squar.es. When the chess pieces appear initially, they all slide onto the board. It's a bit jerky really - esp since its trying to move 32 x 60x60 pngs with alpha channel. It's currently somewhat jerky, so i'd definitely be interested in trying this css method ! *...( On Jul 9, 4:55 pm, Scott Sauyet [EMAIL PROTECTED] wrote: Benjamin Sterling wrote: Not exactly sure what you are saying as far as the selectors go, I discussed it earlier in the thread: http://groups.google.com/group/jquery-en/msg/22f43f8e84a711b2 It's not that important since Gordon hit on using the !important declaration. But without that, other selectors in the stylesheet could stop the CSS-based animation from working. -- Scott
[jQuery] Re: jQuery + AjaxCFC Tutorial Part 1
Nice one Chris. Christopher Jordan wrote: Hi folks, Just wanted to let y'all know that I've written the first of a two (possibly three) part tutorial on using Rob Gonda's AjaxCFC with jQuery http://cjordan.us/index.cfm/2007/7/8/jQuery--AjaxCFC-Tutorial-Part-1-Setting-Up-Your-AJAX-Call. Part two will be about manipulating complex data returned from a CFC. The tentative part three will be about debugging using AjaxCFC. I hope people will find this useful. Chris -- http://www.cjordan.us
[jQuery] Re: Set element's css 'min-height' to browser's viewport height?
that's brilliant, Klaus! Thanks for sharing that. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 8, 2007, at 12:23 PM, Klaus Hartl wrote: zarino wrote: Hi! I'd like to set all elements with the class .inner to have a minimum height equal to the height of the browser's viewport. So, if the window height is 550px, each of the '.inner' divs will have a minimum height of 550px. I suspect it's bound to be super-easy to do with jQuery, but newbie that I am, I can't figure it out. :-S How would I go about doing this? Many thanks, Zarino Benjamin already mentioned the dimensions plugin. With it included, try: $(function() { $('div.inner').css(($.browser.msie $.browser.version 7 ? '' : 'min-') + 'height', $(window).height() + 'px'); }); If you need to adjust on window resize try this: $(function() { $(window).bind('resize', function() { $('div.inner').css(($.browser.msie $.browser.version 7 ? '' : 'min-') + 'height', $(window).height() + 'px'); }).trigger('resize'); }); --Klaus
[jQuery] Re: Feature suggestion: animating through stylesheets
On 7/9/07, weepy [EMAIL PROTECTED] wrote: When the chess pieces appear initially, they all slide onto the board. It's a bit jerky really - esp since its trying to move 32 x 60x60 pngs with alpha channel. There are lots of browser limitations with working with PNGs. But more importantly, this new animation function will only speed up simultaneous animations, it will not speed up 64 different animations (if that's how you're doing it). ~Sean
[jQuery] ANN: CFJS 1.1.8 is now available for download
Hi folks, Just wanted to let everyone know that version 1.1.8 of CFJS (both the jQuery and independent flavors) is now available for download from riaforge.org (http://cfjs.riaforge.org). Many thanks to Trent Richardson who coded the new functions that this version makes available, namely: IsSimpleValue() IsString() IsValid() Cheers! Chris -- http://www.cjordan.us
[jQuery] Re: Feature suggestion: animating through stylesheets
they are different animations - but it should be easy to bunch them all together. On Jul 9, 5:56 pm, Sean Catchpole [EMAIL PROTECTED] wrote: On 7/9/07, weepy [EMAIL PROTECTED] wrote: When the chess pieces appear initially, they all slide onto the board. It's a bit jerky really - esp since its trying to move 32 x 60x60 pngs with alpha channel. There are lots of browser limitations with working with PNGs. But more importantly, this new animation function will only speed up simultaneous animations, it will not speed up 64 different animations (if that's how you're doing it). ~Sean
[jQuery] Re: Feature suggestion: animating through stylesheets
Its only relevant if you are changing a bunch of stuff at the exact same time. Here is a real world example: A grid, similar to EXT's grid. Capabilities with a large number of rows: Sorting, Selecting (shift select), adding, deleting, re-ordeing via drag, changing height (excel type), changing width of a column. In these cases, changing the CSS is a major speed improvement. However, does this mean you should put it in the core? Probably not. But it's a strong suggestion to any grid maker to consider this method in their plugin. Another use case: Let's say someone builds a powerpoint like app with the ability to marquee select a large group of elements and then move them. This one is a stretch, but this method should be considered there too. Another use case: Advanced dashboards. Let's say your dashboard loads up and grows the bars or charts in an identical way. This would keep the animation smoother. A big question in my mind is: On a slow machine with ONE animation: Is doing it this way smoother than not? Does CSS manipulation of a single animation make it smoother? What is the gating factor for a slow computer? CPU or Ram or Video card? Or all three? How can one test this? Glen On 7/9/07, Sean Catchpole [EMAIL PROTECTED] wrote: On 7/9/07, weepy [EMAIL PROTECTED] wrote: When the chess pieces appear initially, they all slide onto the board. It's a bit jerky really - esp since its trying to move 32 x 60x60 pngs with alpha channel. There are lots of browser limitations with working with PNGs. But more importantly, this new animation function will only speed up simultaneous animations, it will not speed up 64 different animations (if that's how you're doing it). ~Sean
[jQuery] Using scrollIntoView with overflow blocks
I have a web page that has a div with the following style. overflow: auto; white-space: nowrap; width: 100%; height: 300px; The overload and height causes the div block to display a scrollbar when height of the content exceeds that height. What I need to do is scroll to a point in that block but when I use the standard scrollIntoView Javascript function it scrolls the parent page as well as the div block. I would like to know if there is a way to just scroll that div independently of the page? Is there a feature in jQuery to make this work?
[jQuery] Re: Manipulating loaded data
This has come up many many many times on this list. You need to put a callback in the .load call, like this: $('.galleryList').load(data.dat,function() { // Do bindings here }); On 7/9/07, divinci [EMAIL PROTECTED] wrote: Hi all, firstly let me thank you all for supporting such a great library. I am not the most adept programmer so I hope you will help me out by explaining some of the workings of JQuery. Script / $('.galleryList').load(data.dat); $('.gallerySelect').click(function(){ var gallerySelected = $(this).parent('div'); if( gallerySelected.attr('class')=='galleryOut' ) { gallerySelected.removeClass(); gallerySelected.addClass(galleryIn); } else { gallerySelected.removeClass(); gallerySelected.addClass(galleryOut); } }); Body / body div class=galleryList /div /body data.dat / div class=galleryOut id=101 div class=gallerySelectA/div div class=galleryContentB/div div class=galleryEditC/div /div My question is a simple one, I am loading data into the galleryList div and then wish to manipulate it. How can I load this data from an external source and THEN have is answer to Jquery calls? Thanks guys.
[jQuery] Re: jQuery + AjaxCFC Tutorial Part 1
Great job Chris! I'll definitely check this out. Rey Christopher Jordan wrote: Hi folks, Just wanted to let y'all know that I've written the first of a two (possibly three) part tutorial on using Rob Gonda's AjaxCFC with jQuery http://cjordan.us/index.cfm/2007/7/8/jQuery--AjaxCFC-Tutorial-Part-1-Setting-Up-Your-AJAX-Call. Part two will be about manipulating complex data returned from a CFC. The tentative part three will be about debugging using AjaxCFC. I hope people will find this useful. Chris -- http://www.cjordan.us -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com
[jQuery] Re: Feature suggestion: animating through stylesheets
On 7/9/07, Glen Lipka [EMAIL PROTECTED] wrote: A big question in my mind is: On a slow machine with ONE animation: Is doing it this way smoother than not? Does CSS manipulation of a single animation make it smoother? What is the gating factor for a slow computer? CPU or Ram or Video card? Or all three? How can one test this? On slow machines the problem is redraw speed. With the CSS method all the elements are lined up together, but there is still lag between each redraw. Since this method might be a good deal more bloated than the jquery animate function I also recommend not including it in the core, at least for the time being. ~Sean
[jQuery] Really removing items from the DOM
Hi, all! i'm a recent jQuery convert (but by no means a noob programmer) and i'm INCREDIBLY impressed with the library. i'm working on an application for prototyping board game designs (a hobby of mine) and i have a question about how to do one thing in jQuery: How do i permanently remove items from the DOM *and* jQuery object? i am aware of jQuery(..).remove(), but the docs for remove() say: This does NOT remove them from the jQuery object, allowing you to use the matched elements further. This feature [snide comment removed] causes me to have to jump through some hoops in my code to set the matched DOM object IDs to null so that i won't pick them up in later queries. My application (prototype) is available here: http://wanderinghorse.net/gaming/bpi/ And you can see what i need a real remove feature for by doing this: a) double-click one of the graphics of the little men (top-most graphics on the page). b) click the remove all pieces button (at the top of the page). (b) removes all pieces from the game board, but (in theory) those pieces (img elements) are still in the jQuery internal list. i want to remove them from that list permanently. But how? Many thanks for your time, - stephan beal
[jQuery] Syntactic sugar for checking whether an element exists
I've just been wondering if jQuery has some syntactic sugar for checking if an element exists. I know the following works: if ($('#my-element').length) { // #my-element exists } but is there also something similar to the following?: if ($('#my-element').exists()) { // #my-element exists } I'm asking because I know this was one of the things I was initially unsure about when learning jQuery and I just had a one of my many jQuery converted friends ask me about it again. So is anybody else thinking some syntactic sugar could be helpful here? Or what do you think about: $('#my-element').is('*') ? (Besides that it's probably inefficient *g*) -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de
[jQuery] jVariations r2 = developer plugin/tool updated
I've recently updated my jVariations plug-in (not sure if anyone was using the old version). It is a developer tool that allows you to toggle variations (aka corner cases) on a single HTML page. Useful for rapid visualization of code changes... before weaving in the real DHTML calls or handing files over to server-side engineers. http://cherne.net/brian/resources/jquery.variations.html What's New: - Supports chaining! - Ability to override default onShow and onHide functions - Ability for a single variation to require multiple variations - Required variations (if hidden) are highlighted and selected automatically - Control panel HTML/CSS now works in IE6 Unless there's a major bug I'll probably put development on hold for a while. The next version, r3, will likely contain the ability to more easily customize the control panel title, colors, position and size... this assumes people actually find this plug-in useful and would like that functionality. Perhaps sooner than that I may create a better example/demo page... distilled from a real-world example. Comments and feedback welcome! Brian.
[jQuery] validation pluging work in FireFox but Not in Internet Explorer
Hi; I've used the jQuery's official validation plugin (http:// bassistance.de/jquery-plugins/jquery-plugin-validation/), your can see the page in here (http://nexus.di-tasarim.com/index.php? option=com_nexusact=coursestask=viewAppid=1) The main difference between the orginal code and mine is,I used a table based layout for form only, it is not cause any error in FireFox but in Internet Explorer is fails. And also I put the same tableless code from orginal examples, it also fails in Internet Explorer. What's problem, please help... tHanks...
[jQuery] Re: Syntactic sugar for checking whether an element exists
You can also do: if ($('#my-element')[0]) { } or if ($('#my-element').size()) { } or if you want the sugary syntax you can declare it yourself: jQuery.fn.exists = jQuery.fn.size; Mike On 7/9/07, Felix Geisendörfer [EMAIL PROTECTED] wrote: I've just been wondering if jQuery has some syntactic sugar for checking if an element exists. I know the following works: if ($('#my-element').length) { // #my-element exists } but is there also something similar to the following?: if ($('#my-element').exists()) { // #my-element exists } I'm asking because I know this was one of the things I was initially unsure about when learning jQuery and I just had a one of my many jQuery converted friends ask me about it again. So is anybody else thinking some syntactic sugar could be helpful here? Or what do you think about: $('#my-element').is('*') ? (Besides that it's probably inefficient *g*) -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de
[jQuery] Re: Really removing items from the DOM
On 7/9/07, Stephan Beal [EMAIL PROTECTED] wrote: How do i permanently remove items from the DOM *and* jQuery object? i am aware of jQuery(..).remove(), but the docs for remove() say: Assuming there is one(I'm fairly low-level with JS) have you tried just using the regular Javascript process for doing this? jQuery makes a lot of things convenient/easier, but it's not trying to replace things that are already fine. So, for example if you need to create an element, just use regular old createElement().
[jQuery] Release: Accordion 1.4
An update to the jQuery accordion plugin brings you, among minor bugfixes and a demo overhaul (http://jquery.bassistance.de/accordion/), one notable new feature: The navigation-option automatically activates a part of the accordion based on the current location (URL) of the page. The basic idea came up in the comments on the plugin page (http://bassistance.de/jquery-plugins/jquery-plugin-accordion/) and was at first implemented in Bernd Matzner's HoverAccordion (http://berndmatzner.de/jquery/hoveraccordion/). The basic idea is the same: Find the anchor in the navigation accordion that matches location.href and mark it as selected and open the part of the accordion where it is inside. This gives you a sort of state-saving without the need to generate selected-classes on the serverside. In addition, I've create a project on jquery.com/plugins, feel free to vote if you like it: http://jquery.com/plugins/project/accordion/ -- Jörn Zaefferer http://bassistance.de
[jQuery] Is there a way to READ the $.ajax settings?
Hi, all! i would like to force $.ajax() to use synchronous mode temporarily and then switch it back to whatever mode it was in before i started. The problem is, i can't find away to read that setting (without dipping into the undocument/private structure of the jQuery code). Of course, i can do this: $.ajaxSetup({async:false}); ... my op ... $.ajaxSetup({async:true}); but that code cannot know if async is the proper mode to re-set to - it should be able to return it to its previous mode. Is there a way to read this setting without having to abuse the jQuery internals? Many thanks for your time, - stephan beal
[jQuery] Re: Syntactic sugar for checking whether an element exists
I believe that learning jquery returns an array like object is more useful than creating a .exists() function. ~Sean
[jQuery] Re: Really removing items from the DOM
On Jul 9, 2007, at 13:45 , Stephan Beal wrote: How do i permanently remove items from the DOM *and* jQuery object? i am aware of jQuery(..).remove(), but the docs for remove() say: This does NOT remove them from the jQuery object, allowing you to use the matched elements further. This feature [snide comment removed] causes me to have to jump through some hoops in my code to set the matched DOM object IDs to null so that i won't pick them up in later queries. I think you're confused about what the jQuery object means here. There isn't a master internal list of objects that is keeping track of the DOM nodes. The docs are talking about the individual jQuery object instance you're working with, so you can have the code: $('#myElement').remove().doSomethingElseWithMyElement(); The chain is not broken, and the object still has access to the element. It is removed from the DOM, though, so a later call to: $('#myElement') will match no elements. It will be an empty jQuery object. -- Jonathan Chaffer Technology Officer, Structure Interactive
[jQuery] Re: Non integer amount of visible items
Jan Sorgalla wrote: Hi, this mix is a bit difficult to handle. I've updated jquery.jcarousel.js. Please download it from http://sorgalla.com/projects/jcarousel/ and try if it works now for you. Jan Yay! The fix works! :) Thanks again.. --yuval -- View this message in context: http://www.nabble.com/Non-integer-amount-of-visible-items-tf3993441.html#a11507568 Sent from the jCarousel mailing list archive at Nabble.com.
[jQuery] Re: Designerly Ajax ? from newbie
Slightly more concise, not tested: function getContent(id, url) { $('#' + id).fadeOut(1200, function() { $('#' + id).load(url).fadeIn(1200); } } - Richard
[jQuery] Re: Is there a way to READ the $.ajax settings?
$.ajaxSettings.async ~Sean
[jQuery] Re: Syntactic sugar for checking whether an element exists
Sean, Mike: I agree with your notion that learning that the jQuery object is array-like (It'd be cool if it was a real array and .push / .sort would work on it) is very worthwhile. I knew that when I initially stumbled across the problem and knew that doing it via '.length' was one solution. I was only confused if it was the right way or could lead to undesired results as I was new to jQuery at this point and I didn't find it mentioned anywhere in specific. That's where my notion of an 'exists()' function could be useful comes from. But it's probably just something that should be put in the manual somewhere (if it isn't already in there and I missed it). -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de Sean Catchpole wrote: I believe that learning jquery returns an array like object is more useful than creating a .exists() function. ~Sean
[jQuery] Random number of events required on page
What I'm trying to figure out how to do is to have jQuery handle multiple events on one page, that are pulled out a of a database (can be any amount of numbers). A good example of what I'm trying to do would be a large FAQ listing, where each question is clickable, which after it is clicked, expands the answer under it. After doing all of the reading I've only found ways that unless I manually specifiy each div differently, clicking on one question will expand all of the answers. With a some what random amount of questions on each page, how could I make it so that it could check each question and expand each individual answer?
[jQuery] allow no more than 3 checkboxes checked
I have about 10 checkbox input elements with the same name and I'd like to not let the user select more than 3 of them. How can I do this with Jquery?
[jQuery] Re: Syntactic sugar for checking whether an element exists
Felix Geisendörfer wrote: It'd be cool if it was a real array and .push / .sort would work on it That isn't so far fetched. There is the array plugin: http://dev.jquery.com/browser/trunk/plugins/array And a push-implementation is missing there but easy to add: push: function( t ) { return this.setArray( jQuery.merge( this.get(), t ) ); } -- Jörn Zaefferer http://bassistance.de
[jQuery] Re: allow no more than 3 checkboxes checked
cfdvlpr wrote: I have about 10 checkbox input elements with the same name and I'd like to not let the user select more than 3 of them. How can I do this with Jquery? Do you want to prevent the user from actually selecting more then three checkboxes? Or just validating? The latter case is possible with the validation plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ The rule would look like this: nameOfcheckboxGroup: { required: true, maxLength: 3 } -- Jörn Zaefferer http://bassistance.de
[jQuery] Re: Syntactic sugar for checking whether an element exists
On Jul 9, 1:50 pm, Sean Catchpole [EMAIL PROTECTED] wrote: I believe that learning jquery returns an array like object is more useful than creating a .exists() function. IMO, many people look for common sense methods that should exist in jQuery, or at least as part of a standard and commonly-used plugin. An exists() method seems like a reasonable candidate. As another example, I think .hasClass() should exist, even though you can do .is(.className) - simply because most people will look for a method called hasClass rather than reading the docs and eventually finding that .is() is the correct way to do it. It makes jQuery a little more approachable and user-friendly if it has exactly what you're looking for and expect, even though it may just be a wrapper for the real underlying functionality. Matt Kruse
[jQuery] Re: allow no more than 3 checkboxes checked
Your checkboxes are an array (assuming that they all have the same name). Something like this might work: $('input.checkboxfieldname').click(function(){ if ($(this).length = 3) { alert('sorry, only three checkboxes allowed'); } }); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cfdvlpr Sent: Monday, July 09, 2007 2:43 PM To: jQuery (English) Subject: [jQuery] allow no more than 3 checkboxes checked I have about 10 checkbox input elements with the same name and I'd like to not let the user select more than 3 of them. How can I do this with Jquery?
[jQuery] Re: Random number of events required on page
You could use event bubbling. Set a click event handler on a parent element that contains all of your clickable questions. In that click handler, check this to see if it actually is one of the clickable questions and take your action then. -Mike From: [EMAIL PROTECTED] What I'm trying to figure out how to do is to have jQuery handle multiple events on one page, that are pulled out a of a database (can be any amount of numbers). A good example of what I'm trying to do would be a large FAQ listing, where each question is clickable, which after it is clicked, expands the answer under it. After doing all of the reading I've only found ways that unless I manually specifiy each div differently, clicking on one question will expand all of the answers. With a some what random amount of questions on each page, how could I make it so that it could check each question and expand each individual answer?
[jQuery] Re: allow no more than 3 checkboxes checked
Ignore my code completely, it doesn't work. -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cfdvlpr Sent: Monday, July 09, 2007 2:43 PM To: jQuery (English) Subject: [jQuery] allow no more than 3 checkboxes checked I have about 10 checkbox input elements with the same name and I'd like to not let the user select more than 3 of them. How can I do this with Jquery?
[jQuery] Re: Syntactic sugar for checking whether an element exists
Matt Kruse wrote: As another example, I think .hasClass() should exist, even though you can do .is(.className) - simply because most people will look for a method called hasClass rather than reading the docs and eventually finding that .is() is the correct way to do it. It makes jQuery a little more approachable and user-friendly if it has exactly what you're looking for and expect, even though it may just be a wrapper for the real underlying functionality. hasClass() is on the 1.2 roadmap. I can't find the initial branch of this thread. Could someone repeat what exists() is supposed to do? -- Jörn Zaefferer http://bassistance.de
[jQuery] Re: Syntactic sugar for checking whether an element exists
Felix, not to worry, there's nothing wrong at all with using .length - and it is obviously faster than a function call. In the earliest versions of jQuery, the jQuery object was not an array, but had a private array object that you accessed using .get(n) and .size(). The only reason those functions still exist is for compatibility with old code. There's no reason at all to stick with .get(n) and .size() now that the array-like jQuery object allows the simpler and more efficient [n] and .length. -Mike _ From: Felix Geisendörfer Sean, Mike: I agree with your notion that learning that the jQuery object is array-like (It'd be cool if it was a real array and .push / .sort would work on it) is very worthwhile. I knew that when I initially stumbled across the problem and knew that doing it via '.length' was one solution. I was only confused if it was the right way or could lead to undesired results as I was new to jQuery at this point and I didn't find it mentioned anywhere in specific. That's where my notion of an 'exists()' function could be useful comes from. But it's probably just something that should be put in the manual somewhere (if it isn't already in there and I missed it). -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de Sean Catchpole wrote: I believe that learning jquery returns an array like object is more useful than creating a .exists() function. ~Sean
[jQuery] Re: Syntactic sugar for checking whether an element exists
On 7/9/07, Jörn Zaefferer [EMAIL PROTECTED] wrote: I can't find the initial branch of this thread. Could someone repeat what exists() is supposed to do? $.fn.exists = function() { return !!this.length; } ~Sean
[jQuery] Re: allow no more than 3 checkboxes checked
On 7/9/07, cfdvlpr [EMAIL PROTECTED] wrote: I have about 10 checkbox input elements with the same name and I'd like to not let the user select more than 3 of them. How can I do this with Jquery? You can try this: $.fn.limit = function(n) { var self = this; this.click(function(){ return (self.filter(:checked).length=n); }); } $(input:checkbox).limit(3); ~Sean
[jQuery] Re: blur( fn ) doesn't work in Opera?
I even tried $(#inputthreadtitle).bind(blur, function(){ // }); but that also doesn't work. :-(
[jQuery] Re: JQuery - CrossBrowser? - Script not working in Firefox
Ok, so you da man when it comes to this AutoCompleter? I did try the page from FF and it definitely worked. Would you mind looking at the code? function findValue(li) { if( li == null ) return alert(No match!); // if coming from an AJAX call, let's use the CityId as the value if( !!li.extra ) var sValue = li.extra[0]; // otherwise, let's just display the value in the text box else var sValue = li.selectValue; oItmDesc = document.getElementById(ItmDesc); oItmDesc.innerHTML = li.extra[0]; oOnHandQty = document.getElementById(OnHandQty); oOnHandQty.innerHTML = li.extra[1] oPrice = document.getElementById(Price); oPrice.innerHTML = li.extra[2] // alert(The value you selected was: + sValue); } function selectItem(li) { findValue(li); } function formatItem(row) { return row[0] + - + row[1]; } function lookupAjax(){ var oItem = $(#txtItem)[0].autocompleter; oItem.findValue(); return false; } $(document).ready(function() { $(#txtItem).autocomplete(itemquery.abc, { delay:10, minChars:2, matchSubset:1, matchContains:1, cacheLength:10, maxItemsToShow:15, width:500, onItemSelect:selectItem, onFindValue:findValue, formatItem:formatItem, autoFill:true, extraParams: { 'CustNo': '436887' } } ); }); On Jul 9, 7:51 am, Dan G. Switzer, II [EMAIL PROTECTED] wrote: With JQuery supposedly crossbrowser capable, I did not think the script I'm using would have any issues in Firefox. Dumb thought, perhaps. It doesn't seem to execute at all in Firefox. It's the AutoCompleter located at http://www.pengoworks.com/workshop/jquery/autocomplete.htm. It's working well in IE7, but not in Firefox. Are there any additional requirements to get JQuery working in Firefox? Are you saying the examples on that page aren't working for you in Firefox? Firefox is my primary development browser (and was when I made that page) and the examples on that page work fine in both FF v1.5 and v2.0. If those example pages aren't working, then I would suspect you have a plug-in that's causing problems. If the examples on that page are working, then there's another problem with your code. -Dan
[jQuery] Re: Using AutoCompleter, how do you pass parameters
Now if I could only make sense of that page. g So you wrote that mod to the original AutoCompleter by Dylan V and now you and this other guy Joern are working on it? Sorry, just trying to understand who's who. What should I download from that page? On Jul 9, 8:49 am, Dan G. Switzer, II [EMAIL PROTECTED] wrote: One other thing: If the user does not actually select an item from the list and, instead, just tabs out of the field - perhaps because the item that was put into the textbox via the quick-fill was the one he wanted - then the code to populate other fields does not fire. How can I get that code to fire? (The code below does not fire) Yeah, that looks like a bug. Development of this code branch has actually stopped and been replaced with: http://dev.jquery.com/browser/trunk/plugins/autocomplete It looks like this issue is resolved in the latest code base. -Dan
[jQuery] Google Maps like interface with JQuery
Hi All, Does anyone know of a Google Maps like interface implemented using JQuery? The only real requirement is that a user can zoom in/out. On zoom, a new image is properly loaded in terms of zoom and user expected location. If not, could you point me to a couple functions within JQuery that would be a good starting point for this type of project? Cheers, Pete
[jQuery] Re: Really removing items from the DOM
On Jul 9, 8:52 pm, Jonathan Chaffer [EMAIL PROTECTED] wrote: I think you're confused about what the jQuery object means here. snip $('#myElement') will match no elements. It will be an empty jQuery object. Aha! Okay, that's exactly what i need/want :D. Once again, jQuery delivers :). It truly is an awesome piece of work, and has revolutionized how i work with ajax. Thanks :).
[jQuery] Re: Is there a way to READ the $.ajax settings?
On Jul 9, 9:26 pm, Sean Catchpole [EMAIL PROTECTED] wrote: $.ajaxSettings.async That's exactly what i was looking for. Thanks :). Do you happen to know if that's documented anywhere? i can find no mention of it on the jquery site, and using the on-site search engine returns (as usual) No page title matches. :)
[jQuery] Re: Really removing items from the DOM
My apologies if this reply shows up twice... i'm confused about what i have and have not done tonight... On Jul 9, 8:52 pm, Jonathan Chaffer [EMAIL PROTECTED] wrote: I think you're confused about what the jQuery object means here. There isn't a master internal list of objects that is keeping track of the DOM nodes. The docs are talking about the individual jQuery object instance you're working with, so you can have the code: You're right- i was confused about the meaning of does not remove them from the jQuery object, thinking that that meant that there was a master internal list. Thanks for the clarification :).
[jQuery] Re: Syntactic sugar for checking whether an element exists
Felix, not to worry, there's nothing wrong at all with using .length - and it is obviously faster than a function call. I figured that by now. I think Matt was much better at explaining why I think an alternative exists() function is useful - it simply is the most intuitive thing a new jQuery user looks for. I also agree with his hasClass argument. I love the is() function, but I would have taken me a long time to find it if I my question was phrased Who can I determine if an element has a certain class.is() is more powerful but not nearly as intuitive as hasClass would be for new users. In the earliest versions of jQuery, the jQuery object was not an array, but had a private array object that you accessed using .get(n) and .size(). The only reason those functions still exist is for compatibility with old code. There's no reason at all to stick with .get(n) and .size() now that the array-like jQuery object allows the simpler and more efficient [n] and .length. I disagree. Whenever you need to sort the elements in an ul or something then you'll have to use the Array.sort() function, so you need to do $('ul li').get().sort(...). Here is an example of where I needed this functionality: http://bin.cakephp.org/view/1632218532 It's not a big deal that I have to call get(), but it would be a big problem if it wasn't there! -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de Michael Geary wrote: Felix, not to worry, there's nothing wrong at all with using .length - and it is obviously faster than a function call. In the earliest versions of jQuery, the jQuery object was not an array, but had a private array object that you accessed using .get(n) and .size(). The only reason those functions still exist is for compatibility with old code. There's no reason at all to stick with .get(n) and .size() now that the array-like jQuery object allows the simpler and more efficient [n] and .length. -Mike *From:* Felix Geisendörfer Sean, Mike: I agree with your notion that learning that the jQuery object is array-like (It'd be cool if it was a real array and .push / .sort would work on it) is very worthwhile. I knew that when I initially stumbled across the problem and knew that doing it via '.length' was one solution. I was only confused if it was the right way or could lead to undesired results as I was new to jQuery at this point and I didn't find it mentioned anywhere in specific. That's where my notion of an 'exists()' function could be useful comes from. But it's probably just something that should be put in the manual somewhere (if it isn't already in there and I missed it). -- Felix -- My Blog: http://www.thinkingphp.org My Business: http://www.fg-webdesign.de Sean Catchpole wrote: I believe that learning jquery returns an array like object is more useful than creating a .exists() function. ~Sean
[jQuery] Getting the next span
Been using jQuery for a while, but can't seem to figure this one out. What I want to do is get the next span element when someone clicks on the text inside the first span element. Then when someone clicks on the text in the second span element, get the next span, and so on. If someone clicks on the last span, it should not select any further span elements (i.e. it should not wrap back around to the first span). I've posted an example below. I've tried using the .next() function, but that only returns the very next element. I've also tried using .siblings(), but that gives me all of the siblings that are spans, not just the next one. One thing to keep in mind is that the actual page I am doing this on will have hundreds of these div sections, so accessing spans by ID is not useful. It needs to be able to programmatically find the next sibling span. html head titleTEST/title script type=text/javascript src=http://code.jquery.com/jquery- latest.pack.js/script script language=JavaScript $(function() { $('#span1').bind('click', function() { // GET THE NEXT SPAN HERE }); }); /script /head body div id=div1 span id=span1SOME TEXT/spanbr / a href=http://www.google.com;GOOGLE/abr / spanMORE TEXT/spanbr / divtextarea name=/textarea/div spanA LITTLE MORE TEXT/span /div /body /html
[jQuery] maskedinput multiple mask characters not working
When using the maskedinput plugin, using single masked character works fine: $(#date).mask(99/99/); //the / are mask characters and are ignored by the plugin. and double mask characters work fine at the end of the input: $(input.childAge).mask(99Y 99Mo); //also works fine. But when you have 2 consecutive mask characters internally, it causes the input to erase when it loses focus: $(input.childAge).mask(99Yr 99Mo); erases when loses focus (in ie6,anyway). It may not be worth changing the logic, because you can easily use 99Y 99Mo, but it was kind of a frustrating process figuring out why it wouldn't work as anticipated, so I thought I would post in case anyone else has the problem. Eric
[jQuery] Re: Google Maps like interface with JQuery
Hi Pete, Here are two links for you to look at: http://projects.sevir.org/storage/jqmaps/index.html http://olbertz.de/jquery/googlemap.html# Hopefully they can help you out. Rey Pete wrote: Hi All, Does anyone know of a Google Maps like interface implemented using JQuery? The only real requirement is that a user can zoom in/out. On zoom, a new image is properly loaded in terms of zoom and user expected location. If not, could you point me to a couple functions within JQuery that would be a good starting point for this type of project? Cheers, Pete
[jQuery] Re: Getting the next span
Did you try next(span)? Glen On 7/9/07, jmbJq [EMAIL PROTECTED] wrote: Been using jQuery for a while, but can't seem to figure this one out. What I want to do is get the next span element when someone clicks on the text inside the first span element. Then when someone clicks on the text in the second span element, get the next span, and so on. If someone clicks on the last span, it should not select any further span elements (i.e. it should not wrap back around to the first span). I've posted an example below. I've tried using the .next() function, but that only returns the very next element. I've also tried using .siblings(), but that gives me all of the siblings that are spans, not just the next one. One thing to keep in mind is that the actual page I am doing this on will have hundreds of these div sections, so accessing spans by ID is not useful. It needs to be able to programmatically find the next sibling span. html head titleTEST/title script type=text/javascript src=http://code.jquery.com/jquery- latest.pack.js/script script language=JavaScript $(function() { $('#span1').bind('click', function() { // GET THE NEXT SPAN HERE }); }); /script /head body div id=div1 span id=span1SOME TEXT/spanbr / a href=http://www.google.com;GOOGLE/abr / spanMORE TEXT/spanbr / divtextarea name=/textarea/div spanA LITTLE MORE TEXT/span /div /body /html
[jQuery] Re: Getting the next span
$('#span1').bind('click', function() { return $(this).next(span); }); or $('#span1').bind('click', function() { return $(~ span,this); }); ~Sean
[jQuery] Re: Is there a way to READ the $.ajax settings?
On 7/9/07, Stephan Beal [EMAIL PROTECTED] wrote: Do you happen to know if that's documented anywhere? i can find no mention of it on the jquery site, and using the on-site search engine returns (as usual) No page title matches. I doubt it's documented, I just dug it our of the source (which is well documented). ~Sean
[jQuery] Re: Getting the next span
I use this logic to get the next input, and to search for the next input if there were intervening elements, for example: divinput/div div table trtd//tdtd/td/tr trtd/tdtdinput/td/tr /table /div The function will iterate through until it finds the next input, even if it is not the next element: function tabOver(ele) { var possInput = $(ele).parent().next().children('input'); //var nextInput = (possInput.size()0) ? possInput.focus() : $ (ele).parent().parent().next().find('input').focus(); Unfortunately for me, for some reason this focused on the last input in the table, not the next, in both ie6 and ie7. I haven't gotten around to filing a bug report yet or to even see if I'm making incorrect assumptions...but I did find a work-around by using attr() and the regular getElementByID: var nextInput = (possInput.size()0) ? possInput.attr('id') : $ (ele).parent().parent().next().find('input').attr('id') var moveTo = document.getElementById(nextInput); moveTo.focus(); } Bearing in mind that each element you're searching for would need an id (or a class, if you used .attr(class)). I'm hoping the first one works for you because I think the second one is cheating, like running out of bounds, behind the bench and back on the field to catch the touchdown pass. I'm sure you can modify to fit your needs. Eric On Jul 9, 8:22 pm, jmbJq [EMAIL PROTECTED] wrote: Been using jQuery for a while, but can't seem to figure this one out. What I want to do is get the next span element when someone clicks on the text inside the first span element. Then when someone clicks on the text in the second span element, get the next span, and so on. If someone clicks on the last span, it should not select any further span elements (i.e. it should not wrap back around to the first span). I've posted an example below. I've tried using the .next() function, but that only returns the very next element. I've also tried using .siblings(), but that gives me all of the siblings that are spans, not just the next one. One thing to keep in mind is that the actual page I am doing this on will have hundreds of these div sections, so accessing spans by ID is not useful. It needs to be able to programmatically find the next sibling span. html head titleTEST/title script type=text/javascript src=http://code.jquery.com/jquery- latest.pack.js/script script language=JavaScript $(function() { $('#span1').bind('click', function() { // GET THE NEXT SPAN HERE }); }); /script /head body div id=div1 span id=span1SOME TEXT/spanbr / a href=http://www.google.com;GOOGLE/abr / spanMORE TEXT/spanbr / divtextarea name=/textarea/div spanA LITTLE MORE TEXT/span /div /body /html
[jQuery] Re: allow no more than 3 checkboxes checked
On Jul 9, 11:32 pm, Sean Catchpole [EMAIL PROTECTED] wrote: $.fn.limit = function(n) { var self = this; this.click(function(){ return (self.filter(:checked).length=n); });} $(input:checkbox).limit(3); Ever the skeptic of code which looks too simple, i tried that out... it actually does work. Somehow. /me bows and scrapes, once again, to the elegance of jQuery.
[jQuery] Re: Is there a way to READ the $.ajax settings?
On Jul 10, 4:13 am, Sean Catchpole [EMAIL PROTECTED] wrote: I doubt it's documented, I just dug it our of the source (which is well documented). i was hoping to avoid using internal details (i.e., those not documented in the public APIs), but if it's unavoidable then... oh, well. Thanks again :).
[jQuery] announcement: jQuery-based generic board game interface
Hiya! The jQ site says that this list is the place to make announcements, so here it goes... The past couple of days i've been working on an application for playtesting new boardgames (a long-time hobby of mine), and it's now at a point where it mostly does what i want. With only about 175 lines of JS code (plus about 3 times that amount of HTML, PHP, and CSS), i'm still slapping my forehead over simple it is to do complex DOM-related tasks using jQuery. i didn't have to use the standard DOM API a single time, and had no problem finding a jQuery function to do everything i needed/wanted to do. Here it is, in any case: http://wanderinghorse.net/gaming/bpi/ (BPI is a working title meaning Boardgame Prototyping Interface) There are, of course, many more potential features to add, but it is currently suitable for its purpose: setting up and playtesting new boardgame designs without having to print out the boards and pieces. Caveat: it's only been tested in Firefox 2.0.0.4 and Konqueror 3.5.7, but it does not work 100% correctly in Konqueror because in jQ 1.1.3.1 the dblclick() callbacks are never triggered in that browser (a bug report has been filed). :D
[jQuery] Re: Syntactic sugar for checking whether an element exists
There's no reason at all to stick with .get(n) and .size() now that the array-like jQuery object allows the simpler and more efficient [n] and .length. I disagree. Whenever you need to sort the elements in an ul or something then you'll have to use the Array.sort() function, so you need to do $('ul li').get().sort(...). Here is an example of where I needed this functionality: http://bin.cakephp.org/view/1632218532 It's not a big deal that I have to call get(), but it would be a big problem if it wasn't there! That's a good point about .get() with no arguments - it gives you a genuine Array object which can be quite useful. But I don't think we disagree at all. I wasn't talking about .get() with no arguments, but rather .get(n) and .size(), which are just slower synonyms for [n] and .length. -Mike