[jQuery] Re: jquery.com and IE7
Hi Karl, thx for answer. I am using IE7 - Czech language version - all patch installed. screenshot: http://83.240.47.84/skyrace2/ie7_jquery.jpg On Jan 18, 3:51 am, Karl Swedberg k...@englishrules.com wrote: Hi Charlie, I'm not seeing the problem. It looks like there is some extra white space after method names, but it's certainly readable. Here is a screenshot: http://skitch.com/kswedberg/bbte7/jquery.com-in-ie7 Can you post a screenshot of what you're seeing, too, so I can try to diagnose the problem? Thanks, --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 6:27 PM, Charlie22 wrote: hi all, its only me or somebody has problem with jquery.com?? In IE7 I dont see after a few seconds white background and pages are unreadable. Only main page is working correctly. Thx for info
[jQuery] Re: jquery.com and IE7
just only notice, that before jQuery 1.3 realese it works fine also in my IE7 On Jan 18, 9:16 am, Charlie22 ch...@post.cz wrote: Hi Karl, thx for answer. I am using IE7 - Czech language version - all patch installed. screenshot:http://83.240.47.84/skyrace2/ie7_jquery.jpg On Jan 18, 3:51 am, Karl Swedberg k...@englishrules.com wrote: Hi Charlie, I'm not seeing the problem. It looks like there is some extra white space after method names, but it's certainly readable. Here is a screenshot: http://skitch.com/kswedberg/bbte7/jquery.com-in-ie7 Can you post a screenshot of what you're seeing, too, so I can try to diagnose the problem? Thanks, --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 6:27 PM, Charlie22 wrote: hi all, its only me or somebody has problem with jquery.com?? In IE7 I dont see after a few seconds white background and pages are unreadable. Only main page is working correctly. Thx for info
[jQuery] jQuery doesn't like being put inside a parent div in Internet Explorer
Hello all, I have a weird problem. I put a container div around the html for a kwicks style navigation bar and a Cycle Plugin slideshow which are both being powered by jquery scripts. It works fine when I look at it in Firefox, but when I look at it Internet Explorer, the navigation bar isn't where it is supposed to be and the slideshow isn't even showing up. 1. This is the page with the container div around the rest of my html code that doesn't look the same in Internet Explorer - http://www.idea-palette.com/testfolder/pagetest2.html 2. This is the page where I removed the container div and the page looks exactly identical in Internet Explorer - http://www.idea-palette.com/testfolder/pagetest2noparentdiv.html I would really like to use a container div, so can you please help me out? Thanks! -Chris -- View this message in context: http://www.nabble.com/jQuery-doesn%27t-like-being-put-inside-a-parent-div-in-Internet-Explorer-tp21525543s27240p21525543.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
Although I love CSS, it is interesting how it leads to some of the same spaghetti problems that people complained about by applying formatting to html. I try to keep my CSS to a minimum but over time on a large site it can get quite messy. Most CSS guru's relate their CSS to little blogs or wiki's versus a large content site.
[jQuery] Re: How select first link??
Karl, thanks for the update. So I guess we all should wait for jQuery 1.3.1 Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 7:26 AM, Karl Swedberg k...@englishrules.com wrote: For those who don't follow the dev list, John replied there. It turns out there was another ticket filed for the same bug, and he has already taken care of it: Yep - that's a duplicate of #3873 and has already been fixed! http://dev.jquery.com/ticket/3873 --Karl On Jan 17, 2009, at 5:31 PM, Karl Swedberg wrote: Hi Nic, No worries. You're right about :first-child. Ricardo, I have no idea why it wasn't caught in the test suite. Seems like another handful of tests are warranted. I posted a message on the dev list, pointing to this thread and the bug ticket, so hopefully John can get it taken care of for 1.3.1. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 17, 2009, at 4:19 PM, Nic Luciano wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.com wrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp://test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano wrote: That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.
[jQuery] Re: jquery.com and IE7
I have one question yet. Is possible use jquery.com design for Czech fan site or is there any terms of use? On Jan 18, 9:20 am, Charlie22 ch...@post.cz wrote: just only notice, that before jQuery 1.3 realese it works fine also in my IE7 On Jan 18, 9:16 am, Charlie22 ch...@post.cz wrote: Hi Karl, thx for answer. I am using IE7 - Czech language version - all patch installed. screenshot:http://83.240.47.84/skyrace2/ie7_jquery.jpg On Jan 18, 3:51 am, Karl Swedberg k...@englishrules.com wrote: Hi Charlie, I'm not seeing the problem. It looks like there is some extra white space after method names, but it's certainly readable. Here is a screenshot: http://skitch.com/kswedberg/bbte7/jquery.com-in-ie7 Can you post a screenshot of what you're seeing, too, so I can try to diagnose the problem? Thanks, --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 6:27 PM, Charlie22 wrote: hi all, its only me or somebody has problem with jquery.com?? In IE7 I dont see after a few seconds white background and pages are unreadable. Only main page is working correctly. Thx for info
[jQuery] Re: How select first link??
*http://tinyurl.com/8rwmkr* On Sat, Jan 17, 2009 at 11:09 PM, Charlie22 ch...@post.cz wrote: Hi all, I am playing with jQuery 1.3 and I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. My traditional way from jQuery 1.2.6 doesnt work now. ('#menu li a:first') Thx for help in advance. div id=container ul id=menu lia href=#Home/a/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div
[jQuery] Re: Need help with a Jquery toggle bug in my menu's
Tried on chrome and ie. Mouse was on first menu item while loading. Showed up and worked just fine afterwards. Try to clear your cache or something... maybe your browser is reading from the cache or like I once had this most stupid mistake of mine when I was correcting local file and refreshing my browser for the file on my server. Believe or not, I had to take a walk to notice the problem : Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Jan 12, 2009 at 11:03 PM, Ted theodorew...@gmail.com wrote: And here's the URL again: http://dl.getdropbox.com/u/21984/menu_test/menu_test.html On Jan 10, 11:56 am, jQuery Lover ilovejqu...@gmail.com wrote: I suggest you take the other way. We shall not forget about beloved CSS :) Try this: $(document).ready(function(){ $('#nav li') .bind('mouseenter mouseleave', function(){ $(this).toggleClass('menu-on'); }); }); In your CSS file add: #nav div{ display:none;} #nav .menu-on div{ display:block; } Drawback is if the user is on li while page is being he will not see the div at first. He will need to move his mouse out and then in. To workaround this problem we can add an extra .hover() event listener to li's ... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 10, 2009 at 9:12 PM, Ted theodorew...@gmail.com wrote: Sorry, very new to Jquery (and not that skilled at js to begin with). I think I follow what you are saying, but not having a good grasp of the jquery syntax, I'm not sure exactly how to properly execute. Here's what I came up with, but it's not working, so I know there's a problem somewhere, but am unable to fix:
[jQuery] Re: [treeview] Expand the trees on the image and no link
In fact I use the following BLUG-in: http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ It displays a treeview with each branch image (file and a +) and title. When you click on the image this place or the wind industry. That suits me. When you click on the title of this shipment on the link on the target. That suits me. By the time against clicking on the title or place this wind industry which does not suit me. So I would like to place the branch click on the image and not text. Click on the text should only call the request by the link. Thank you for your help.
[jQuery] Re: [jquery]Need help in Simple Jquery Function I develop for tabs
But I am continuously facing the issue with not just Mozilla, but even IE, Safari... Looks like I have missed on something... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of jQuery Lover Sent: Saturday, January 17, 2009 7:18 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: [jquery]Need help in Simple Jquery Function I develop for tabs I have just created html with your content and js. It works just fine. ALL tabs work fine... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sat, Jan 17, 2009 at 3:30 PM, Yuvraj Mathur sa...@spicyspy.com wrote: Hi, I am stuck up with this function to make simple Tabs. It works absolutely fine only with the first two tabs. Can someone please observe the code and reply the problem. Below d stands for the header(div) in which the links are, e for the targeted content(div), and f for the sequence number. script function TabTasTic(d,e,f){ $('#'+ d +' a').css({background: '#ff'}); $('#'+ e +' div').hide(); $('#'+ e +' div').eq(f).show(); $('#'+ d +' a').eq(f).css({background: '#00'}); } /script div class=header id=header a href=javascript:TabTasTic('header','content','0');Tab1/a a href=javascript:TabTasTic('header','content','1');Tab2/a a href=javascript:TabTasTic('header','content','2');Tab3/a a href=javascript:TabTasTic('header','content','3');Tab2/a /div div class=content id=content divT1/div divT2/div divT3/div divT4/div /div
[jQuery] Does jQuery support the postback?
Dears, what about postback? for example, in sorting feature of jQuery, if the end user changed the items using jQuery and the he posted back the aspx page, can i handle the new order in the server?
[jQuery] List Box | update image on change
Im sure this is probably very simple...like me :( I have been searching for hours now without any results I have a list box which displays an image when you select it all i want to do is update it to use jquery and also make it so i can use multiple list box's as currently anymore than one list box stops them all from working...I think it needs to be selector based? Here is the current code Im using !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head titleDynamic Update/title script language=javaScript type=text/javascript //![CDATA[ function update_picture(newimage) { document.picture_image.src = images/icons/ + newimage; } //]] /script /head bodyImages: select name=newpicture onchange=update_picture(this.options [selectedIndex].value); option selected=selectedSelect Image/option option value=arrow-down.pngarrow-down.png/option option value=arrow-up.pngarrow-up.png/option option value=back.pngback.png/option option value=blank.gifblank.gif/option /select img src=images/icons/default.png alt= name=pic_image border=0 id=picture_image / /body /html
[jQuery] List Box | update image on change
Im sure this is probably very simple...like me :( I have been searching for hours now without any results I have a list box which displays an image when you select it all i want to do is update it to use jquery and also make it so i can use multiple list box's as currently anymore than one list box stops them all from working...I think it needs to be selector based? Here is the current code Im using !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head titleDynamic Update/title script language=javaScript type=text/javascript //![CDATA[ function update_picture(newimage) { document.picture_image.src = images/icons/ + newimage; } //]] /script /head bodyImages: select name=newpicture onchange=update_picture(this.options [selectedIndex].value); option selected=selectedSelect Image/option option value=arrow-down.pngarrow-down.png/option option value=arrow-up.pngarrow-up.png/option option value=back.pngback.png/option option value=blank.gifblank.gif/option /select img src=images/icons/default.png alt= name=pic_image border=0 id=picture_image / /body /html
[jQuery] how to know about previously selected li
hi, i m adding a class(e.g tab-selected) in li when i click/select or hover the li, on hover the class is added and removed successfully. but now when i click any other li, class is added successfully, how can i remove the class which was added on previously selected li. how can i know which li was previously selected/clicked and now has lost the click event. thx
[jQuery] How to test Javascript code
Hi, Is there any web site where we can test our javscript code... that uses libraries like Jquery, Mootools, Dojo, etc... There use be a site... but I don't remember its address...
[jQuery] [jqModal] and accessibility issue(solved?)
i was looking how to do this in the html, you don't want ajax for this, because it loads the content later. i could not find it in the documentation(maybe i did not read well), how to let all content be accessible, so this is what is working for example: http://www.nabble.com/file/p21526243/code.html code.html -- View this message in context: http://www.nabble.com/-jqModal--and-accessibility-issue%28solved-%29-tp21526243s27240p21526243.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Disable dropdown when checkbox checked?
Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] animation question
I need an animation like show and hide but that only animates in width. I've tried animate but didn't work, to extend jQuery with an script, but it seems like that script didn't execute. The only way i've found is to extend but having the objects extended inside the jQuery.fn.extend(); I've seen in the jQuery script. That is not useful because I think it isn't the best way to do it, and in that case I can't use the script from google's api. Here it is the extension i've made (for jQuery 1.2.6, I don't know if it works in version 1.3): jQuery.fn.extend({showhor:function(speed,callback){return speed? this.animate({width:show},speed,callback):this.filter(:hidden).each (function() {this.style.display=this.oldblock||;if(jQuery.css(this,display) ==none){var elem=jQuery(+this.tagName+ /).appendTo (body);this.style.display=elem.css(display);if (this.style.display==none)this.style.display=block;elem.remove ();}}).end();},hidehor:function (speed,callback){return speed?this.animate ({width:hide},speed,callback):this.filter(:visible).each(function() {this.oldblock=this.oldblock||jQuery.css (this,display);this.style.display=none;}).end();}); Thanks in advance
[jQuery] way to identify if width of element was defined in percentage
Hi all, Is there a way to know if an element was defined in percentage and not in pixel? Thanks in advance, David
[jQuery] Re: Disable dropdown when checkbox checked?
I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function by the way i think the value of disabled is disabled Good Luck, David On Jan 18, 3:32 pm, Toaster mr.toas...@gmail.com wrote: Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] Re: Select links that end in .png, .jpg or .gif
If you want to be able to easily change the extension list, I suggest refactoring the whole thing : function getLinkExtensionsSelector(extensions) { return jQuery.map(extensions, function(ext){ return 'a[href$=.'+ext +']'; }).join(','); } var $links = jQuery('.post').find(getLinkExtensionsSelector(['png', 'gif', 'jpg'])); On Jan 17, 10:57 pm, Mike Alsup mal...@gmail.com wrote: variety, yes: $('.post a').filter('[href$=.png],[href$=.jpg],[href$=.gif]') On Jan 17, 7:02 pm, Karl Swedberg k...@englishrules.com wrote: On Jan 17, 2009, at 3:52 PM, Mike Alsup wrote: I use a light-box plugin on my website,http://www.FreeSoftwareWorkshop.com and I need to select the links that end in .png, .jpg or .gif. This is how I use the selector (it works only for .png): $(function(){ $(.post a[href$=.png]).lightBox({ }); }); Karl and Ricardo, Well played, my friends! :-) Although I half expect Klaus to come along and lay down a 20 char trump card! :-) Where are you, Klaus?
[jQuery] Re: How select first link??
The question on all of this is usage - and I don't know how clear it was stated. The selectors everyone has put up are valid, but not necessarily for the usage. I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. So the issue is to remove only the first link. $('#menu li:first a) will only select the anchor inside first list item. Perfect until you put home inside that with no link. Then nothing matches that criteria. $('#menu li a:first') matches up to the first anchor tag inside a li. http://test.learningjquery.com/selector-bug.html Proves the theory. If you did a selector of 'p' it would affect ALL of them, right? So there are 7 anchors in the first position of an li, and 0 in the second. Jquery 1.3 didn't create a bug - it fixed a selector problem. The only true selector is to use $('#menu a:first'). It will select the first anchor and only the first anchor. It all just problem with sloppy selectors in the past. They cleaned it up and got it right. I would suggest we make the adjustments. On Jan 17, 4:19 pm, Nic Luciano nic.luci...@gmail.com wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.comwrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp:// test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano wrote: That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.
[jQuery] Re: Disable dropdown when checkbox checked?
Hello david, Thank you for your reply. I've changed the if statement to .atrr('checked') like you mentioned. I am having one problem though, when I click the box, it changes its status back to default after executing the js. For example, I have an alert within the if statement.. when I check it for example, it stays checked just until I click ok on the alert then it goes back to unchecked. Have any idea on what is happening? On Jan 18, 11:59 am, david michaelg...@gmail.com wrote: I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function by the way i think the value of disabled is disabled Good Luck, David On Jan 18, 3:32 pm, Toaster mr.toas...@gmail.com wrote: Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] Re: How select first link??
Bah - I see they fixed it. You should not be able to select only one anchor tag in this instance using $('#menu li a:first') On Jan 18, 9:33 am, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: The question on all of this is usage - and I don't know how clear it was stated. The selectors everyone has put up are valid, but not necessarily for the usage. I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. So the issue is to remove only the first link. $('#menu li:first a) will only select the anchor inside first list item. Perfect until you put home inside that with no link. Then nothing matches that criteria. $('#menu li a:first') matches up to the first anchor tag inside a li.http://test.learningjquery.com/selector-bug.html Proves the theory. If you did a selector of 'p' it would affect ALL of them, right? So there are 7 anchors in the first position of an li, and 0 in the second. Jquery 1.3 didn't create a bug - it fixed a selector problem. The only true selector is to use $('#menu a:first'). It will select the first anchor and only the first anchor. It all just problem with sloppy selectors in the past. They cleaned it up and got it right. I would suggest we make the adjustments. On Jan 17, 4:19 pm, Nic Luciano nic.luci...@gmail.com wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.comwrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp:// test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano wrote: That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.
[jQuery] Re: Disable dropdown when checkbox checked?
Have no idea. Can you send the code ? On Jan 18, 4:35 pm, Toaster mr.toas...@gmail.com wrote: Hello david, Thank you for your reply. I've changed the if statement to .atrr('checked') like you mentioned. I am having one problem though, when I click the box, it changes its status back to default after executing the js. For example, I have an alert within the if statement.. when I check it for example, it stays checked just until I click ok on the alert then it goes back to unchecked. Have any idea on what is happening? On Jan 18, 11:59 am, david michaelg...@gmail.com wrote: I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function by the way i think the value of disabled is disabled Good Luck, David On Jan 18, 3:32 pm, Toaster mr.toas...@gmail.com wrote: Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] Re: Does jQuery support the postback?
Hi Can you explain this a bit more DO you want to resort the items after an asp.net postback or do you want to pas the sorting back to asp.net backend code On Sun, Jan 18, 2009 at 1:04 PM, Mostafa Absy wmosta...@gmail.com wrote: Dears, what about postback? for example, in sorting feature of jQuery, if the end user changed the items using jQuery and the he posted back the aspx page, can i handle the new order in the server? -- Armand Datema CTO SchwingSoft
[jQuery] Re: Does jQuery support the postback?
for example, in sorting feature of jQuery, if the end user changed the items using jQuery and the he posted back the aspx page, can i handle the new order in the server? No automatically... as there is no order data available on postback you'll have to make an AJAX call to update the order or figure out something with hidden fields holding the new order and then read it in your postback handler with Request.Form or the like
[jQuery] Newbie HELP: Page Fade out, then load new page and fade in without jump
Hi, excuse the ignorance i am not skilled in Javascript, and using jquery so i cannot read it. I have an urgent request as im working on a proposal and although i am not going to be using jquery i would very much like to use use a simple page fade out and then fade in the next page. I am fully aware of the power of jquery and love the effects and one day i will stick my head into some books but if anyone could help me out with this small request it would be very much appriciated. i found this script, and although it works it fades out and then fades in but it only does the animation on the first page rather than what i want it to do is fade out from index.html and fade into aboutus.html, im sure you experienced jquery uses will see the problem with the code i know why its happening but becuase i cannot read or write javacript i dont know where to start only seaching for scripts online. if anyone could help write or ammend the code i would be s happy and grateful Code: $(document).ready(function(){ jQuery('a').click(function(){ jQuery('#wrapper').fadeOut(); setTimeout(nav('+this.href+'),1000); return false; }); }); function nav(href){ location.href=href; } $(document).ready(function(){ jQuery('a').click(function(){ jQuery('#wrapper').fadeIn(); setTimeout(nav('+this.href+'),1500); return false; }); }); function nav(href){ location.href=href; }
[jQuery] Newbie HELP: Page Fade out, then nepage fade in without jump
Hi, excuse the ignorance i am not skilled in Javascript, and using jquery so i cannot read it. I have an urgent request as im working on a proposal and although i am not going to be using jquery i would very much like to use use a simple page fade out and then fade in the next page. I am fully aware of the power of jquery and love the effects and one day i will stick my head into some books but if anyone could help me out with this small request it would be very much appriciated. i found this script, and although it works it fades out and then fades in but it only does the animation on the first page rather than what i want it to do is fade out from index.html and fade into aboutus.html, im sure you experienced jquery uses will see the problem with the code i know why its happening but becuase i cannot read or write javacript i dont know where to start only seaching for scripts online. if anyone could help write or ammend the code i would be s happy and grateful $(document).ready(function(){ jQuery('a').click(function(){ jQuery('#wrapper').fadeOut(); setTimeout(nav('+this.href+'),1000); return false; }); }); function nav(href){ location.href=href; } $(document).ready(function(){ jQuery('a').click(function(){ jQuery('#wrapper').fadeIn(); setTimeout(nav('+this.href+'),1500); return false; }); }); function nav(href){ location.href=href; }
[jQuery] Re: script and strange behaviours with ie
up! thanks On 8 Gen, 07:18, Saledan bastil...@gmail.com wrote: up, please! thanks On 3 Gen, 11:50,Saledanbastil...@gmail.com wrote: Hi, yes i supposed that browsers older than ie6 are now unsupported by jQuery and web developers, i just play with those versions... the important issues are with ie 6 and 7. Yes, maybe the issue is with cache, but the strange thing is that the same image (the 9th image) into the grid (in both browser) showed in the original size.. Sure, you can show the test page athttp://www.sandolo.net/other/jbadge/ Many thanks for your help Max On 3 Gen, 01:01, Ricardo Tomasi ricardob...@gmail.com wrote: Forget browsers older than IE6, they are unsupported by jQuery (and ignored by most web developers). Your problem could be anything, do you have a test page we can take a look at, or some code? I guess it has to do with the ready/load events, as when you reload the page the images are in the browser cache already. On Jan 2, 3:20 pm,Saledanbastil...@gmail.com wrote: hello, I was sure that my script failed the ie execution test. IE7: activex and script check block the script, then allow and it works. IE6: it works IE5.5: my script waits the image loading with a animated gif, than show the images. This ie waits without end or errors. IE5, IE4: raise two errors on page loading. (I'm italian, try to translate the errors) ... first: Quantificator unexpected; second error: character not valid. IE7, IE6: the script works only the first time, with this script i align and resize 12 images on a grid. If I reload the page, one image (always the same image) doesn't resize, and i have to close the browser and reopen it. What can I do to solve these issues? ..in addiction to trash ie :P (The script works fine with Firefox and Safari) thanks max
[jQuery] Re: Disable dropdown when checkbox checked?
js: function stillWork(id) { if ($(id).attr('checked') == true) { alert('check'); } if ($(id).attr('checked') == false) { alert('uncheck'); } } - html: input id=still_working_1 name=still_working onclick='stillWork (#still_working_1); return false;' type=checkbox (theres more to the html but is this enough?) On Jan 18, 12:46 pm, david michaelg...@gmail.com wrote: Have no idea. Can you send the code ? On Jan 18, 4:35 pm, Toaster mr.toas...@gmail.com wrote: Hello david, Thank you for your reply. I've changed the if statement to .atrr('checked') like you mentioned. I am having one problem though, when I click the box, it changes its status back to default after executing the js. For example, I have an alert within the if statement.. when I check it for example, it stays checked just until I click ok on the alert then it goes back to unchecked. Have any idea on what is happening? On Jan 18, 11:59 am, david michaelg...@gmail.com wrote: I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function by the way i think the value of disabled is disabled Good Luck, David On Jan 18, 3:32 pm, Toaster mr.toas...@gmail.com wrote: Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] Asynchronous jQuery login form with PHP
Hello, I have just recently completed a blog system with PHP. I am now enhancing it with jQuery, but I have come across some problems. My login form is in a toggle div, so I submit the form info asynchronously to the db via jQuery and it's ajax features. However when I do this the form does everything correctly, and reloads the page...but for some reasons the sessions do not work, therefore you are not logged in. I have also noticed that a javascript reload will work with jQuery but an html meta refresh will not, does anyone know why this is? The code for my login form is this... ?php echo form name='loginsub' method='post' action='db.php'\n; echo Username input type='text' name='username' id='username' autocomplete='off' / \n; echo Password input type='password' name='password' id='password' autocomplete='off' / \n; echo input type='submit' value='Login' id='loginsubmit' /\n; echo /form\n; ? The code for db.php is this... ?php @include('connect.php'); $user = $_POST['username']; $pass = $_POST['password']; $pass = md5( $pass ); $passm = sha1( $pass ); $passn = md5( $passm ); $passo = sha1( $passn ); $passp = md5( $passo ); if($user $pass){ $sql = SELECT * FROM `users` WHERE `username`='$user'; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 1){ $epass = md5($pass); $sql2 =SELECT * FROM `users` WHERE `username`='$user' AND `password`='$passp'; $res2 = mysql_query($sql2) or die(mysql_error()); if(mysql_num_rows($res2) == 1){ //successful login echo Currently logging you in, $user\n; $row = mysql_fetch_assoc($res2); $_SESSION['uid'] = $row['id']; echo script type='text/javascript'setTimeout('location.reload (true)',3000)/script\n; //echo meta http-equiv='refresh' content='4' /\n; }else { echo bUsername or password incorrect/b\n; } }else { echo bUsername or password incorrect/b\n; } }else { echo bAll fields need to be filled in/b\n; } ? Then finally the jQuery for the form is this... $(function(){ $('#loginsubmit').click(function(){ var username = $('#username').val(); var password = $('#password').val(); $.ajax({ url: 'db.php', type: 'POST', data: 'username=' + username + 'password=' + password, success: function(result) { $('#response').remove(); $('#navloginf').fadeOut(slow); $('#nave').slideDown(fast); $('#nave').append('p id=response' + result + '/ p'); } }); return false; }); }); If anyone could help me out on why the sessions are not work, that would be very nice.
[jQuery] Re: Disable dropdown when checkbox checked?
Also, What I am currently doing is, I dynamically create groups of fields in my forms (which include the checkbox and dropdowns related to my question) using jQuery. Not sure if this has any relevancy to the question but yes On Jan 18, 1:38 pm, Toaster mr.toas...@gmail.com wrote: js: function stillWork(id) { if ($(id).attr('checked') == true) { alert('check'); } if ($(id).attr('checked') == false) { alert('uncheck'); } } - html: input id=still_working_1 name=still_working onclick='stillWork (#still_working_1); return false;' type=checkbox (theres more to the html but is this enough?) On Jan 18, 12:46 pm, david michaelg...@gmail.com wrote: Have no idea. Can you send the code ? On Jan 18, 4:35 pm, Toaster mr.toas...@gmail.com wrote: Hello david, Thank you for your reply. I've changed the if statement to .atrr('checked') like you mentioned. I am having one problem though, when I click the box, it changes its status back to default after executing the js. For example, I have an alert within the if statement.. when I check it for example, it stays checked just until I click ok on the alert then it goes back to unchecked. Have any idea on what is happening? On Jan 18, 11:59 am, david michaelg...@gmail.com wrote: I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function by the way i think the value of disabled is disabled Good Luck, David On Jan 18, 3:32 pm, Toaster mr.toas...@gmail.com wrote: Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] Re: animation question
You should be able to set up simple effects plugins like this: jQuery.fn.extend({ widthShow: function(speed, easing, callback) { return this.animate({width: 'show'}, speed, easing, callback); }, widthHide: function(speed, easing, callback) { return this.animate({width: 'hide'}, speed, easing, callback); }, widthToggle: function(speed, easing, callback) { return this.animate({width: 'toggle'}, speed, easing, callback); } }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 18, 2009, at 8:30 AM, Raúl Negueruela wrote: I need an animation like show and hide but that only animates in width. I've tried animate but didn't work, to extend jQuery with an script, but it seems like that script didn't execute. The only way i've found is to extend but having the objects extended inside the jQuery.fn.extend(); I've seen in the jQuery script. That is not useful because I think it isn't the best way to do it, and in that case I can't use the script from google's api. Here it is the extension i've made (for jQuery 1.2.6, I don't know if it works in version 1.3): jQuery.fn.extend({showhor:function(speed,callback){return speed? this .animate({width:show},speed,callback):this.filter(:hidden).each (function() {this.style.display=this.oldblock||;if(jQuery.css(this,display) ==none){var elem=jQuery(+this.tagName+ /).appendTo (body);this.style.display=elem.css(display);if (this.style.display==none)this.style.display=block;elem.remove ();}}).end();},hidehor:function (speed,callback){return speed?this.animate ({width :hide},speed,callback):this.filter(:visible).each(function() {this.oldblock=this.oldblock||jQuery.css (this,display);this.style.display=none;}).end();}); Thanks in advance
[jQuery] Re: How to test Javascript code
On Jan 18, 2009, at 8:14 AM, Yuvraj Mathur wrote: Hi, Is there any web site where we can test our javscript code... that uses libraries like Jquery, Mootools, Dojo, etc... There use be a site... but I don't remember its address... Try http://jsbin.com/ --Karl Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: how to know about previously selected li
You can know the previously selected/clicked li because it already has the class name. :) Just remove the class from that li first, then add it to the newly clicked li: $('li').click(function() { $('li.tab-selected').removeClass('tab-selected'); $(this).addClass('tab-selected'); }); --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jan 18, 2009, at 8:09 AM, CreativeMind wrote: hi, i m adding a class(e.g tab-selected) in li when i click/select or hover the li, on hover the class is added and removed successfully. but now when i click any other li, class is added successfully, how can i remove the class which was added on previously selected li. how can i know which li was previously selected/clicked and now has lost the click event. thx
[jQuery] Re: Disable dropdown when checkbox checked?
You have to return true. input id=still_working_1 name=still_working onclick='stillWork (#still_working_1); return true;' type=checkbox return false means don't do the change I don't like the way the javascript is written Use the bind function with the onchange (change event) and use in the callback the this value (read more in the internet and jquery documantation how to use it) Good Luck, David On Jan 18, 5:38 pm, Toaster mr.toas...@gmail.com wrote: js: function stillWork(id) { if ($(id).attr('checked') == true) { alert('check'); } if ($(id).attr('checked') == false) { alert('uncheck'); } } - html: input id=still_working_1 name=still_working onclick='stillWork (#still_working_1); return false;' type=checkbox (theres more to the html but is this enough?) On Jan 18, 12:46 pm, david michaelg...@gmail.com wrote: Have no idea. Can you send the code ? On Jan 18, 4:35 pm, Toaster mr.toas...@gmail.com wrote: Hello david, Thank you for your reply. I've changed the if statement to .atrr('checked') like you mentioned. I am having one problem though, when I click the box, it changes its status back to default after executing the js. For example, I have an alert within the if statement.. when I check it for example, it stays checked just until I click ok on the alert then it goes back to unchecked. Have any idea on what is happening? On Jan 18, 11:59 am, david michaelg...@gmail.com wrote: I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function by the way i think the value of disabled is disabled Good Luck, David On Jan 18, 3:32 pm, Toaster mr.toas...@gmail.com wrote: Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] Re: Disable dropdown when checkbox checked?
You have to return true. input id=still_working_1 name=still_working onclick='stillWork (#still_working_1); return true;' type=checkbox return false means don't do the change I don't like the way the javascript is written Use the bind function with the onchange (change event) and use in the callback the this value (read more in the internet and jquery documantation how to use it) Good Luck, David On Jan 18, 5:38 pm, Toaster mr.toas...@gmail.com wrote: js: function stillWork(id) { if ($(id).attr('checked') == true) { alert('check'); } if ($(id).attr('checked') == false) { alert('uncheck'); } } - html: input id=still_working_1 name=still_working onclick='stillWork (#still_working_1); return false;' type=checkbox (theres more to the html but is this enough?) On Jan 18, 12:46 pm, david michaelg...@gmail.com wrote: Have no idea. Can you send the code ? On Jan 18, 4:35 pm, Toaster mr.toas...@gmail.com wrote: Hello david, Thank you for your reply. I've changed the if statement to .atrr('checked') like you mentioned. I am having one problem though, when I click the box, it changes its status back to default after executing the js. For example, I have an alert within the if statement.. when I check it for example, it stays checked just until I click ok on the alert then it goes back to unchecked. Have any idea on what is happening? On Jan 18, 11:59 am, david michaelg...@gmail.com wrote: I am giving you general pointers to functions: use the bind function to registrar the checkbox for the onchange event in the callback function check if the checkbox is checked through the attr( 'checked' ) function by the way i think the value of disabled is disabled Good Luck, David On Jan 18, 3:32 pm, Toaster mr.toas...@gmail.com wrote: Hey I was wondering on how I might be able to have a checkbox that when checked or unchecked would disable or enable a dropdown. I am still very new to jQuery but this is what I have but doesnt work. function stillWork(id) { if ($(id).is(':checked')) { $(#work_month_end_1).attr(disabled, true); $(#work_year_end_1).attr(disabled, true); } if ($(id).not(':checked')) { $(#work_month_end_1).removeAttr(disabled); $(#work_year_end_1).removeAttr(disabled); } } I also experimented with a couple other ways and it usually gives me a problem where it automatically unchecks a box after checking it/ running the js. Thanks in advance
[jQuery] Re: animation question
Thanks that is working.
[jQuery] Re: way to identify if width of element was defined in percentage
You could try reading the styles directly (not getComputedStyle). Have a look at the document.styleSheets object, specifically its cssRules array. http://www.javascriptkit.com/domref/stylesheet.shtml On Sun, Jan 18, 2009 at 8:48 AM, david michaelg...@gmail.com wrote: Hi all, Is there a way to know if an element was defined in percentage and not in pixel? Thanks in advance, David
[jQuery] Re: jQuery doesn't like being put inside a parent div in Internet Explorer
Chris, I didn't look at the jQuery because you - First - may want to fix the (X)HTML/Transitional code for IE6. See - http://validator.w3.org/check?uri=http%3A%2F%2Fwww.idea-palette.com%2Ftestfolder%2Fpagetest2.html. |head| and |html| elements are showing XML Parsing Error: Opening and ending tag mismatch errors. Sean
[jQuery] Re: Asynchronous jQuery login form with PHP
where is your session implementation? have you remembered to use start in the the scripts called with ajax? are you changing session ids from page to page?
[jQuery] New jQuery Editable released.
You can check it here:http://plugins.jquery.com/project/Editable It's fully customizable: #1 Easy to use $('div.editable').editable(); #2 Submission can be set on any Event $('div.editable').editable({submitBy:'change'}); #3 Can use onSubmit and onEdit to define your own behavior. $('div.editable').editable(type:'select',options:{'a':'Item 1', 'b':'Item 2'},submit:'save',cancel:'cancel',onSubmit:endFunction); #4 Currently it convert tags to textbox, password, textarea, drop-down list. you can extend it by extending $.editFactory to support more tags. Check this website to find out more: http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin.html Find how to extend it: http://arashkarimzadeh.com/index.php/jquery/9-how-to-extend-jquery-editable.html
[jQuery] jBind (Bind Data to Template)
jBind is jQuery plugin for binding any complex data to templates in an easy way. By using $(template).bind(data) you can bind your data to the template. You can download it from jQuery website: http://plugins.jquery.com or directly from here: http://arashkarimzadeh.com/index.php/downloads.html?func=selectid=9 or you can find out more about jBind and download samples @ http://arashkarimzadeh.com/index.php/jquery/10-jbind-jquery-bind-template.html
[jQuery] Re: How select first link??
and how can you create selector for first link in this case?: div id='menu' ul liHome/li lia href=#Rules/a/li /ul /div On 18 Led, 15:35, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: Bah - I see they fixed it. You should not be able to select only one anchor tag in this instance using $('#menu li a:first') On Jan 18, 9:33 am, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: The question on all of this is usage - and I don't know how clear it was stated. The selectors everyone has put up are valid, but not necessarily for the usage. I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. So the issue is to remove only the first link. $('#menu li:first a) will only select the anchor inside first list item. Perfect until you put home inside that with no link. Then nothing matches that criteria. $('#menu li a:first') matches up to the first anchor tag inside a li.http://test.learningjquery.com/selector-bug.html Proves the theory. If you did a selector of 'p' it would affect ALL of them, right? So there are 7 anchors in the first position of an li, and 0 in the second. Jquery 1.3 didn't create a bug - it fixed a selector problem. The only true selector is to use $('#menu a:first'). It will select the first anchor and only the first anchor. It all just problem with sloppy selectors in the past. They cleaned it up and got it right. I would suggest we make the adjustments. On Jan 17, 4:19 pm, Nic Luciano nic.luci...@gmail.com wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.comwrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp:// test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano wrote: That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] rating using thumbs up thumbs down.
Hi, I am looking to implement a rating system using thumbs up thumbs down. So far with my search, I was able to find only star rating system. I would like to do the following thing: 1) Show two images(one for up and one for down). 2) when clicked, it has to store the count in the mysql db and show a message saying thanks and hide the images. 3) I like to have just four fields : 1) id 2) URL 3) UP 4) DOWN id - primary key URL - site for which it has been rated up -increase the count if this is clicked in any url where the script is implemented. down - increase the count if this is clicked in any url where the script is implemented Example: id | url | up | down 1abc.com 22 34 2example.com 10 6 Please let me know, if there is any plugin that already exists which I use to learn or how to do this. I am trying to avoid a page refresh so I prefer to just show the thanks message. I can explain it again, if this is not clear. thanks pragan
[jQuery] Re: How select first link??
i think jQuery('#menu li a').eq(0).remove(); or jQuery'(#menu li').eq(0).remove(); for valid html removing both the li and the link eq(number) is the position in the array of the selector. Hence 0 being first hope this helps On 1/18/09, Charlie22 ch...@post.cz wrote: and how can you create selector for first link in this case?: div id='menu' ul liHome/li lia href=#Rules/a/li /ul /div On 18 Led, 15:35, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: Bah - I see they fixed it. You should not be able to select only one anchor tag in this instance using $('#menu li a:first') On Jan 18, 9:33 am, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: The question on all of this is usage - and I don't know how clear it was stated. The selectors everyone has put up are valid, but not necessarily for the usage. I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. So the issue is to remove only the first link. $('#menu li:first a) will only select the anchor inside first list item. Perfect until you put home inside that with no link. Then nothing matches that criteria. $('#menu li a:first') matches up to the first anchor tag inside a li.http://test.learningjquery.com/selector-bug.html Proves the theory. If you did a selector of 'p' it would affect ALL of them, right? So there are 7 anchors in the first position of an li, and 0 in the second. Jquery 1.3 didn't create a bug - it fixed a selector problem. The only true selector is to use $('#menu a:first'). It will select the first anchor and only the first anchor. It all just problem with sloppy selectors in the past. They cleaned it up and got it right. I would suggest we make the adjustments. On Jan 17, 4:19 pm, Nic Luciano nic.luci...@gmail.com wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.comwrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp:// test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano wrote: That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that set, I am just following john Resig in twitter it seems he is going to release jquery 1.3.1 maybe he found some little bugs.- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] Need to know what jQuery plugin this is!
Hi, I need to find out what jQuery plugin is used on this site to move through the projects at the top of the site: http://yourfolio.themedemo.net/ When you click on view next project it brings up the next project without any refresh. Can anyone point me in the right direction? I don't see anything in the source that indicates what is being used.
[jQuery] Re: How select first link??
anz reason, why didnt you use #menu li a:first ? On 18 Led, 18:48, gareth gwyther gareth.gwyt...@gmail.com wrote: i think jQuery('#menu li a').eq(0).remove(); or jQuery'(#menu li').eq(0).remove(); for valid html removing both the li and the link eq(number) is the position in the array of the selector. Hence 0 being first hope this helps On 1/18/09, Charlie22 ch...@post.cz wrote: and how can you create selector for first link in this case?: div id='menu' ul liHome/li lia href=#Rules/a/li /ul /div On 18 Led, 15:35, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: Bah - I see they fixed it. You should not be able to select only one anchor tag in this instance using $('#menu li a:first') On Jan 18, 9:33 am, kellyjandr...@sbcglobal.net kellyjandr...@sbcglobal.net wrote: The question on all of this is usage - and I don't know how clear it was stated. The selectors everyone has put up are valid, but not necessarily for the usage. I have provlem with selecting a first link in code below. Can you help me how how it should look like jQuery code and also for case, if Home will not be a link, so Rules will be a first link. So the issue is to remove only the first link. $('#menu li:first a) will only select the anchor inside first list item. Perfect until you put home inside that with no link. Then nothing matches that criteria. $('#menu li a:first') matches up to the first anchor tag inside a li.http://test.learningjquery.com/selector-bug.htmlProves the theory. If you did a selector of 'p' it would affect ALL of them, right? So there are 7 anchors in the first position of an li, and 0 in the second. Jquery 1.3 didn't create a bug - it fixed a selector problem. The only true selector is to use $('#menu a:first'). It will select the first anchor and only the first anchor. It all just problem with sloppy selectors in the past. They cleaned it up and got it right. I would suggest we make the adjustments. On Jan 17, 4:19 pm, Nic Luciano nic.luci...@gmail.com wrote: Ah, Karl, I see the issue now. I was also confused with the original usage since the discussion was about :first but he was using :first-child. So let me ask, in your test, li a:first should only return one element (as per docs, :first should always only return one element), correct? And first-child would be what I originally expected (returning 7 links)? Can't believe I overlooked that- I stand corrected :D On Sat, Jan 17, 2009 at 4:13 PM, Ricardo Tomasi ricardob...@gmail.comwrote: I know this isn't the dev list, but I'm curious about how come these bugs weren't caught by the test suite? On Jan 17, 6:50 pm, Karl Swedberg k...@englishrules.com wrote: Nic, Actually, it is a bug, at least in the sense that the results are different from those of any previous version of jQuery. It isn't just about :first, though. It has to do with multiple- descendant selectors in general. I've provided a test case athttp:// test.learningjquery.com/selector-bug.html with side-by-side comparison of 1.2.6 and 1.3, showing the number of matches (and I also posted an update to the ticket). --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 3:39 PM, Nic Luciano wrote: That's true, but that's exactly how it's supposed to function. On Sat, Jan 17, 2009 at 3:35 PM, jQuery Lover ilovejqu...@gmail.com wrote: No he is not! Suppose you have this scenario: div id=container ul id=menu liHome/li lia href=#Rules/a/li lia href=#Pilots/a/li lia href=#Briefing/a/li lia href=#IGC/a/li lia href=#Results/a/li lia href=#Forum/a/li /ul /div $('#menu li:first a').remove() - will do nothing here, since first li has no anchor in it ! Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Sun, Jan 18, 2009 at 1:28 AM, Charlie22 ch...@post.cz wrote: Well, you are right, thx for explanation. Now it is clear!! On 17 Led, 21:04, Pedram pedram...@gmail.com wrote: hi Guys , I know what should you do , $('#menu li:first a').remove() this is the code you need , jquery has no problem when you use this code $('#menu li a:first').remove(); the selector checks each li and removes the a so all of the links will be removed so in your case your code should look like this $('#menu li:first a').remove(); the selector selects the first li and removes the a that
[jQuery] Re: How select first link??
had lots of trouble using #menu li a:first when i first started using jquery Outside of jquery use :first and :last are css3 pseudo selectors so im a little weary of using them. Strange i guess but i just don't like using those selectors sorry if i have caused any offense.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
Amen to that, JIMD. !important easily eliminates spaghetti problems, with 3rd-party components. (Although, i would counter that CSS applied judiciously, ESPECIALLY to very large sites, can vastly reduce the effort to apply global formats site-wide. But some CSS-fanatics say never, ever use inline-styling, which is fanatical.) UWE, using unique identifiers in the candy is not enough to isolate candy-html from your site-css: -unique identifiers mean that the candy-css will only affect the candy html, and not the rest of your site. that's a GOOD thing. -but your site-css, most-likely NOT using identifiers or classes in many places, will ALSO affect the candy-html, messing up the candy. BAD thing. RICARDO, I would not call this bad coding-- the main-site css rightfully assumes that it is the god-css for your site, so it should not have to bother with any kind of class=MyWebsite on every tag. But this does put the burden on the candy to insulate itself from the site-css. The combination of unique id's, classes, and !important does the trick.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
Sorry johnny, but you're the one who seems to not understand the nature of CSS. I'm pretty sure of my reasonings in this field ;) They're named **Cascading** Style Sheets for a reason. Third party CSS Candy that is supposed to be inserted in other's pages should be coded with this issue in mind, protecting all it's styles in it's own container, or writing styles in-line (if it's not meant to be altered). If this has not been done it is indeed badly written code. I realize you're not aware of the issues that arise from your solution. There is also a reason why !important is seldomly used: because it makes a mess of figuring out which style is being applied by overriding the cascading - eased by the use of firebug inspection or similar of course, but a mess nonetheless. The second suggestion you posted, surrounding the thing with a div and prepending the unique ID to every style is much better. Or putting in an in-line style tag, which overrides external stylesheets but without the mess of !important. That's what should have been done by the CSS author in the first place, with ID or classes. cheers, - ricardo ps: what does this have to do with jQuery? On Jan 18, 2:12 am, johny why johny...@gmail.com wrote: ricardo, no offense-- the only part of this thread you need to worry about is the first post: to insulate your 3rd-party candy (such as a suckerfish menu) from your site's css, globally replace: ; with !important; in the candy's css. that's it. the rest of this thread is geeks debating hypothetical scenarios and solutions, which beginners and people with hangovers can ignore ;)
[jQuery] Re: Need to know what jQuery plugin this is!
I need to find out what jQuery plugin is used on this site to move through the projects at the top of the site:http://yourfolio.themedemo.net/ When you click on view next project it brings up the next project without any refresh. Can anyone point me in the right direction? I don't see anything in the source that indicates what is being used. idTabs http://www.sunsean.com/idTabs/
[jQuery] Re: New jQuery Editable released.
and sign is not escaped properly... if you type hallo it doesn't show up after closing editable mode.. On 18 Jan., 17:45, a.karimzadeh a.karimza...@gmail.com wrote: You can check it here:http://plugins.jquery.com/project/Editable It's fully customizable: #1 Easy to use $('div.editable').editable(); #2 Submission can be set on any Event $('div.editable').editable({submitBy:'change'}); #3 Can use onSubmit and onEdit to define your own behavior. $('div.editable').editable(type:'select',options:{'a':'Item 1', 'b':'Item 2'},submit:'save',cancel:'cancel',onSubmit:endFunction); #4 Currently it convert tags to textbox, password, textarea, drop-down list. you can extend it by extending $.editFactory to support more tags. Check this website to find out more:http://arashkarimzadeh.com/index.php/jquery/7-editable-jquery-plugin Find how to extend it:http://arashkarimzadeh.com/index.php/jquery/9-how-to-extend-jquery-ed...
[jQuery] Re: Asynchronous jQuery login form with PHP
The session is started at the top of every page through this code at the top of the header... ?php session_start(); $session_name = $_SESSION['uid']; ?
[jQuery] [jCarousel] IE6 issue with jQuery 1.3
Hi, I need someone's help with jCarousel and the latest version of jQuery. I'm using jCarousel in combination with text messages in front of an image. I've tried to upgrade to jQuery 1.3, but the text disappears if I'm using Internet Explorer 6. What is the best way to start debugging this issue. Is there a good tool for IE which can help me? Thx, _Christoph
[jQuery] Ajax load not working with IE
Hi there, trying to load some asp pages w\using load and it works in FF and Chrome but not in IE (6 or 7). Is this a known problem or is there something up with my code? Thanx ahead of time pre $(document).ready(function() { $(#nouns).change(function() { //$(#loadermodifier).show(); $(#modifiers).load(includes/get_modifiers.asp,{noun: $ (#noun).val() }, function(){ $(#loadermodifier).hide(); }); }); $(#nouns).load(includes/get_nouns.asp, function(){ $ (#loadernoun).hide(); }); $(#uom).load(includes/read_uom.asp, function(){ $ (#loaderuom).hide(); }); });
[jQuery] Selector Help
I have a table structure with a multiple rows containing a checkbox input and 4 text inputs with distinct classes. I want to prefill two of the text inputs in the same row where the checkbox is checked. Example code for the first two rows: table tr id=row1 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr tr id=row2 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr /table I need help me crafting the correct selector to focus control onto the text input for the input with class=contact and class=email. I can write the function to manipulate the attributes but I can't figure out the selector. I haven't had any luck with prev ~ siblings or prev + next. Thanks in advance.
[jQuery] Re: A beautiful diagram
Thanks to all. I used RaphaelJS and I fount it very good.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
On 18 Jan., 19:16, Ricardo Tomasi ricardob...@gmail.com wrote: They're named **Cascading** Style Sheets for a reason. Third party CSS Candy that is supposed to be inserted in other's pages should be coded with this issue in mind, protecting all it's styles in it's own container, or writing styles in-line (if it's not meant to be altered). If this has not been done it is indeed badly written code. Inline styles are not a guarantee that a websites CSS would not cascade into that widget. Although inline styles have highest specificity, declarations with !important will still override those inline styles. They do not in IE but that is a different story. I realize you're not aware of the issues that arise from your solution. There is also a reason why !important is seldomly used: because it makes a mess of figuring out which style is being applied by overriding the cascading - eased by the use of firebug inspection or similar of course, but a mess nonetheless. I tend to agree. When I do write CSS I almost always try to avoid ! important and consider it bad practice. Most of the time it turned out to cause you more problems than do any good. I think the solution for a 3rd party widget though should be to use a unique identifier plus important declarations to 1. protect messing up the site's CSS where it's included in while 2. at the same time maintaining its own styles. Nevertheless there is no guarantee that the site's CSS will not override styles unless you use an iframe or object element to include that widget. --Klaus
[jQuery] Re: Selector Help
This is untested and just off the top of my head $(table tr[id^='row']).each(function () { $(this).find(td checkbox).click(function() { if ($(this).is(:checked) == true) { var $row = $(this).parent().parent(); //first is td, second is tr $row.find(input.contact).val(Your value here); $row.find(input.email).val(Your value here); } }); }); On Jan 18, 2:41 pm, LexHair jdpugl...@hotmail.com wrote: I have a table structure with a multiple rows containing a checkbox input and 4 text inputs with distinct classes. I want to prefill two of the text inputs in the same row where the checkbox is checked. Example code for the first two rows: table tr id=row1 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr tr id=row2 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr /table I need help me crafting the correct selector to focus control onto the text input for the input with class=contact and class=email. I can write the function to manipulate the attributes but I can't figure out the selector. I haven't had any luck with prev ~ siblings or prev + next. Thanks in advance.
[jQuery] Re: jquery.com and IE7
I found smtg strange. I tried to log to my PC under other account and with new user account IE7 works with jQuery.com fine. It seems there must smtg wrong with my account profile in WinXP, so definitelly its not problem by jQuery.com. On 18 Led, 10:38, Charlie22 ch...@post.cz wrote: I have one question yet. Is possible use jquery.com design for Czech fan site or is there any terms of use? On Jan 18, 9:20 am, Charlie22 ch...@post.cz wrote: just only notice, that before jQuery 1.3 realese it works fine also in my IE7 On Jan 18, 9:16 am, Charlie22 ch...@post.cz wrote: Hi Karl, thx for answer. I am using IE7 - Czech language version - all patch installed. screenshot:http://83.240.47.84/skyrace2/ie7_jquery.jpg On Jan 18, 3:51 am, Karl Swedberg k...@englishrules.com wrote: Hi Charlie, I'm not seeing the problem. It looks like there is some extra white space after method names, but it's certainly readable. Here is a screenshot: http://skitch.com/kswedberg/bbte7/jquery.com-in-ie7 Can you post a screenshot of what you're seeing, too, so I can try to diagnose the problem? Thanks, --Karl Karl Swedbergwww.englishrules.comwww.learningjquery.com On Jan 17, 2009, at 6:27 PM, Charlie22 wrote: hi all, its only me or somebody has problem with jquery.com?? In IE7 I dont see after a few seconds white background and pages are unreadable. Only main page is working correctly. Thx for info- Skrýt citovaný text - - Zobrazit citovaný text -
[jQuery] hover show: how to avoid looping?
I have a simple unordered list of links that I want to animate. But I can't remember how, using jQuery, I should ensure that the UL stays showing when I move the cursor over it. The problem is that I have position: relative on the container, and absolute on the UL (I need this for z-index purposes). So, when the UL appears, the container height does not change, given the UL is out of the page flow. div id=the_ul_container h6hover me/h6 ul id=the_ul li.../li /ul /div $('#the_ul_container') .show() .hover(function() { $('#the_ul').show('slow'); },function() { $('#the_ul').hide('fast'); }); When the cursor moves onto the UL, it begins toggling without letup. Is my best option to use setTimeout in the second function?
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
ricardo: what does this have to do with jQuery? --this topic is on the jquery forum, because problems with a jQuery component, Superfish, caused me to devise this method. The superfish support page directed me to this forum for support. the author of the plugin has not spoken up yet. (I imagine this technique might be useful for other jQuery candy.) Support for the Superfish plugin is available through the jQuery Mailing List. http://users.tpg.com.au/j_birch/plugins/superfish/#download Third party CSS Candy that is supposed to be inserted in other's pages should be coded with this issue in mind, protecting all it's styles in it's own container --i believe that's incorrect, if by container you mean unique classes and id's. as i describe above, unique id's will NOT protect the component's style from the main site-css, if the site-css cascades into the candy. Which is exactly what what messed up my superfish menu. writing styles in-line (if it's not meant to be altered). If this has not been done it is indeed badly written code. --i don't agree. one of the principals of best-practice web- styling is to NOT use inline styles, but to separate formatting out to a css file. that way, the web developer can tweak the formatting without touching the html structure. There is also a reason why !important is seldomly used: because it makes a mess of figuring out which style is being applied by overriding the cascading --i dont agree. the mess is what you have without !important. it instantly clears up that mess, because then you know exactly which css is controlling the candy-- the one with !important. override the cascading is exactly the benefit of using !important. The site-css was not designed to be compatible with your 3rd-party candy. i think the reason !important is seldom used, is because it's little- known, and because it's usually described as a way to resolve conflicts between web-page and browser-css (aka author vs user). prepending the unique ID to every style is much better. --Superfish does indeed use a unique ID. as Klaus points out, that does not insulate Superfish from the site-css. for me, the proof is in the pudding. My silverfish displayed all wrong without !important. It displays beautifully WITH !important. That's all the proof i need! klaus: a 3rd party widget...should...use...important declarations. Nevertheless there is no guarantee that the site's CSS will not override styles. --why? unless the site css ALSO uses !important, how else could it override the candy-css?
[jQuery] Re: Selector Help
This works and will take care of unchecked conditions too. $('table tr[id^=row] :checkbox').click(function(){ $$ = $(this); $text = $$.parent().parent().find('.email, .contact'); if($$.is(':checked')) { $text[0].value = 'Email Checked'; $text[1].value = 'Contact Checked'; } else $checkbox.val(''); }); On Jan 18, 11:41 am, LexHair jdpugl...@hotmail.com wrote: I have a table structure with a multiple rows containing a checkbox input and 4 text inputs with distinct classes. I want to prefill two of the text inputs in the same row where the checkbox is checked. Example code for the first two rows: table tr id=row1 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr tr id=row2 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr /table I need help me crafting the correct selector to focus control onto the text input for the input with class=contact and class=email. I can write the function to manipulate the attributes but I can't figure out the selector. I haven't had any luck with prev ~ siblings or prev + next. Thanks in advance.
[jQuery] Re: Selector Help
Oops, $checkbox.val(''); should be $text.val(''); On Jan 18, 1:23 pm, Kean shenan...@gmail.com wrote: This works and will take care of unchecked conditions too. $('table tr[id^=row] :checkbox').click(function(){ $$ = $(this); $text = $$.parent().parent().find('.email, .contact'); if($$.is(':checked')) { $text[0].value = 'Email Checked'; $text[1].value = 'Contact Checked'; } else $checkbox.val(''); }); On Jan 18, 11:41 am, LexHair jdpugl...@hotmail.com wrote: I have a table structure with a multiple rows containing a checkbox input and 4 text inputs with distinct classes. I want to prefill two of the text inputs in the same row where the checkbox is checked. Example code for the first two rows: table tr id=row1 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr tr id=row2 tdinput type=checkbox //td tdinput type=text class=email //td tdinput type=text class=contact //td tdinput type=text class=realname //td tdinput type=text class=sport //td /tr /table I need help me crafting the correct selector to focus control onto the text input for the input with class=contact and class=email. I can write the function to manipulate the attributes but I can't figure out the selector. I haven't had any luck with prev ~ siblings or prev + next. Thanks in advance.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
johny why: --why? unless the site css ALSO uses !important, how else could it override the candy-css? Depending on how the rest of the selectors are written, a Body ID will do overwrite it. Sean On Jan 18, 12:45 pm, johny why johny...@gmail.com wrote: ricardo: what does this have to do with jQuery? --this topic is on the jquery forum, because problems with a jQuery component, Superfish, caused me to devise this method. The superfish support page directed me to this forum for support. the author of the plugin has not spoken up yet. (I imagine this technique might be useful for other jQuery candy.) Support for the Superfish plugin is available through the jQuery Mailing List.http://users.tpg.com.au/j_birch/plugins/superfish/#download Third party CSS Candy that is supposed to be inserted in other's pages should be coded with this issue in mind, protecting all it's styles in it's own container --i believe that's incorrect, if by container you mean unique classes and id's. as i describe above, unique id's will NOT protect the component's style from the main site-css, if the site-css cascades into the candy. Which is exactly what what messed up my superfish menu. writing styles in-line (if it's not meant to be altered). If this has not been done it is indeed badly written code. --i don't agree. one of the principals of best-practice web- styling is to NOT use inline styles, but to separate formatting out to a css file. that way, the web developer can tweak the formatting without touching the html structure. There is also a reason why !important is seldomly used: because it makes a mess of figuring out which style is being applied by overriding the cascading --i dont agree. the mess is what you have without !important. it instantly clears up that mess, because then you know exactly which css is controlling the candy-- the one with !important. override the cascading is exactly the benefit of using !important. The site-css was not designed to be compatible with your 3rd-party candy. i think the reason !important is seldom used, is because it's little- known, and because it's usually described as a way to resolve conflicts between web-page and browser-css (aka author vs user). prepending the unique ID to every style is much better. --Superfish does indeed use a unique ID. as Klaus points out, that does not insulate Superfish from the site-css. for me, the proof is in the pudding. My silverfish displayed all wrong without !important. It displays beautifully WITH !important. That's all the proof i need! klaus: a 3rd party widget...should...use...important declarations. Nevertheless there is no guarantee that the site's CSS will not override styles. --why? unless the site css ALSO uses !important, how else could it override the candy-css?
[jQuery] Cycle Plugin - Animate slider to indicate current slide?
Hi everybody, I would like to create a slideshow with a vertical list of the slide navigation. I would like to smoothly animate a marker up and down to indicate the current slide. Here's what I have so far: $('#s1').cycle({ pager: '#nav', before: onBefore }); function onBefore() { var pos = $(.activeSlide).next().offset().top; //get position of the element *after* .activeSlide $(#marker).animate({top: pos}); //move marker to this position } This works fine for auto-playing. But once I click to navigate to different slide it slides to the wrong slides (not a big surprise since this function runs *before* the new .activeSlide class has been assigned) Any ideas? Thanks!
[jQuery] Cycle plugin prev/next question
The code shown below is working fine for me, but I want the prev and next buttons to jump 2 slides instead of 1. I think this involves the prevNextClick option, but don't know how to code it... script type=text/javascript $(function() { $('#liberiaSlideshow').cycle({ fx: 'fade', delay: 1000, speed: 'slow', timeout: 3600, timeoutFn: calculateTimeout, prev: '#prevButton', next: '#nextButton' }); }); Thanks!
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
On Jan 18, 6:45 pm, johny why johny...@gmail.com wrote: Third party CSS Candy that is supposed to be inserted in other's pages should be coded with this issue in mind, protecting all it's styles in it's own container --i believe that's incorrect, if by container you mean unique classes and id's. as i describe above, unique id's will NOT protect the component's style from the main site-css, if the site-css cascades into the candy. Which is exactly what what messed up my superfish menu. There's no difference between adding an unique ID or using important, it's just different specificity levels. !important won't protect the component's style either, undeclared styles will cascade anyway. What will protect the CSS is using widget-specific IDs and classnames, with a prefix or whatever, to lessen the chance of overriding it. It will never be fully protected. writing styles in-line (if it's not meant to be altered). If this has not been done it is indeed badly written code. --i don't agree. one of the principals of best-practice web- styling is to NOT use inline styles, but to separate formatting out to a css file. that way, the web developer can tweak the formatting without touching the html structure. I said if it's not meant to be altered. If it's a copy paste thing there's no harm. There is also a reason why !important is seldomly used: because it makes a mess of figuring out which style is being applied by overriding the cascading --i dont agree. the mess is what you have without !important. it instantly clears up that mess, because then you know exactly which css is controlling the candy-- the one with !important. override the cascading is exactly the benefit of using !important. The site-css was not designed to be compatible with your 3rd-party candy. i think the reason !important is seldom used, is because it's little- known, and because it's usually described as a way to resolve conflicts between web-page and browser-css (aka author vs user). It's not little known unless to those who are not web developers/ designers, that's basic stuff. If your widget declares !important on a common class name that is used elsewhere in your page, there goes your 'solution'. prepending the unique ID to every style is much better. --Superfish does indeed use a unique ID. as Klaus points out, that does not insulate Superfish from the site-css. Nothing will insulate it. You must have noticed that all of Superfish styles are prefixed by sf-. They will only be overriden if you're not sensible with your own CSS, I bet your page has lots of ID specified styles for containers. for me, the proof is in the pudding. My silverfish displayed all wrong without !important. It displays beautifully WITH !important. That's all the proof i need! Good to know. Just don't go out shouting that your solution is perfect for every situation - I'm sure you'll find that out by yourself. a 3rd party widget...should...use...important declarations. Nevertheless there is no guarantee that the site's CSS will not override styles. --why? unless the site css ALSO uses !important, how else could it override the candy-css? exactly. over and out, - ricardo
[jQuery] Re: jQuery in a Firefox Extension...
Anyone? I was looking forward to using jQuery in the extension but I might have to do without... :[ On Fri, Jan 16, 2009 at 3:47 PM, Nic Luciano nic.luci...@gmail.com wrote: Hm, that makes sense. So, I suppose I could do something like jQuery.noConflict(); var doc = window.content.document; jQuery(#id, doc); Which would solve the issue that jQuery doesn't live in the HTML anymore (and lives in the browser). But how would this work on .ajax functions? Do I have to edit the instantiation/references in the first couple lines of jQuery to point somewhere other than window? Or will functions like .ajax (that don't browse the DOM) only work when there is a document to access (as opposed to on load of Firefox)? Thanks- On Fri, Jan 16, 2009 at 9:29 AM, Eric Garside gars...@gmail.com wrote: I'm pretty sure the problem is that jQuery is defining itself in it's header section as something like window.jQuery = jQuery = $ or some such referential transitive equation strand. I'm not an expert at FF plugins, but I have gone through the motions of building one that modified current pages only. And to get to that page, you had to invoke a special call to get access to the current tabs current page html. I'd look into that, and get to the point where you can alert the innerHTML of a page element. That's how I first started to learn it. I just wish I hadn't already forgotten. :P On Jan 15, 11:37 pm, Nic nic.luci...@gmail.com wrote: It seems like this has been asked a million times, but nothing seems to answer my question. I include it in my .xul above my other scripts- (I checked the location and it's correct). It's the first time I've used jQuery in an extension, so I'm trying to run some commands on load just to see if it works. The following below throws no exceptions: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); } catch(e) { alert(e); } } Below I'll list a bunch of things I tried with their respective errors to maybe help give a glimpse into whats going on... What's going on here? I'm sure it's something obvious, or simple... The following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); alert(jQuery(body)); } catch(e) { alert(e); } } Throws: TypeError: n.find is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { $.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); } } Throws: TypeError: $.getJSON is not a function The Following: window.addEventListener(load, function() { init(); }, false) var init = function() { try { jQuery.noConflict(); jQuery.getJSON(http://www.google.com/;, function(data) { alert(data); }); } catch(e) { alert(e); }} Throws: TypeError: jQuery.getJSON is not a function Thanks, guys!
[jQuery] Re: rating using thumbs up thumbs down.
It's unlikely there's a plugin to do what you want to do since javascript is client side, and saving to any sort of database would require at least some web service. On Sun, Jan 18, 2009 at 12:46 PM, Pragan pragan...@gmail.com wrote: Hi, I am looking to implement a rating system using thumbs up thumbs down. So far with my search, I was able to find only star rating system. I would like to do the following thing: 1) Show two images(one for up and one for down). 2) when clicked, it has to store the count in the mysql db and show a message saying thanks and hide the images. 3) I like to have just four fields : 1) id 2) URL 3) UP 4) DOWN id - primary key URL - site for which it has been rated up -increase the count if this is clicked in any url where the script is implemented. down - increase the count if this is clicked in any url where the script is implemented Example: id | url | up | down 1abc.com 22 34 2example.com 10 6 Please let me know, if there is any plugin that already exists which I use to learn or how to do this. I am trying to avoid a page refresh so I prefer to just show the thanks message. I can explain it again, if this is not clear. thanks pragan
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
On 18 Jan., 21:45, johny why johny...@gmail.com wrote: a 3rd party widget...should...use...important declarations. Nevertheless there is no guarantee that the site's CSS will not override styles. --why? unless the site css ALSO uses !important, how else could it override the candy-css? Yes, that's exactly it. You obviously cannot prevent a site author to use !important as well and thus all I was saying is that - especially from the standpoint of the 3rd party developer - there is no guarantee the 3rd party's CSS will not be overridden unless an iframe is used for such widget. Yet another reason to avoid !important for your site - at least if you know you want to include 3rd party stuff. --Klaus
[jQuery] Re: Cycle Plugin - Animate slider to indicate current slide?
I would like to create a slideshow with a vertical list of the slide navigation. I would like to smoothly animate a marker up and down to indicate the current slide. Here's what I have so far: $('#s1').cycle({ pager: '#nav', before: onBefore }); function onBefore() { var pos = $(.activeSlide).next().offset().top; //get position of the element *after* .activeSlide $(#marker).animate({top: pos}); //move marker to this position } This works fine for auto-playing. But once I click to navigate to different slide it slides to the wrong slides (not a big surprise since this function runs *before* the new .activeSlide class has been assigned) onBefore is passed several arguments like this: function onBefore(currEl,nextEl,opts,fwd) { ... } currEl is the DOM element for the currently displayed slide nextEl is the DOM element for the 'about to be displayed' slide opts is Cycle's internal options object that stores the options you passed in along with current state. You can use the 'currSlide' and 'nextSlide' properties to determine the indexes of the curr and next elements. fwd is a flag. true if cycling forward, false for backwards. Mike
[jQuery] Re: Cycle plugin prev/next question
The code shown below is working fine for me, but I want the prev and next buttons to jump 2 slides instead of 1. I think this involves the prevNextClick option, but don't know how to code it... script type=text/javascript $(function() { $('#liberiaSlideshow').cycle({ fx: 'fade', delay: 1000, speed: 'slow', timeout: 3600, timeoutFn: calculateTimeout, prev: '#prevButton', next: '#nextButton' }); }); Hmm, this is a tough one. Cycle doesn't really do much to help you with this, other than exposing its internal state. Haven't tested this, but here's what I'd try: var cycleOpts; $('#prevButton').click(function() { var next, index = cycleOpts.currSlide; if (index == 0) next = cycleOpts.slideCount - 2; else if (index == 1) next = cycleOpts.slideCount - 1; else next = index - 2; $('#liberiaSlideshow').cycle(next); }); $('#nextButton').click(function() { var next, index = cycleOpts.currSlide; if (index == cycleOpts.slideCount - 1) next = 1; else if (index == cycleOpts.slideCount - 2) next = 0; else next = index + 2; $('#liberiaSlideshow').cycle(next); }); $('#liberiaSlideshow').cycle({ fx: 'fade', delay: 1000, speed: 'slow', timeout: 3600, timeoutFn: calculateTimeout, // prev: '#prevButton', // next: '#nextButton', before: onBefore }); function onBefore(curr,next,opts) { cycleOpts = opts; }
[jQuery] Re: How select first link??
You will need to not only remove the link, but the links parent, unless an empty LI is ok for you. On Jan 18, 1:02 pm, punkplod gareth.gwyt...@gmail.com wrote: had lots of trouble using #menu li a:first when i first started using jquery Outside of jquery use :first and :last are css3 pseudo selectors so im a little weary of using them. Strange i guess but i just don't like using those selectors sorry if i have caused any offense.
[jQuery] Re: Solution To Many Of Your CSS Nightmares!
ricardo, you're right that styles undeclared in the widget-css will cascade from the site-css into the widget, even if you use !important in the widget. that's an important point.
[jQuery] Validate: Validating an ajax loaded form
Greetings, I have been struggling with this for some time. The page uses: jquery 1.2.6 jquery.form.js jquery.validate.js I have a form which is generated like so: A. a user clicks on an image B. div containing image slides up (is hidden) C. a form (prepopulated with data by php from a mysql db) is loaded by a ajax (.load) into the area of the page The problem is that I cannot get the validate plugin to validate the dynamically loaded form (C). Obviously this form did not exist when the page was first loaded so I'm not even sure how/when/where to bind it to .validate. The rules and addmethods are fairly complex but, when I save the form as a static page, it validates fine. It just doesn't work when loaded into the page dynamically. The code is too long to post. I have tried the following (example) within the click event handler (A): $('#content').load(myscript.php,{ dataA: varA, dataB: varB}, function () { $(#myform).validate(); // I tried this too: $(#myform).validate().form(); }); I have googled a lot looking for an example like this, including the docs, or for a solution to my problem (error) but I am stuck on this one. I'm sure it's my lack of knowledge but any help appreciated. Thanks in advance
[jQuery] Re: jQuery doesn't like being put inside a parent div in Internet Explorer
Sean, I don't understand what that means. I did some googling on it and i found that it means the name of the starttag (the first some_name you find is not equal to the final end tag (the last /some_name you will find) you need to make them the same name. My html and head tags are named the same, so I am not sure what this means or why it's not making the jquery work in Internet Explorer. Can you please tell me what I can do to fix this problem? Thanks. -Chris wileyl...@gmail.com wrote: Chris, I didn't look at the jQuery because you - First - may want to fix the (X)HTML/Transitional code for IE6. See - http://validator.w3.org/check?uri=http%3A%2F%2Fwww.idea-palette.com%2Ftestfolder%2Fpagetest2.html. |head| and |html| elements are showing XML Parsing Error: Opening and ending tag mismatch errors. Sean -- View this message in context: http://www.nabble.com/jQuery-doesn%27t-like-being-put-inside-a-parent-div-in-Internet-Explorer-tp21525543s27240p21534530.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] calculating eq from index
hi, i have some images in a table. could the following be in the right direction of accessing the surrounding images of the one that gets hovered? $('.someclassname').hover(function(){ $('#somediv img:eq( (index(this))-1) ).animate({ width: 50px, height: 50px }, 500 ); }, function () { });
[jQuery] Re: jQuery doesn't like being put inside a parent div in Internet Explorer
Sean, I don't understand what that means. I did some googling on it and i found that it means the name of the starttag (the first some_name you find is not equal to the final end tag (the last /some_name you will find) you need to make them the same name. My html and head tags are named the same, so I am not sure what this means or why it's not making the jquery work in Internet Explorer. Can you please tell me what I can do to fix this problem? Thanks. -Chris Sean is referring to the fact that your markup is invalid (unclosed link tag): http://validator.w3.org/check?uri=http%3A%2F%2Fwww.idea-palette.com%2Ftestfolder%2Fpagetest2.htmlcharset=(detect+automatically)doctype=Inlinegroup=0 The bottom line though, is that IE is throwing a scripting error. You need to get that fixed. Do you have script debugging enabled? Don't you see the warning icon on the status bar?
[jQuery] Re: Rotating images AJAX like on a page
What's weird is that it acts like the image itself isn't even there in IE7. It displays 2 of the 7 images I have in the list. The others show up as red Xs in IE7. Has anyone seen anything like this using JQuery.innerfade? Chris On Jan 13, 11:16 am, Chris Stewart cstewart...@gmail.com wrote: I'm looking to produce functionality just like what's displayed here (http://medienfreunde.com/lab/innerfade/) in the A list with images and links section. I downloaded the JQuery plugin supplied but it was giving me problems with IE7. It worked fine with FF3 and Safari. So, does anyone know how I can replicate this using Rails and JQuery?
[jQuery] Re: jQuery doesn't like being put inside a parent div in Internet Explorer
I see the warning icon now. I just now enabled my script debugging and I see the Error message that appears: A Runtime Error has occurred. Do you wish to Debug? Line: 27, Error: Object doesn't support this property or method When I click on the Yes button to debug, nothing happens. I did some googling and I saw that Microsoft Script Editor is supposed to be opening up, but it doesn't happen. Do you know if there is some place where I can check if the Microsoft Script Editor is installed correctly? Is there some other Script Editing program I can use for this? What do I do after I get the Script Editing program to work? -Chris malsup wrote: Sean is referring to the fact that your markup is invalid (unclosed link tag): http://validator.w3.org/check?uri=http%3A%2F%2Fwww.idea-palette.com%2Ftestfolder%2Fpagetest2.htmlcharset=(detect+automatically)doctype=Inlinegroup=0 The bottom line though, is that IE is throwing a scripting error. You need to get that fixed. Do you have script debugging enabled? Don't you see the warning icon on the status bar? -- View this message in context: http://www.nabble.com/jQuery-doesn%27t-like-being-put-inside-a-parent-div-in-Internet-Explorer-tp21525543s27240p21535066.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Problems with the New API Browser - Bug in AIR APP
Ouch! Sorry about that. I didn't have time to add functionality that saved the window position - but when this is in (v. soon), I'll initialise the window at 640x480, then changing the window's position and size will be saved for the next time it's opened. Cheers, Remy. On Jan 17, 11:08 am, Giovanni Battista Lenoci gian...@gmail.com wrote: @rem I've tried contacting you on twitter, but I'm new to it, and don't know If you received my message. I've installed the AIR api browser, and I love it, but when I open it the dimensions of the windows are greater than my desktop resolution (1280x800 on windows xp). Here you can see a screenshot, hope you can fix it. http://lab.gianiaz.com/apibrowser.jpg (I can use it doing a dx click on the button on the taskbar and click on maximixe). Thank you. -- gianiaz.net - web solutions via angelo custode, 10 - 23100 sondrio (so) - italy +39 347 7196482
[jQuery] Re: jQuery doesn't like being put inside a parent div in Internet Explorer
I figured out what was causing the problem. There was something being referred to in the JS that was called container on Line 27, so I simply changed the name of the div. I am still somewhat puzzled on how to open the script editor or how to tell Internet Explorer which Script editing program to open. Do you know how to set that up? -- View this message in context: http://www.nabble.com/jQuery-doesn%27t-like-being-put-inside-a-parent-div-in-Internet-Explorer-tp21525543s27240p21535145.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: calculating eq from index
Hi Paul. Use each() to catch the image index. $('td img').each(function(i) { var indexHover = 'i' $(this).hover(function(){ $('td img').eq(i-1).animate({ width: 50px, height: 50px }, 500 ), function () { } }); }); Maurício -Mensagem Original- De: paul palkl...@gmail.com Para: jQuery (English) jquery-en@googlegroups.com Enviada em: domingo, 18 de janeiro de 2009 21:21 Assunto: [jQuery] calculating eq from index hi, i have some images in a table. could the following be in the right direction of accessing the surrounding images of the one that gets hovered? $('.someclassname').hover(function(){ $('#somediv img:eq( (index(this))-1) ).animate({ width: 50px, height: 50px }, 500 ); }, function () { });
[jQuery] $(selector).add($(.next))
Hello, Sorry about my grammar, English isn't my tang. How I add to $ the next elmement. Some think Like I can do: $(selector).add( $(selector).next) But I think that there is a better solution. Thank you.
[jQuery] Re: rating using thumbs up thumbs down.
hi, thanks for the reply. yeah I would need to use web service...but i am looking to use jquery to avoid the page refresh and also I found the jquery plug in for star rating system... please let me know if any one has any suggestion. regards pragan. On Jan 18, 5:03 pm, Nic Luciano nic.luci...@gmail.com wrote: It's unlikely there's a plugin to do what you want to do since javascript is client side, and saving to any sort of database would require at least some web service. On Sun, Jan 18, 2009 at 12:46 PM, Pragan pragan...@gmail.com wrote: Hi, I am looking to implement a rating system using thumbs up thumbs down. So far with my search, I was able to find only star rating system. I would like to do the following thing: 1) Show two images(one for up and one for down). 2) when clicked, it has to store the count in the mysql db and show a message saying thanks and hide the images. 3) I like to have just four fields : 1) id 2) URL 3) UP 4) DOWN id - primary key URL - site for which it has been rated up -increase the count if this is clicked in any url where the script is implemented. down - increase the count if this is clicked in any url where the script is implemented Example: id | url | up | down 1 abc.com 22 34 2 example.com 10 6 Please let me know, if there is any plugin that already exists which I use to learn or how to do this. I am trying to avoid a page refresh so I prefer to just show the thanks message. I can explain it again, if this is not clear. thanks pragan- Hide quoted text - - Show quoted text -
[jQuery] jQuery (English) superfish vertical navigation - replace list item with css rollover image
Hi, seeking some assistance with customising the superfish vertical navigation list. I've removed arrows, shadows etc. as I only need 1 additional popup menu on hovers and no other effects (I've applied an 80% transparency effect to the sub-menu list items, that's all). I am wondering how I would go about customising the css such that instead of the first list item showing text, I want it to have an image rollover using css, something similar to some tutorials I found: http://elliotjaystocks.com/blog/archive/2007/css-tutorial-better-nav-image-replacement/ I am hoping that since there are no ids attached to individual list items, I could use a li id=rollover or something similar to apply the effect without interfering with the rest of the superfish css... I hope I am not being too vague here, this is my first time using these groups so please tell me if I should direct my query elsewhere. I will have a play around as I only have a very basic knowledge of CSS but would welcome any suggestions from experts out there or indeed Mr Birch himself! Thanks in advance.
[jQuery] jQuery 1.3 and selector
Hi all, I'm using jQuery 1.3, and I'm having troubles with the selector : it only returns ONE element ! [code] div id=coucou div class=testbla/div div class=testbla/div div class=test2bla/div div class=testbla/div div class=test2bla/div div class=testbla/div div class=testbla/div div class=test2bla/div div class=testbla/div /div [/code] [code] var aSel = $(#coucou .test); log(aSel); // displays : Object length=1 prevObject=Object context=document aSel.css(background-color, 'red'); // Only the first div.test becomes red [/code] Do you have the same issue ? (you should...) How to fix it ? I searched the web but did not find the answer. Thanks all ! PS : I also posted this message on jqueryhelp.com forum -- View this message in context: http://www.nabble.com/jQuery-1.3-and-%22%3E%22-selector-tp21535798s27240p21535798.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] newby... cannot get $(div).length; to work
I have this test code. My alert dialog always show zero as the div count: Help !!! !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en-AU head titleJquery Test/title script type=text/javascript src=jquery-1.3.js/script script type=text/javascript var divcount = $(div).length; alert(start= + divcount); /script /head body div id=content div id=div2asdf/div div id=div2asdf/div /div /body /html
[jQuery] Re: $(selector).add($(.next))
The only alternative is $(selector).next().andSelf() On Jan 19, 12:08 am, Ami aminad...@gmail.com wrote: Hello, Sorry about my grammar, English isn't my tang. How I add to $ the next elmement. Some think Like I can do: $(selector).add( $(selector).next) But I think that there is a better solution. Thank you.
[jQuery] Re: jQuery 1.3 and selector
There is certainly something else, maybe bad mark-up or another script messing with jQuery. It's working fine as you can see at http://jsbin.com/ojito/ On Jan 18, 11:59 pm, lideln lid...@gmail.com wrote: Hi all, I'm using jQuery 1.3, and I'm having troubles with the selector : it only returns ONE element ! [code] div id=coucou div class=testbla/div div class=testbla/div div class=test2bla/div div class=testbla/div div class=test2bla/div div class=testbla/div div class=testbla/div div class=test2bla/div div class=testbla/div /div [/code] [code] var aSel = $(#coucou .test); log(aSel); // displays : Object length=1 prevObject=Object context=document aSel.css(background-color, 'red'); // Only the first div.test becomes red [/code] Do you have the same issue ? (you should...) How to fix it ? I searched the web but did not find the answer. Thanks all ! PS : I also posted this message on jqueryhelp.com forum -- View this message in context:http://www.nabble.com/jQuery-1.3-and-%22%3E%22-selector-tp21535798s27... Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: newby... cannot get $(div).length; to work
That's because the body of your page hasn't loaded yet at the time your script gets executed. Use this: script type=text/javascript $(document).ready(function(){ var divcount = $(div).length; alert(start= + divcount); }); /script This article explains what's going on: http://www.learningjquery.com/2006/09/introducing-document-ready On Jan 18, 11:45 pm, bartee bar...@gmail.com wrote: I have this test code. My alert dialog always show zero as the div count: Help !!! !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en-AU head titleJquery Test/title script type=text/javascript src=jquery-1.3.js/script script type=text/javascript var divcount = $(div).length; alert(start= + divcount); /script /head body div id=content div id=div2asdf/div div id=div2asdf/div /div /body /html
[jQuery] Re: Cycle and CSS
I have problems with the slideshow in div tags too. I have one site with the slideshow in a table and some of my problems worked themselves out. I have problems like yours. The slideshow doesn't go where I want it to. The CSS doesn't work as expected on the parent tags or child tags. On Dec 14 2008, 12:27 pm, turbodurso india...@gmail.com wrote: Quick layout question. My slides will not wrap inside its parent div. I've noticed thecycledemos are nested inside tables but is it possible to simply wrap them up inside a div? thanks
[jQuery] Re: newby... cannot get $(div).length; to work
The code is being run before the DIVs actually exist. You need to wrap the code in a ready event handler, like so: $(document).ready( function() { var divcount = $(div).length; alert(start= + divcount); }); Now the code will be run when the document (the HTML not images, etc) has finished loading and is ready. More info about the ready function/event here: http://docs.jquery.com/Events/ready#fn Karl Rudd On Mon, Jan 19, 2009 at 12:45 PM, bartee bar...@gmail.com wrote: I have this test code. My alert dialog always show zero as the div count: Help !!! !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en-AU head titleJquery Test/title script type=text/javascript src=jquery-1.3.js/script script type=text/javascript var divcount = $(div).length; alert(start= + divcount); /script /head body div id=content div id=div2asdf/div div id=div2asdf/div /div /body /html
[jQuery] Re: $(selector).add($(.next))
Thank you. This is exactly what I search. 10 Points :) On Jan 19, 4:45 am, Ricardo Tomasi ricardob...@gmail.com wrote: The only alternative is $(selector).next().andSelf() On Jan 19, 12:08 am, Ami aminad...@gmail.com wrote: Hello, Sorry about my grammar, English isn't my tang. How I add to $ the next elmement. Some think Like I can do: $(selector).add( $(selector).next) But I think that there is a better solution. Thank you.
[jQuery] Re: newby... cannot get $(div).length; to work
You can short it to: $(function() { var divcount = $(div).length; alert(start= + divcount); }); On Jan 19, 4:55 am, Karl Rudd karl.r...@gmail.com wrote: The code is being run before the DIVs actually exist. You need to wrap the code in a ready event handler, like so: $(document).ready( function() { var divcount = $(div).length; alert(start= + divcount); }); Now the code will be run when the document (the HTML not images, etc) has finished loading and is ready. More info about the ready function/event here: http://docs.jquery.com/Events/ready#fn Karl Rudd On Mon, Jan 19, 2009 at 12:45 PM, bartee bar...@gmail.com wrote: I have this test code. My alert dialog always show zero as the div count: Help !!! !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en-AU head titleJquery Test/title script type=text/javascript src=jquery-1.3.js/script script type=text/javascript var divcount = $(div).length; alert(start= + divcount); /script /head body div id=content div id=div2asdf/div div id=div2asdf/div /div /body /html
[jQuery] Re: jQuery 1.3 and selector
Hi, thanks for the fast answer ! My menu bar does not work, and the basic example I gave you doesn't work either with jQuery 1.3, but they both work fine with jQuery 1.2.6. You think it's because my XHTML is invalid ? I think it will be hard to debug... I can't imagine why another script is messing with sizzle... ?? ricardobeat wrote: There is certainly something else, maybe bad mark-up or another script messing with jQuery. It's working fine as you can see at http://jsbin.com/ojito/ On Jan 18, 11:59 pm, lideln lid...@gmail.com wrote: Hi all, I'm using jQuery 1.3, and I'm having troubles with the selector : it only returns ONE element ! [code] div id=coucou div class=testbla/div div class=testbla/div div class=test2bla/div div class=testbla/div div class=test2bla/div div class=testbla/div div class=testbla/div div class=test2bla/div div class=testbla/div /div [/code] [code] var aSel = $(#coucou .test); log(aSel); // displays : Object length=1 prevObject=Object context=document aSel.css(background-color, 'red'); // Only the first div.test becomes red [/code] Do you have the same issue ? (you should...) How to fix it ? I searched the web but did not find the answer. Thanks all ! PS : I also posted this message on jqueryhelp.com forum -- View this message in context:http://www.nabble.com/jQuery-1.3-and-%22%3E%22-selector-tp21535798s27... Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/jQuery-1.3-and-%22%3E%22-selector-tp21535798s27240p21536253.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] $(' Expert jQuery JS synatx ' ).show
Sorry about my grammar, English isn't my lang. I am trying to write code like that: var expr=true,selector='div'; $(selector) (expr ? .next() : .before() ). show(); But it's not JS syntax. So how can I do it? I know,that I can do it like that: if (expr) $(selector)..before(),show() else $(selector).next().show() But I am trying to find a solution, that return a jQuery object. Thank you.