[jQuery] Re: I need a jsonp example
usually you should use $.getJSON when you need jsonp to get data from another domain On 3月3日, 上午8时17分, craigpierce craigpie...@gmail.com wrote: Hi All - I'm fairly new to jQuery, and totally new to jsonp. I would like to see an example of an $.ajax call using jsonp - as of right now, this is what I have tried (based on examples found via Google searches and the text description on the $.ajax page), but nothing fires any of the callbacks: One: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com, dataType: jsonp, data: jsonObj, error: function(){alert('bad');}, success:function(){alert('good');}, complete: function(){alert('foo');} }); } Two: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com, dataType: jsonp, jsonp:testCallback, data: jsonObj }); } function testCallback(){alert('foo');} Three: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com?testCallback=?, dataType: jsonp, data: jsonObj }); } function testCallback(){alert('foo');} Four: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com?callback=testCallback, dataType: jsonp, data: jsonObj }); } function testCallback(){alert('foo');} Any help would be much appreciated! Thanks!!!
[jQuery] Re: Show/Hide Menu
You might want to try .hover(): http://docs.jquery.com/Events/hover#overout - Jack Nic Hubbard wrote: I have a menu that is activated on mouseover a link. The menu is a hidden div which appears. My problem now is how to remove/hide that div when a user move their mouse off of the menu. I have tried adding a mouseout event to the div, but because there are child divs inside that div, any mousing over them hides the parent div as well, which I don't want. I only want it to hide if the mouse is outside the parent div, not anywhere within it. // - Show Artists Menu When Link moused over -- $('a#Artists').mouseover(function() { // Show Our Artists Box $('#artistsBox').fadeIn('slow'); });//end mouseover // - Add Stuff When Link moused over -- $('#artistsBox').mouseover(function() { // Add a mouse out on our box $('#artistsColumns').mouseout(function() { // Hide Our Artists Box $('#artistsBox').fadeOut('slow'); });//end mouseover });//end mouseover div id=artistsBox style=display:none; div id=artistsColumnslinks and stuff in here/div /div Because the mouseout event is attatched to artistsBox, mousing over artistsColumns hides the div as well, which I don't want. Any ideas?
[jQuery] Re: Superfish in IE6 showing strange left margin...
Hello Joel, Thanks for responding! Nope, it wasn't that although I can't believe I didn't remove those spaces during my debugging attempts. It's amazing what lack of sleep can do, eh? Upon revisiting, my now (slightly more) rested eyes noticed in Firebug the left margin gap in IE6 was being inherited from an earlier series of anchor styles, specifically one with margin-left:0.4em. It appears adding the following to my superfish.css file fixes it in IE6 and maintains the layout in all the other browsers I'm testing with: .sf-menu a, .sf-menu a:link, .sf-menu a:focus, .sf-menu a:active, .sf- menu a:hover, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/ color:white; margin-left:0.0em; padding-left:0.4em; } Thank you for all your time and effort creating and supporting a great plug-in. All the best, Jeffrey On Mar 2, 9:31 am, Joel Birch joeldbi...@gmail.com wrote: Hello, I really think that the space is caused by the space character you have between the opening li tag and the opening anchor tag. Let us know if removing this doesn't solve your issue. Joel Birch.
[jQuery] Job - Need help with treeview menu
Hi, is there somebody I can hire for helping setting up my treeview menu? Basically I have problem with setting the css right. Web: http://packpilot.s15312582.onlinehome-server.info/index.php?f=packpilot The icons are not at the right position and the menu is not correctly expanable. If you#re interested, please send me an email. Thanks!
[jQuery] Re: Moving from .get(xml file) to using .ajax
if the browser is caching the query, would appending a parameter containing a random number or some such to the end of the request stop that?
[jQuery] manipulation without script execution
How to use functions like .wrap() and .wrapInner() without of script execution? Example html: divdgbfsdfbdf/div script type=text/javascript src=http://site/js/jquery-1.3.2.js;/ script script type=text/javascript src=http://site/js/TEST.js;/ script // alert('test') script type=text/javascript $(function(){ alert('ready'); $('body').wrapInner('div/div'); }); /script result: alerts test, ready, ready, test should be: alerts test, ready
[jQuery] Re: New Downloaded jQuery result Error: $ is not defined !
recheck the url to your scripts. 2009/3/3 Marvix mavim...@gmail.com: I have the same problem !!! Any help !?!?! - Показать цитируемый текст - On Mar 1, 3:58 pm, Marvix mavim...@gmail.com wrote: I just downloaded the compressed uncompressed version ... I get always Error: $ is not defined and when I replaced with old version works fine! help?! -- Максим Игоревич Гришаев, AstroStar.ru
[jQuery] Re: Custom validation trigger
Maybe there is already a flag implemented in Validate? Thanks, Knal On Mar 2, 7:14 pm, knal knalp...@gmail.com wrote: I'll have to go with Jörn's answer, only it validates immediatey, not after submit has already been clicked once (and the entire Validation has already started) Should i se a flag or something, if yes, how? Thanks again, Knal On 2 mrt, 13:44, knal knalp...@gmail.com wrote: Great! Thanks for your fast reply. I will try it tonight. The reason why i need this, is that i'm trying to combine Validate with jNice. Thanks again, Knal On Mar 2, 1:35 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: You can use the valid-method to trigger the validation any time: $(#contact_form).valid(); Jörn On Mon, Mar 2, 2009 at 1:30 PM, knal knalp...@gmail.com wrote: Hi there, I have a form which is validated with the jQuery Validate PI. The JS roughly looks as follows: code var validator = $(#contact_form).validate({ rules: { name: { required: true } }, messages: { name: { required: Required field } }, errorElement: span }); $(.myClass).click(function(){ // validate but don't submit }); /code What i want with the extra function, is to validate the form, but don't submit it. So it will manage the error messages, but won't take any further action. Also, i only want it to validate on myClass.click after the user has already tried ti submit, just like Validate's default behaviour. Hope things are clear. Many thanks, Knal
[jQuery] Re: jQuery menu is flickering in IE
I've found a solution: use the hover function instead of mouseover/ mouseout. -- Scott. On Mar 2, 12:27 pm, RichUncleSkeleton scott.viv...@gmail.com wrote: Sample page:http://www.broburysports.com/sportsbook/faq The drop down menu at the top flickers in IE7 whenever you hover over a submenu. I saw from other threads about backgrund caching; I implemented the solution but it hasn't made a difference. And there's only one bg image that doesn't change (image or position). I've also changed the menu from using display block/none to using visibility, and tried adding/removing classes instead of setting inline styles. Anyone know what could be causing the flickering?
[jQuery] Integration of jQuery with website
I wanted to ask something in general. There seems to be a very slight issue with my website that is running the jQuery and plugin scripts. It seems that sometimes if you visit the website or click 'Home' to go back to the main page or view other sections, the browser loads the site very quickly and it muddles up how the website looks. It's like hanging divs on top of existing divs. It's not major and by using the browser to refresh the page, everything looks fine. Is there some sort of issue with this?
[jQuery] Re: Integration of jQuery with website
depends which plugins you're using or if you're specifying any inline JS, jquery alone won't do anything to your page without being told to. does sound like a CSS issue though. post a link to the site mate.
[jQuery] Re: Integration of jQuery with website
depends which plugins you're using or if you're specifying any other JS - jquery alone won't do anything to your page without being told to. post a link to the site mate.
[jQuery] Re: SIMPLE (newbie) selecting TDs
Thanks very much mkmanning -- I realise now that the scope of eq is the whole doc and nth-child is all n-th children of the parent. Sigh, one day I will see this stuff more quickly myself -- meantime, thanks again ^_^ -Alan On Mar 2, 11:01 pm, mkmanning michaell...@gmail.com wrote: $('.vfOptions tr td:nth-child(3)').addClass('status'); On Mar 2, 7:15 pm, alanfluff alan.c.bris...@googlemail.com wrote: Hi, I am embarrassed to say I can't find a way to select the third cell in each row of a table and add a class to it. I tried this: $('.vfOptions tr td').eq(2).addClass('status'); and it worked for the first row but not subsequent rows. So I tried this, thinking it was the correct construct perhaps $('.vfOptions tr td').(function() { $(this).eq(2).addClass('status'); }); but it failed to add class to any rows at all. I would be MOST grateful for any clues as to what I am doing wrong - thanks in advance in deed! Cheers, -Alan
[jQuery] Re: Replacing META REFRESH by AJAX , Loading and Post
No one? I thought this was a no brainer but i just can't get my head around it... May be I can try asking it a different way... Let's say I have a long process that takes 30 - 40 secs , I need to open a Loading overlay that displays an icon that it is processing and at the same time I need to check the server if it is ready to display. When rready, it needs to refresh the page to the new URL posted by the server. Thanks C -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Cyril Sent: March-02-09 9:22 PM To: jQuery (English) Subject: [jQuery] Replacing META REFRESH by AJAX , Loading and Post Hi, I'm trying replace a META REFRESH every 5 secs with AJAX. On Submit of the form, I'd like to trigger the process, and use SetInterval to check a URL whether it has finished. Right now, the trigger will call a program callEquifax, which will display a page with another META REFRESH until the program is ready to display a result where the META REFRESH URL is the final output. Now I'd like to replace this using AJAX, here's what Ive attempted below but I'm missing a way to analyse the URL, not the output html, and if I detect a change in the location.href. Bottomline, how can I modify it so that, on Submit: 1. It displays the Loading Icon 2. HTTP AJAX POST callEquifax 3. Check every 5 secs using AJAX to see if the process has ended, if not loop again. 4. Finally refresh the page to the new Page to show the output when it is ready to be displayed. Thanks Below is the snippet on where I am at... I was able to trigger the process, and I am trying to replace a META REFRESH URL $(function(){ $('#Submit').click(function(){ //Loading alert('AJAX Submit Function'); $('div id=overlay/').appendTo('body').fadeIn(500); $.ajax({ type: POST, url: /eDevScripts/MGrqispi101.dll, data: APPNAME=CreditAppPRGNAME=callEquifaxARGUMENTS=- A2408895331377327030220090 90018prgtype=ADDcustomerType= + $('#customerType').val()+ businessName= + $('#businessName').val() + fileNumber= + $('#fileNumber').val() + listSimilars= + $('#listSimilars').val() + firstName= + $('#firstName').val() + lastName= + $ ('#lastName').val() + dob= + $('#dob').val() + streetNo= + $('#streetNo').val() + streetName= + $('#streetName').val() + city= + $('#city').val() + province= + $('#province').val() + postalCode= + $('#postalCode').val() + phoneNumber= + $('#phoneNumber').val() + ext= + $('#ext').val(), success: function(htmlOutput){ alert(Please wait while we process the transaction! + htmlOutput); // Need a way to use SetInterval() } }); return false; }); });
[jQuery] .ajax doesn't execute success handler in IE7
I swear, I didn't change a thing when moving my site from my production work station to our server, but then, my IE 7 doesn't execute the $.ajax success handler all of a sudden? What the deuce? Something as simple as this: Code: function logOff() { $.ajax({ type: POST, url: /logoff.asp, success: function(msg){ alert(msg); } }); } doesn't do nything in IE7, but in all other browsers it works like a charm! Even if I add a cache-buster like math.random() = nothing! I can't imagine it beeing a server issue, but on the other hand DID the problem first occur when I moved it from my computer to my server.. UPDATE! It actually executes the ajax request, and does what logoff.asp should do, but the success function is never run... what the..?? :(
[jQuery] targeting superfish second level menu items
I am trying to implement a nav menu using the superfish plugin and everything is great except I would like to have a different background color/image for the drop down menu items and the top-level menu items. Right now this line: .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { background:url(../images/nav_hover_bg.png) repeat-x; outline:0; is fine for the top-level items but I want to use a different image for the second level items and I can't figure out the right way of targeting them. I thought something like: .sf-menu li li:hover, .sf-menu li li.sfhover, .sf-menu li a:focus, .sf- menu li a:hover, .sf-menu li a:active {background:red;} would work, but it didn't. Any help?
[jQuery] Reordering rows using JQuery
I have an aspx page that looks something like this: tr id=Row1 tdSome label/td tdSome complex control/td /tr tr id=Row2 tdSome label/td tdSome complex control/td /tr tr id=Row3 tdSome label/td tdSome complex control/td /tr As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database) How would I use JQuery/JS to accomplish this?
[jQuery] Creating a Google-more menu
The Google interfaces usually shows a small arrow that one can click to then display a div with some menu options in it. I like to create something like that. I have a none displayed div that'll then show when clicking on a link. But I then need to hide it when some other part of the page is clicked or a link in the actual div is clicked. How is this possible without having a event on the document that fires all the time. Please give me some examples. There can then be multiple show menu arrow on the same page. Thanks!
[jQuery] Re: Replacing META REFRESH by AJAX , Loading and Post
you wanna do something like this? function check(){ $.ajax({ ... success:function(){ f(checkCondition) { closeOverlay(); } else { setTimeout(check, 5000) } } }); } openOverlay(); check(); 2009/3/3 Cyril Wan cyr...@technicost.com: No one? I thought this was a no brainer but i just can't get my head around it... May be I can try asking it a different way... Let's say I have a long process that takes 30 - 40 secs , I need to open a Loading overlay that displays an icon that it is processing and at the same time I need to check the server if it is ready to display. When rready, it needs to refresh the page to the new URL posted by the server. Thanks C - Показать цитируемый текст - -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Cyril Sent: March-02-09 9:22 PM To: jQuery (English) Subject: [jQuery] Replacing META REFRESH by AJAX , Loading and Post Hi, I'm trying replace a META REFRESH every 5 secs with AJAX. On Submit of the form, I'd like to trigger the process, and use SetInterval to check a URL whether it has finished. Right now, the trigger will call a program callEquifax, which will display a page with another META REFRESH until the program is ready to display a result where the META REFRESH URL is the final output. Now I'd like to replace this using AJAX, here's what Ive attempted below but I'm missing a way to analyse the URL, not the output html, and if I detect a change in the location.href. Bottomline, how can I modify it so that, on Submit: 1. It displays the Loading Icon 2. HTTP AJAX POST callEquifax 3. Check every 5 secs using AJAX to see if the process has ended, if not loop again. 4. Finally refresh the page to the new Page to show the output when it is ready to be displayed. Thanks Below is the snippet on where I am at... I was able to trigger the process, and I am trying to replace a META REFRESH URL $(function(){ $('#Submit').click(function(){ //Loading alert('AJAX Submit Function'); $('div id=overlay/').appendTo('body').fadeIn(500); $.ajax({ type: POST, url: /eDevScripts/MGrqispi101.dll, data: APPNAME=CreditAppPRGNAME=callEquifaxARGUMENTS=- A2408895331377327030220090 90018prgtype=ADDcustomerType= + $('#customerType').val()+ businessName= + $('#businessName').val() + fileNumber= + $('#fileNumber').val() + listSimilars= + $('#listSimilars').val() + firstName= + $('#firstName').val() + lastName= + $ ('#lastName').val() + dob= + $('#dob').val() + streetNo= + $('#streetNo').val() + streetName= + $('#streetName').val() + city= + $('#city').val() + province= + $('#province').val() + postalCode= + $('#postalCode').val() + phoneNumber= + $('#phoneNumber').val() + ext= + $('#ext').val(), success: function(htmlOutput){ alert(Please wait while we process the transaction! + htmlOutput); // Need a way to use SetInterval() } }); return false; }); }); -- Максим Игоревич Гришаев, AstroStar.ru
[jQuery] Re: Reordering rows using JQuery
plugin http://tablesorter.com/docs/ Date: Mon, 2 Mar 2009 19:35:00 -0800 Subject: [jQuery] Reordering rows using JQuery From: sandeshm...@gmail.com To: jquery-en@googlegroups.com I have an aspx page that looks something like this: tr id=Row1 tdSome label/td tdSome complex control/td /tr tr id=Row2 tdSome label/td tdSome complex control/td /tr tr id=Row3 tdSome label/td tdSome complex control/td /tr As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database) How would I use JQuery/JS to accomplish this? _ All your Twitter and other social updates in one place http://clk.atdmt.com/UKM/go/137984870/direct/01/
[jQuery] Re: Creating a Google-more menu
myself, I would probably try and detect a mouseclick not on the more div, or when the more div is clicked, appends an trasparent overlay, above everything but the more div and when that is clicked, hide the more div and remove the overlay. Riri wrote: The Google interfaces usually shows a small arrow that one can click to then display a div with some menu options in it. I like to create something like that. I have a none displayed div that'll then show when clicking on a link. But I then need to hide it when some other part of the page is clicked or a link in the actual div is clicked. How is this possible without having a event on the document that fires all the time. Please give me some examples. There can then be multiple show menu arrow on the same page. Thanks!
[jQuery] Re: Replacing META REFRESH by AJAX , Loading and Post
You just gave me an idea on how to solve it... thanks I'll post it here when its done! -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of KidsKilla .grin! wuz here Sent: March-03-09 7:44 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Replacing META REFRESH by AJAX , Loading and Post you wanna do something like this? function check(){ $.ajax({ ... success:function(){ f(checkCondition) { closeOverlay(); } else { setTimeout(check, 5000) } } }); } openOverlay(); check(); 2009/3/3 Cyril Wan cyr...@technicost.com: No one? I thought this was a no brainer but i just can't get my head around it... May be I can try asking it a different way... Let's say I have a long process that takes 30 - 40 secs , I need to open a Loading overlay that displays an icon that it is processing and at the same time I need to check the server if it is ready to display. When rready, it needs to refresh the page to the new URL posted by the server. Thanks C - Показать цитируемый текст - -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Cyril Sent: March-02-09 9:22 PM To: jQuery (English) Subject: [jQuery] Replacing META REFRESH by AJAX , Loading and Post Hi, I'm trying replace a META REFRESH every 5 secs with AJAX. On Submit of the form, I'd like to trigger the process, and use SetInterval to check a URL whether it has finished. Right now, the trigger will call a program callEquifax, which will display a page with another META REFRESH until the program is ready to display a result where the META REFRESH URL is the final output. Now I'd like to replace this using AJAX, here's what Ive attempted below but I'm missing a way to analyse the URL, not the output html, and if I detect a change in the location.href. Bottomline, how can I modify it so that, on Submit: 1. It displays the Loading Icon 2. HTTP AJAX POST callEquifax 3. Check every 5 secs using AJAX to see if the process has ended, if not loop again. 4. Finally refresh the page to the new Page to show the output when it is ready to be displayed. Thanks Below is the snippet on where I am at... I was able to trigger the process, and I am trying to replace a META REFRESH URL $(function(){ $('#Submit').click(function(){ //Loading alert('AJAX Submit Function'); $('div id=overlay/').appendTo('body').fadeIn(500); $.ajax({ type: POST, url: /eDevScripts/MGrqispi101.dll, data: APPNAME=CreditAppPRGNAME=callEquifaxARGUMENTS=- A2408895331377327030220090 90018prgtype=ADDcustomerType= + $('#customerType').val()+ businessName= + $('#businessName').val() + fileNumber= + $('#fileNumber').val() + listSimilars= + $('#listSimilars').val() + firstName= + $('#firstName').val() + lastName= + $ ('#lastName').val() + dob= + $('#dob').val() + streetNo= + $('#streetNo').val() + streetName= + $('#streetName').val() + city= + $('#city').val() + province= + $('#province').val() + postalCode= + $('#postalCode').val() + phoneNumber= + $('#phoneNumber').val() + ext= + $('#ext').val(), success: function(htmlOutput){ alert(Please wait while we process the transaction! + htmlOutput); // Need a way to use SetInterval() } }); return false; }); }); -- Максим Игоревич Гришаев, AstroStar.ru
[jQuery] Re: Reordering rows using JQuery
If I understand your problem correctly, you don't need JQuery for this, you can just create rows dynamically on start. JQuery is needed only when you need to change sorting in the middle, using Ajax etc. Tablesorter doesn't sort as you want, it sorts like ORDER BY query in SQL. I recommend using Jquery Sortable (in JQuery-UI). Rasit 2009/3/3 spdude sandeshm...@gmail.com I have an aspx page that looks something like this: tr id=Row1 tdSome label/td tdSome complex control/td /tr tr id=Row2 tdSome label/td tdSome complex control/td /tr tr id=Row3 tdSome label/td tdSome complex control/td /tr As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database) How would I use JQuery/JS to accomplish this? -- M. Raşit ÖZDAŞ
[jQuery] Re: Wrapping tags that are not decendents
Thank you!
[jQuery] Re: .ajax doesn't execute success handler in IE7
Use Fiddler (http://www.fiddlertool.com) to see what IE is seeing as a response from the post On Mar 3, 5:36 am, Kasper kazz...@gmail.com wrote: I swear, I didn't change a thing when moving my site from my production work station to our server, but then, my IE 7 doesn't execute the $.ajax success handler all of a sudden? What the deuce? Something as simple as this: Code: function logOff() { $.ajax({ type: POST, url: /logoff.asp, success: function(msg){ alert(msg); } }); } doesn't do nything in IE7, but in all other browsers it works like a charm! Even if I add a cache-buster like math.random() = nothing! I can't imagine it beeing a server issue, but on the other hand DID the problem first occur when I moved it from my computer to my server.. UPDATE! It actually executes the ajax request, and does what logoff.asp should do, but the success function is never run... what the..?? :(
[jQuery] jQuery UI Question - Tool tip
Anyone know why the jQuery UI team didn't include a tooltip along with their library? Anyone have suggestions for a tool tip plug-in? Are there any tool tips out there that are compatible with the themeroller? Thanks, ~Todd http://web-rat.com/
[jQuery] Re: jQuery UI Question - Tool tip
My tooltip plugin: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ Karl's: http://plugins.learningjquery.com/cluetip/ Neither is ThemeRoller compatible jQuery UI will eventually include a tooltip plugin, its just not there, yet. See also http://jqueryui.pbwiki.com/Tooltip Jörn On Tue, Mar 3, 2009 at 2:47 PM, webRat web...@gmail.com wrote: Anyone know why the jQuery UI team didn't include a tooltip along with their library? Anyone have suggestions for a tool tip plug-in? Are there any tool tips out there that are compatible with the themeroller? Thanks, ~Todd http://web-rat.com/
[jQuery] Re: jQuery UI Question - Tool tip
Yeah, I just found the wiki via google search after I had posted. That sucks too as it's going to break the look/feel of a consistent theme. I guess I have nothing better to do with my day today than to fuddle with CSS. :D
[jQuery] Re: Show/Hide Menu
Thanks. This almost seems like it would work. But, since the element that the hover is added to, and the element that is shown are different, by the time you move your mouse from the hover element to the element that is shown, your mouse moves out of the first element, and the shown div disappears. Essentially it needs to have the functionality of css dropdowns: http://www.cssplay.co.uk/menus/final_drop.html They stay out there until your mouse moves off of them. On Mar 3, 12:14 am, Jack Killpatrick j...@ihwy.com wrote: You might want to try .hover():http://docs.jquery.com/Events/hover#overout - Jack Nic Hubbard wrote: I have a menu that is activated on mouseover a link. The menu is a hidden div which appears. My problem now is how to remove/hide that div when a user move their mouse off of the menu. I have tried adding a mouseout event to the div, but because there are child divs inside that div, any mousing over them hides the parent div as well, which I don't want. I only want it to hide if the mouse is outside the parent div, not anywhere within it. // - Show Artists Menu When Link moused over -- $('a#Artists').mouseover(function() { // Show Our Artists Box $('#artistsBox').fadeIn('slow'); });//end mouseover // - Add Stuff When Link moused over -- $('#artistsBox').mouseover(function() { // Add a mouse out on our box $('#artistsColumns').mouseout(function() { // Hide Our Artists Box $('#artistsBox').fadeOut('slow'); });//end mouseover });//end mouseover div id=artistsBox style=display:none; div id=artistsColumnslinks and stuff in here/div /div Because the mouseout event is attatched to artistsBox, mousing over artistsColumns hides the div as well, which I don't want. Any ideas?
[jQuery] Re: Two versions
Hi, Thanks for that! I had the latest of jQuery, and the one plug in stops working, while the other continued to work. The one plug in worked with version (as downloaded from their example) 1.2.3, but the other one stopped working with this version. HOWEVER, I have now fixed it by using v1.2.4, which both seem to work with. Thanks! =) On Mar 3, 2:02 am, James james.gp@gmail.com wrote: Try just using the latest version of jQuery for both plug-ins. The plug-ins (and its website) may not have been updated but may still work with the latest version of jQuery. If it doesn't work work, try removing some of the deprecated things like the @. Take a look at this page for some of the changes to jQuery 1.3:http://docs.jquery.com/Release:jQuery_1.3#Upgrading Maybe you're able to make an old plug-in work with some minor tweaks. :) On Mar 2, 2:40 pm, NeoPuma neop...@gmail.com wrote: Hi Guys I got a small problem. I've found two plug ins I want to use, but one is only compatable with version 1.3, and the other only with version v1.2.3. So, can any one suggest how to get around this - bearing in mind, I have no idea what I am actually doing in terms of writing jQuery. Thanks in advance Neo
[jQuery] Re: checkbox array
If you really need those brackets, just escape them with two backslashes: $('input[name=foo\\[\\]]:checked').length If you need them as a post query, just use : var $foos = $('input[name=foo\\[\\]]:checked'); var postQuery = $.param($foos); On Mar 2, 6:08 am, mklebel mkle...@gmail.com wrote: Been losing my hair on this. I'm trying to assign my checkbox array to a variable that I can send through a post. But I the variable 'tempy' is always undefined. I must be confused on how to reference an array, or maybe there is a better way to do this? js: var tempy = $('input[name=foo]:checked').val(); html: input type=checkbox name=foo[] value=klaybul1 / input type=checkbox name=foo[] value=klaybul2 / input type=checkbox name=foo[] value=klaybul3 / Thanks in advance!
[jQuery] Re: Reordering rows using JQuery
I dont want to sort the table. Rather, I want to reorder the tr based on a csv of the tr ids. This csv can be from the db, viewstate or session. I would rather not add the controls dynamically to the table as the rows have a lot of complicated custom controls and adding them dynamically may open up other issues with viewstate etc. On Mar 3, 7:02 am, Rasit OZDAS rasitoz...@gmail.com wrote: If I understand your problem correctly, you don't need JQuery for this, you can just create rows dynamically on start. JQuery is needed only when you need to change sorting in the middle, using Ajax etc. Tablesorter doesn't sort as you want, it sorts like ORDER BY query in SQL. I recommend using Jquery Sortable (in JQuery-UI). Rasit 2009/3/3 spdude sandeshm...@gmail.com I have an aspx page that looks something like this: tr id=Row1 tdSome label/td tdSome complex control/td /tr tr id=Row2 tdSome label/td tdSome complex control/td /tr tr id=Row3 tdSome label/td tdSome complex control/td /tr As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database) How would I use JQuery/JS to accomplish this? -- M. Raşit ÖZDAŞ
[jQuery] Re: Moving from .get(xml file) to using .ajax
It should, but this is going to be an ajax application in the end.. I need to constantly pull it and display it on one page every 15 seconds On Mar 3, 3:17 am, ryan.joyce...@googlemail.com ryan.joyce...@googlemail.com wrote: if the browser is caching the query, would appending a parameter containing a random number or some such to the end of the request stop that?
[jQuery] Re: .Change handler on Select element resets input Form
Solved it: Even though the original .change handler terminates with return false; The thread created for the AJAX call, does some UI work depending on the server response. If that work involves displaying some UI that requires user input, then this function must also terminate the Ajax thread with a return false; else this new input is interpreted by the browser and the input FORM that kicked off the .change handler is reset.
[jQuery] Re: [listnav] in Chrome
Excellent. Just implemented 2.0 into my test script and its practically instant. On Feb 23, 1:20 pm, Jack Killpatrick j...@ihwy.com wrote: Hi, I have a new rev of the listnav plugin almost ready for release. Do you want to give it a try and let me know if the issue has been resolved? If so, let me know and I'll get a copy to you. Thanks, Jack simshaun wrote: Using jQuery 1.3.1, This question refers to the ListNav plugin found here: http://www.ihwy.com/Labs/jquery-listnav-plugin.aspx I've got a fairly large dataset on my page consisting of ~1000 LI elements. Each letter of the alphabet contains ~40 LI elements. Each LI element contains a varying amount of chars, but lets say ~70 chars. In FF3, it takes about 3-4 seconds for the plugin to index the list. In IE7, it takes about 1 second. In IE6, it takes about 1 second. In Safari 3.1 Google Chrome, it takes about 14 seconds. Why does it take so long in Safari 3.1 Google Chrome? URL for testing:http://www.simshaun.com/listnav.php
[jQuery] Re: jQuery UI Question - Tool tip
By the way, I have a proof of concept themeRoller-ready clueTip on GitHub: http://github.com/kswedberg/jquery-cluetip/tree/ui It's currently unsupported (just a proof of concept), because it's a little kludgy with the rounded corner stuff. But it has worked in my testing, and it supports themeRoller scoping. Here is a quick demo I put together: http://plugins.learningjquery.com/cluetip/demo/ui.html Maybe that will do in a pinch. (I'm offline the rest of the day, so won't be able to reply anymore to this thread until late tonight.) --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 3, 2009, at 8:59 AM, Jörn Zaefferer wrote: My tooltip plugin: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ Karl's: http://plugins.learningjquery.com/cluetip/ Neither is ThemeRoller compatible jQuery UI will eventually include a tooltip plugin, its just not there, yet. See also http://jqueryui.pbwiki.com/Tooltip Jörn On Tue, Mar 3, 2009 at 2:47 PM, webRat web...@gmail.com wrote: Anyone know why the jQuery UI team didn't include a tooltip along with their library? Anyone have suggestions for a tool tip plug-in? Are there any tool tips out there that are compatible with the themeroller? Thanks, ~Todd http://web-rat.com/
[jQuery] Re: serialize array question for dynamic form
Wow... can't believe i didn't try that. thanks! On Mar 2, 4:22 pm, mkmanning michaell...@gmail.com wrote: You need a 'name' attribute on your inputs. On Mar 2, 3:56 pm, Matt matt.critch...@gmail.com wrote: Hi, If i create a dynamic form(requirement for a project) serializeArray() or serialize() doesn't seem to work. Is there any reason why this is? Here's a simple example. neither function returns anything. $(document).ready(function(){ var sform = $(form id='searchForm'/form); var box = $(input id='searchBox' type='text'/input); var button = $(input id='searchButton' type='submit' value='Search'/input); sform.append(box).append(button); $(body).append(sform); $(#searchButton).bind(click,function(){ handleSubmit(); return false; }); function handleSubmit(){ var formData = jQuery(:input).serialize(); alert(formData); } });
[jQuery] Background flash white briefly
I have a project where I am implementing the jQuery library, and I believe it is causing my body backgrounds to flash white very quickly from page to page (the entire site has the same image background). This only appears to be happening in Safari 3.2.1. The reason I believe it is jQuery is because I tested it with and without the library: when jQuery is removed, the backgrounds don't flash white at all, and behave how I expect them. Is there a solution to this problem?
[jQuery] slideToggle is jerky in Safari 3.2.1
I am using slideToggle and it performs perfectly in FF, IE67, and the new Safari 4. However, in Safari 3.2.1, the elements slide out, but it starts of with a quick jerk and then slides. Has anyone else run into this problem and found a solution? Thanks!
[jQuery] blockui plugin crash ie 6
html script type=text/javascript src=jquery.js/script script type=text/javascript src=jquery.blockui.js/script body Remove the table and it wont crash. table tr td script $.blockUI(); $.unblockUI(); /script /td /tr /table /body /html
[jQuery] Re: Moving from .get(xml file) to using .ajax
You're still going to run into the issue of caching for requests to the same URL, even using ajax. The usual solution, as Ryan suggested, is to append changing data to the querystring of the ajax request, usually in the form of a timestamp: the_querystring+new Date ().getTime() As of jQuery 1.2, it will do that for you if you set the 'cache' option in the ajax call to false. $.ajax({ type: POST, cache:false, URL: kprxy.php, Unless your URL is going to change for every request, you will probably want to add this. On Mar 3, 6:52 am, KrushRadio - Doc drega...@gmail.com wrote: It should, but this is going to be an ajax application in the end.. I need to constantly pull it and display it on one page every 15 seconds On Mar 3, 3:17 am, ryan.joyce...@googlemail.com ryan.joyce...@googlemail.com wrote: if the browser is caching the query, would appending a parameter containing a random number or some such to the end of the request stop that?
[jQuery] Re: checkbox array
You don't need to escape them, $('input:checkbox[name=foo[]]:checked').serialize() works as well. If you want the brackets instead of %5B%5D just use unescape: unescape($('input:checkbox[name=foo[]]:checked').serialize()); Either way it's ugly ;) On Mar 3, 6:47 am, dabear bjorni...@gmail.com wrote: If you really need those brackets, just escape them with two backslashes: $('input[name=foo\\[\\]]:checked').length If you need them as a post query, just use : var $foos = $('input[name=foo\\[\\]]:checked'); var postQuery = $.param($foos); On Mar 2, 6:08 am, mklebel mkle...@gmail.com wrote: Been losing my hair on this. I'm trying to assign my checkbox array to a variable that I can send through a post. But I the variable 'tempy' is always undefined. I must be confused on how to reference an array, or maybe there is a better way to do this? js: var tempy = $('input[name=foo]:checked').val(); html: input type=checkbox name=foo[] value=klaybul1 / input type=checkbox name=foo[] value=klaybul2 / input type=checkbox name=foo[] value=klaybul3 / Thanks in advance!
[jQuery] Re: Moving from .get(xml file) to using .ajax
Okay.. Thanks..I'll do that with the cache: false, thing. I still have the problem where it's not pulling the right data from the xml, as it used to before.. Any thoughts on that one, or if you can eyeball the second part of the code and let me know if there's something goofed? Thanks, Dan On Mar 3, 10:44 am, mkmanning michaell...@gmail.com wrote: You're still going to run into the issue of caching for requests to the same URL, even using ajax. The usual solution, as Ryan suggested, is to append changing data to the querystring of the ajax request, usually in the form of a timestamp: the_querystring+new Date ().getTime() As of jQuery 1.2, it will do that for you if you set the 'cache' option in the ajax call to false. $.ajax({ type: POST, cache:false, URL: kprxy.php, Unless your URL is going to change for every request, you will probably want to add this. On Mar 3, 6:52 am, KrushRadio - Doc drega...@gmail.com wrote: It should, but this is going to be an ajax application in the end.. I need to constantly pull it and display it on one page every 15 seconds On Mar 3, 3:17 am, ryan.joyce...@googlemail.com ryan.joyce...@googlemail.com wrote: if the browser is caching the query, would appending a parameter containing a random number or some such to the end of the request stop that?- Hide quoted text - - Show quoted text -
[jQuery] Re: Show/Hide Menu
Here's an example of a way to handle that: http://www.ihwy.com/Labs/demos/Current/image-hover-menu.aspx - Jack Nic Hubbard wrote: Thanks. This almost seems like it would work. But, since the element that the hover is added to, and the element that is shown are different, by the time you move your mouse from the hover element to the element that is shown, your mouse moves out of the first element, and the shown div disappears. Essentially it needs to have the functionality of css dropdowns: http://www.cssplay.co.uk/menus/final_drop.html They stay out there until your mouse moves off of them. On Mar 3, 12:14 am, Jack Killpatrick j...@ihwy.com wrote: You might want to try .hover():http://docs.jquery.com/Events/hover#overout - Jack Nic Hubbard wrote: I have a menu that is activated on mouseover a link. The menu is a hidden div which appears. My problem now is how to remove/hide that div when a user move their mouse off of the menu. I have tried adding a mouseout event to the div, but because there are child divs inside that div, any mousing over them hides the parent div as well, which I don't want. I only want it to hide if the mouse is outside the parent div, not anywhere within it. // - Show Artists Menu When Link moused over -- $('a#Artists').mouseover(function() { // Show Our Artists Box $('#artistsBox').fadeIn('slow'); });//end mouseover // - Add Stuff When Link moused over -- $('#artistsBox').mouseover(function() { // Add a mouse out on our box $('#artistsColumns').mouseout(function() { // Hide Our Artists Box $('#artistsBox').fadeOut('slow'); });//end mouseover });//end mouseover div id=artistsBox style=display:none; div id=artistsColumnslinks and stuff in here/div /div Because the mouseout event is attatched to artistsBox, mousing over artistsColumns hides the div as well, which I don't want. Any ideas?
[jQuery] How do I translate this in jQuery?
I've made various attempts at translating this into jQuery without success. I guess I'm just not sufficient enough in regular JS to make it work. It's working, but I'd like it to be written as much as possible in jQuery syntax. Would some please translatethe first three lines of this into jQuery for me? Thanks, Rick function getContentFromIframe(iFrameName) { var myIFrame = document.getElementById(iFrameName); var content = myIFrame.contentWindow.document.body(innerHTML); $('#myiFrame-content').append(content); -- My reading of history convinces me that most bad government results from too much government. - Thomas Jefferson
[jQuery] Re: [listnav] in Chrome
Great, glad to hear it and thanks for letting me know! - Jack simshaun wrote: Excellent. Just implemented 2.0 into my test script and its practically instant. On Feb 23, 1:20 pm, Jack Killpatrick j...@ihwy.com wrote: Hi, I have a new rev of the listnav plugin almost ready for release. Do you want to give it a try and let me know if the issue has been resolved? If so, let me know and I'll get a copy to you. Thanks, Jack simshaun wrote: Using jQuery 1.3.1, This question refers to the ListNav plugin found here: http://www.ihwy.com/Labs/jquery-listnav-plugin.aspx I've got a fairly large dataset on my page consisting of ~1000 LI elements. Each letter of the alphabet contains ~40 LI elements. Each LI element contains a varying amount of chars, but lets say ~70 chars. In FF3, it takes about 3-4 seconds for the plugin to index the list. In IE7, it takes about 1 second. In IE6, it takes about 1 second. In Safari 3.1 Google Chrome, it takes about 14 seconds. Why does it take so long in Safari 3.1 Google Chrome? URL for testing:http://www.simshaun.com/listnav.php
[jQuery] Re: Building Columns From A List Of Items
The division by 10 is your problem. Try: $(this).addClass(classNames[(i + 3) % 3]); On Tue, Mar 3, 2009 at 2:21 AM, Nic Hubbard nnhubb...@gmail.com wrote: I have a list of names wrapped in p tags that are sorted in alphabetical order. I am trying to build 3 even columns out of these. There are 63 items, so each column should have 21 items. I have a script that kind of works, but it is making my items out of order, as it is somehow grouping them in a strange way. var classNames = ['first', 'second', 'third']; $('#artistsColumns p').each(function(i){ var n = Math.floor(i/10) % 3; $(this).addClass(classNames[n]); }); // Now lets wrap those in some divs $('p.first').wrapAll('div class=colFirst/div'); $('p.second').wrapAll('div class=colSecond/div'); $('p.third').wrapAll('div class=colThird/div'); Basically each group of classes get wrapped with a column div, but, once of the columns is getting too many times and the items are getting the wrong classes. Also, how can I write this so that I can continue to add new items and it will keep my columns as even as possible?
[jQuery] Re: blockui plugin crash ie 6
That would be a problem with IE not with BlockUI as IE doesn't render tables until it hits the end of the table html wrapping the $.blockUI() call inside $(document).ready() should solve the issue, as it makes no sense to block the page until the DOM is ready On Mar 3, 11:26 am, lacroix1547 simon.lacr...@gmail.com wrote: html script type=text/javascript src=jquery.js/script script type=text/javascript src=jquery.blockui.js/script body Remove the table and it wont crash. table tr td script $.blockUI(); $.unblockUI(); /script /td /tr /table /body /html
[jQuery] Re: .ajax doesn't execute success handler in IE7
Try putting an 'error' callback function also into the ajax options to see if it's falling in there. Maybe something else is affecting it. Do you have any other ajax options set elsewhere on the script? On Mar 3, 3:37 am, MorningZ morni...@gmail.com wrote: Use Fiddler (http://www.fiddlertool.com) to see what IE is seeing as a response from the post On Mar 3, 5:36 am, Kasper kazz...@gmail.com wrote: I swear, I didn't change a thing when moving my site from my production work station to our server, but then, my IE 7 doesn't execute the $.ajax success handler all of a sudden? What the deuce? Something as simple as this: Code: function logOff() { $.ajax({ type: POST, url: /logoff.asp, success: function(msg){ alert(msg); } }); } doesn't do nything in IE7, but in all other browsers it works like a charm! Even if I add a cache-buster like math.random() = nothing! I can't imagine it beeing a server issue, but on the other hand DID the problem first occur when I moved it from my computer to my server.. UPDATE! It actually executes the ajax request, and does what logoff.asp should do, but the success function is never run... what the..?? :(
[jQuery] Re: I need a jsonp example
Here's an article from IBM I've Googled: http://www.ibm.com/developerworks/library/wa-aj-jsonp1/ I think it's fairly easy to understand and detailed. I think the difficult part of JSONP is that the jQuery docs does not show an example of how the server-side output is suppose to look like. On Mar 2, 10:13 pm, Charles Liu charles.li...@gmail.com wrote: usually you should use $.getJSON when you need jsonp to get data from another domain On 3月3日, 上午8时17分, craigpierce craigpie...@gmail.com wrote: Hi All - I'm fairly new to jQuery, and totally new to jsonp. I would like to see an example of an $.ajax call using jsonp - as of right now, this is what I have tried (based on examples found via Google searches and the text description on the $.ajax page), but nothing fires any of the callbacks: One: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com, dataType: jsonp, data: jsonObj, error: function(){alert('bad');}, success:function(){alert('good');}, complete: function(){alert('foo');} }); } Two: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com, dataType: jsonp, jsonp:testCallback, data: jsonObj }); } function testCallback(){alert('foo');} Three: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com?testCallback=?, dataType: jsonp, data: jsonObj }); } function testCallback(){alert('foo');} Four: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com?callback=testCallback, dataType: jsonp, data: jsonObj }); } function testCallback(){alert('foo');} Any help would be much appreciated! Thanks!!!
[jQuery] Re: Building Columns From A List Of Items
Should I keep the division by 10 on the Math function? On Mar 3, 10:08 am, brian bally.z...@gmail.com wrote: The division by 10 is your problem. Try: $(this).addClass(classNames[(i + 3) % 3]); On Tue, Mar 3, 2009 at 2:21 AM, Nic Hubbard nnhubb...@gmail.com wrote: I have a list of names wrapped in p tags that are sorted in alphabetical order. I am trying to build 3 even columns out of these. There are 63 items, so each column should have 21 items. I have a script that kind of works, but it is making my items out of order, as it is somehow grouping them in a strange way. var classNames = ['first', 'second', 'third']; $('#artistsColumns p').each(function(i){ var n = Math.floor(i/10) % 3; $(this).addClass(classNames[n]); }); // Now lets wrap those in some divs $('p.first').wrapAll('div class=colFirst/div'); $('p.second').wrapAll('div class=colSecond/div'); $('p.third').wrapAll('div class=colThird/div'); Basically each group of classes get wrapped with a column div, but, once of the columns is getting too many times and the items are getting the wrong classes. Also, how can I write this so that I can continue to add new items and it will keep my columns as even as possible?
[jQuery] Re: Reordering rows using JQuery
anyone? On Mar 3, 8:51 am, spdude sandeshm...@gmail.com wrote: I dont want to sort the table. Rather, I want to reorder the tr based on a csv of the tr ids. This csv can be from the db, viewstate or session. I would rather not add the controls dynamically to the table as the rows have a lot of complicated custom controls and adding them dynamically may open up other issues with viewstate etc. On Mar 3, 7:02 am, Rasit OZDAS rasitoz...@gmail.com wrote: If I understand your problem correctly, you don't need JQuery for this, you can just create rows dynamically on start. JQuery is needed only when you need to change sorting in the middle, using Ajax etc. Tablesorter doesn't sort as you want, it sorts like ORDER BY query in SQL. I recommend using Jquery Sortable (in JQuery-UI). Rasit 2009/3/3 spdude sandeshm...@gmail.com I have an aspx page that looks something like this: tr id=Row1 tdSome label/td tdSome complex control/td /tr tr id=Row2 tdSome label/td tdSome complex control/td /tr tr id=Row3 tdSome label/td tdSome complex control/td /tr As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database) How would I use JQuery/JS to accomplish this? -- M. Raşit ÖZDAŞ
[jQuery] Re: Reordering rows using JQuery
anyone? On Mar 3, 8:51 am, spdude sandeshm...@gmail.com wrote: I dont want to sort the table. Rather, I want to reorder the tr based on a csv of the tr ids. This csv can be from the db, viewstate or session. I would rather not add the controls dynamically to the table as the rows have a lot of complicated custom controls and adding them dynamically may open up other issues with viewstate etc. On Mar 3, 7:02 am, Rasit OZDAS rasitoz...@gmail.com wrote: If I understand your problem correctly, you don't need JQuery for this, you can just create rows dynamically on start. JQuery is needed only when you need to change sorting in the middle, using Ajax etc. Tablesorter doesn't sort as you want, it sorts like ORDER BY query in SQL. I recommend using Jquery Sortable (in JQuery-UI). Rasit 2009/3/3 spdude sandeshm...@gmail.com I have an aspx page that looks something like this: tr id=Row1 tdSome label/td tdSome complex control/td /tr tr id=Row2 tdSome label/td tdSome complex control/td /tr tr id=Row3 tdSome label/td tdSome complex control/td /tr As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database) How would I use JQuery/JS to accomplish this? -- M. Raşit ÖZDAŞ
[jQuery] Re: Building Columns From A List Of Items
On Tue, Mar 3, 2009 at 1:48 PM, Nic Hubbard nnhubb...@gmail.com wrote: Should I keep the division by 10 on the Math function? No, as i said, that's the problem. There's not only no need for it, but it's giving you results you don't want. Quick: what's zero divided by ten? And what's the remainder of that result divided by 3? This should help to illustrate what's going on: $('#artistsColumns p').each(function(i){ var d = Math.floor(i/10); var n = d % 3; $(this).html('strongd:' + d + ' n:' + n + '/strongbr /' + $(this).html()); $(this).addClass(classNames[n]); });
[jQuery] Re: How do I translate this in jQuery?
It seems that you are trying to insert the content of an existent iframe (name = iFrameName) into another empty iframe (id = myiFrame-content). Is it? If so, do the following: var content = $('iframe[name = iFrameName]').attr('src'); $('#myiFrame-content').attr('src', content); Excuse me if I misunderstood your question. Maurício -Mensagem Original- De: Rick Faircloth Para: jquery-en@googlegroups.com Enviada em: terça-feira, 3 de março de 2009 14:56 Assunto: [jQuery] How do I translate this in jQuery? I've made various attempts at translating this into jQuery without success. I guess I'm just not sufficient enough in regular JS to make it work. It's working, but I'd like it to be written as much as possible in jQuery syntax. Would some please translatethe first three lines of this into jQuery for me? Thanks, Rick function getContentFromIframe(iFrameName) { var myIFrame = document.getElementById(iFrameName); var content = myIFrame.contentWindow.document.body(innerHTML); $('#myiFrame-content').append(content); -- My reading of history convinces me that most bad government results from too much government. - Thomas Jefferson
[jQuery] - tableFormSynch if (Empty) {Error}
Nice plugin, I just want report a error if the list is empty, If you delete all itens, you cant add more itens anymore. I tried start from a empty list and same error, but I am still reading and studing this plugin. Congratulations Brian, Regards macm
[jQuery] Re: toggle a checkbox???
thanks for the reply! in fact thats exactly what i'm doing but accidentally omitted that event in my post. So the if statement is as good as it gets? is there a better jquery (more efficient) way of doing this? James-279 wrote: What you did looks fine if it only runs one on page load. Which means if you check/uncheck after the fact, nothing else will happen. If you want it to work dynamically, you have to attach an event to the checkbox. Maybe something like: $(input[name^=REQ_ACCT_LAB_]).click(function() { if ($(this).is(:checked)) { $(input[name=MY_CHK]).attr(checked,checked); } else { $(input[name=MY_CHK]).attr(checked,); } }); On Mar 2, 11:36 am, Jael jae...@yahoo.com wrote: Hi all, I am new to this forum and hope someone can direct me a little.. I have a checkbox that needs to be checked/unchecked under the following rules.. if any checkboxes with id like REQ_ACCT_LAB_ are checked, then check it if all of the checkboxes with id like REQ_ACCT_LAB_ are unchecked, then uncheck it. Is there a better way of doing this? heres my code: if ($(input[name^=REQ_ACCT_LAB_]).is(:checked)) { $(input[name=MY_CHK]).attr(checked,checked); } else { $(input[name=MY_CHK]).attr(checked,); } Thanks! -- View this message in context:http://www.nabble.com/toggle-a-checkboxtp22233470s27240p22233470 Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/toggle-a-checkboxtp22233470s27240p22315606.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: I need a jsonp example
James... thanks for posting that, great article explaining what's going on during that kind of call On Mar 3, 1:36 pm, James james.gp@gmail.com wrote: Here's an article from IBM I've Googled:http://www.ibm.com/developerworks/library/wa-aj-jsonp1/ I think it's fairly easy to understand and detailed. I think the difficult part of JSONP is that the jQuery docs does not show an example of how the server-side output is suppose to look like. On Mar 2, 10:13 pm, Charles Liu charles.li...@gmail.com wrote: usually you should use $.getJSON when you need jsonp to get data from another domain On 3月3日, 上午8时17分, craigpierce craigpie...@gmail.com wrote: Hi All - I'm fairly new to jQuery, and totally new to jsonp. I would like to see an example of an $.ajax call using jsonp - as of right now, this is what I have tried (based on examples found via Google searches and the text description on the $.ajax page), but nothing fires any of the callbacks: One: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com, dataType: jsonp, data: jsonObj, error: function(){alert('bad');}, success:function(){alert('good');}, complete: function(){alert('foo');} }); } Two: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com, dataType: jsonp, jsonp:testCallback, data: jsonObj }); } function testCallback(){alert('foo');} Three: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com?testCallback=?, dataType: jsonp, data: jsonObj }); } function testCallback(){alert('foo');} Four: function test(){ var jsonObj ={ dataOne: foo, dataTwo: foo, }; $.ajax({ type: GET, url: https:myurl.com?callback=testCallback, dataType: jsonp, data: jsonObj }); } function testCallback(){alert('foo');} Any help would be much appreciated! Thanks!!!
[jQuery] Re: Building Columns From A List Of Items
I understand now, and I appreciate your help. A new problem has arisen from this. It seems that this loops through elements grouped in 3, rather than apply the class for the first column first, then the second one. Here is what I mean. Say I have 9 p tags containing links. This is how the script writes the classes: p class=firstContent/p p class=secondContent/p p class=thirdContent/p p class=firstContent/p p class=secondContent/p p class=thirdContent/p p class=firstContent/p p class=secondContent/p p class=thirdContent/p So, when I group those by class name, and add a column div around them, they are completely out of their original order. What I really need to do is: p class=firstContent/p p class=firstContent/p p class=firstContent/p p class=secondContent/p p class=secondContent/p p class=secondContent/p p class=thirdContent/p p class=thirdContent/p p class=thirdContent/p This way, it will group them properly when I use the wrapAll function. Is there a way to do it this way? Thanks again for your help! On Mar 3, 11:02 am, brian bally.z...@gmail.com wrote: On Tue, Mar 3, 2009 at 1:48 PM, Nic Hubbard nnhubb...@gmail.com wrote: Should I keep the division by 10 on the Math function? No, as i said, that's the problem. There's not only no need for it, but it's giving you results you don't want. Quick: what's zero divided by ten? And what's the remainder of that result divided by 3? This should help to illustrate what's going on: $('#artistsColumns p').each(function(i){ var d = Math.floor(i/10); var n = d % 3; $(this).html('strongd:' + d + ' n:' + n + '/strongbr /' + $(this).html()); $(this).addClass(classNames[n]); });
[jQuery] Re: checkbox array
http://www.w3.org/TR/html401/interact/forms.html#adef-name-FORM This is still in use because it's the easiest/fastest way of getting an array with the selected options server-side. There is no simpler alternative. - ricardo On Mar 3, 12:53 am, mkmanning michaell...@gmail.com wrote: That argument's been raging for a while :) There appear to be two halves, those that say 'CDATA', so any text is OK, and those that read the next part of the spec For some HTML 4 attributes with CDATA attribute values, the specification imposes further constraints on the set of legal values for the attribute that may not be expressed by the DTD which is followed by id/name token restrictions, which I'll grant is poorly structured and open to debate. And then there's the third half that just says 'browsers allow it so who cares' :P rant CDATA means characters from the document character set, which includes tabs, spaces, character entities like copyright, ampersand, etc.; I suspect most people would probably be uncomfortable including them in an input's name attribute though. My main gripe with this still stands, and I'll try to articulate it better: I work primarily clientside, mostly writing JavaScript; I started as a designer, then went on to HTML and CSS, then to working on the server- side. I've written server-side code in Perl, Java, C# and Python, I work with different frameworks as a freelancer, very often RoR. (Fulltime I'm currently writing js in a .NET shop, although I have a niche position of building specialty apps in Python on appengine along with UI work). When I write a standards compliant, semantic XHTML page, I can drop it into a webapp in Python, post a form to the server and process the results, with no problems at all. I can take that exact same XHTML file and drop it in a webapp in a Java Servlet container and have it behave exactly the same, posting and processing on the server, with NO CHANGES to the markup. My contention is that (most) people aren't using attribute names on their inputs like name=foo[] because they like to; it is being imposed on them by the server-side framework they've chosen. Thus I stand by my original statement that ANY server side framework (and that includes frameworks developed for the languages I mentioned above), is deficient if it 'requires' the markup be structured a specific way. I've personally experienced developers using [] in a name, and then trying to access it with JavaScript, only to get tripped up by the fact that [] has a direct meaning in JavaScript; why make life harder if you don't have to? /rant I don't think this debate is going to end unless some new information comes to light, but in deference to keeping the topic of these posts to jQuery, I will promise to not bring this up again (nobody's giving me any nickels anyway). On Mar 2, 7:03 pm, Matt Kruse m...@thekrusefamily.com wrote: On Mar 2, 6:51 pm, mkmanning michaell...@gmail.com wrote: HTML 4 spec section 6.2 says, ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), colons (:), and periods (.). The NAME attribute is CDATA, not ID or NAME. http://lmgtfy.com/?q=name+attribute+cdata+id+token ;) Matt Kruse
[jQuery] Re: Show/Hide Menu
Yes! That is exactly what I was looking for! I have implemented it and it works perfectly, thank you! On Mar 3, 9:54 am, Jack Killpatrick j...@ihwy.com wrote: Here's an example of a way to handle that: http://www.ihwy.com/Labs/demos/Current/image-hover-menu.aspx - Jack Nic Hubbard wrote: Thanks. This almost seems like it would work. But, since the element that the hover is added to, and the element that is shown are different, by the time you move your mouse from the hover element to the element that is shown, your mouse moves out of the first element, and the shown div disappears. Essentially it needs to have the functionality of css dropdowns: http://www.cssplay.co.uk/menus/final_drop.html They stay out there until your mouse moves off of them. On Mar 3, 12:14 am, Jack Killpatrick j...@ihwy.com wrote: You might want to try .hover():http://docs.jquery.com/Events/hover#overout - Jack Nic Hubbard wrote: I have a menu that is activated on mouseover a link. The menu is a hidden div which appears. My problem now is how to remove/hide that div when a user move their mouse off of the menu. I have tried adding a mouseout event to the div, but because there are child divs inside that div, any mousing over them hides the parent div as well, which I don't want. I only want it to hide if the mouse is outside the parent div, not anywhere within it. // - Show Artists Menu When Link moused over -- $('a#Artists').mouseover(function() { // Show Our Artists Box $('#artistsBox').fadeIn('slow'); });//end mouseover // - Add Stuff When Link moused over -- $('#artistsBox').mouseover(function() { // Add a mouse out on our box $('#artistsColumns').mouseout(function() { // Hide Our Artists Box $('#artistsBox').fadeOut('slow'); });//end mouseover });//end mouseover div id=artistsBox style=display:none; div id=artistsColumnslinks and stuff in here/div /div Because the mouseout event is attatched to artistsBox, mousing over artistsColumns hides the div as well, which I don't want. Any ideas?
[jQuery] Re: Apply class to range of child elements
modulus in JS returns the remainder of the division - whatever is left that couldn't be divided returning an integer. 1/4 = 0.25 - 1%4 = 1 2/4 = 0.5- 2%4 = 2 3/4 == 0.75 - 3%4 == 3 4/4 == 1 - 4%4 == 0 5/4 == 1.25 - 5%4 == 1 6/4 == 1.5- 6%4 == 2 and so on... By using the modulus on the index you'll get an infinite sequence of 0,1,2,3 for example, which allows us to achieve the separation you wanted. This for example would recursively add one of four classes for every element: $('a').each(function(i){ var n = i % 4; $(this).addClass( n == 0 ? 'first' : n == 1 ? 'second' : n == 2 ? 'third' : n == 3 ? 'fourth' : ''); }); we just add var n = Math.floor(i/10) % 4; because you want four different classes for every 10 elements. We divide the index by 10, giving us 0.xx to 1 instead of 0 to 10, round that down and apply the modulus to see which class suits. As a last simple example, %2 can tell you which numbers are odd or even: 1%2 == 1 2%2 == 0 3%2 == 1 4%2 == 0 377%2 == 1 5666%2 == 0 Hope this is not too confusing! cheers, - ricardo On Mar 3, 12:21 am, Nic Hubbard nnhubb...@gmail.com wrote: Hi Ricardo, Could you explain why you did %4 for the n variable? On Feb 26, 12:16 pm, ricardobeat ricardob...@gmail.com wrote: I like it cleaner: $('a').each(function(i){ var n = Math.floor(i/10) % 4; $(this).addClass( n == 0 ? 'first' : n == 1 ? 'second' : n == 2 ? 'third' : n == 3 ? 'fourth' : ''); }); or var classNames = ['first', 'second', 'third', 'fourth']; $('a').each(function(i){ var n = Math.floor(i/10) % 4; $(this).addClass(classNames[n]); }); This also gives you support for infinite expansion. An index of 45 will evaluate to class 'first', 51 to 'second', 85 to 'first' again and so on. cheers, - ricardo On Feb 26, 6:29 am, mkmanning michaell...@gmail.com wrote: And just as an exercise, here's the 'jQuery' way chained: $('a').filter(':lt(10)').addClass('first').end().filter(':gt(9):lt (10)').addClass('second').end().filter(':gt(19):lt(10)').addClass ('third').end().filter(':gt(29)').addClass('fourth'); Not really any speed gain though. On Feb 26, 1:21 am, mkmanning michaell...@gmail.com wrote: It's possible. Here's a more traditional way: $('a').each(function(i,link){ if(i10){$(link).addClass('first');} else if (i9 i20){$(link).addClass('second');} else if (i19i30){$(link).addClass('third');} else if (i29i40){$(link).addClass('fourth');} }) Here's a more 'jQuery' way: $('a:lt(10)').addClass('first'); $('a:gt(9):lt(10)').addClass('second'); $('a:gt(19):lt(10)').addClass('third'); $('a:gt(29):lt(10)').addClass('fourth'); Which is better? The first takes a little over half as long as the second. On Feb 25, 10:45 pm, Nic Hubbard nnhubb...@gmail.com wrote: I have a list of links, around 40 of them. I want to apply classes to groups of them. So, items 1-10 I want to apply a class to, then 11-20, then 21-30 and 31-40, each of these groups should have their own class. Is something like this possible? I looked through the jQuery selectors and could not find a solution.
[jQuery] converting HTML to XML using jQuery
I have been struggling with trying to do the following... perhaps I am looking at it too hard since I have a feeling the solution is right in front of me (i hope). I have something like the following: div class=map div class=titleTitle/div div class=group Group Name 1 div class=groupGroup Name 1-1/div /div div class=group Group Name 2 div class=groupGroup Name 2-1/div /div /div I would like to turn this into XML, like: map titleTitle/title groupGroup Name 1 groupGroup Name 1-1/group /group groupGroup Name 2 groupGroup Name 2-1/group /group /map I have been trying using the .each() function but it doesn't seem to hold the context node (when my context is the .map node and I want to iterate the .group, it will iterate ALL of them, instead of the TWO directly under the .map element. I can brute force this with some recursion but I thought there must be a way to retain the context of the jQuery. Perhaps the .each way isn't the right approach? Thanks in advance.
[jQuery] Re: slideToggle is jerky in Safari 3.2.1
Looks like someone else had the same unresolved problem too: http://groups.google.com/group/jquery-en/browse_thread/thread/c929269adfd8ea99 On Mar 3, 8:22 am, marc0047 marc0...@gmail.com wrote: I am using slideToggle and it performs perfectly in FF, IE67, and the new Safari 4. However, in Safari 3.2.1, the elements slide out, but it starts of with a quick jerk and then slides. Has anyone else run into this problem and found a solution? Thanks!
[jQuery] Automatically slide all divs up when one slides down
So I have the following code and it works great. I am just curious how I can adapt it in order to only have 1 answer visible at one time. If once item is clicked, then on click of the other item, the last one automatically slides up. How would one go about doing this? JS: $(document).ready(function(){ $('.qa-list div').each(function(i) { $(this).children('.answer').slideUp(); }); $(.question).click(function(){ var $this = $(this); if( $this.is('.question') ) { $this.children('.answer').slideDown(); $this.removeClass('question'); $this.addClass('question-answer'); } else { $this.children('.answer').slideUp(); $this.removeClass('question-answer'); $this.addClass('question'); } //return false; }); }); CODE: div class=qa-list div class=questionQuestionbr / span class=answerthis is the answer/span/div div class=questionQuestionbr / span class=answerthis is the answer/span/div /div Thanks Brian -- Forwarded message -- From: marc0047 marc0...@gmail.com Date: Tue, Mar 3, 2009 at 3:40 PM Subject: [jQuery] Re: slideToggle is jerky in Safari 3.2.1 To: jQuery (English) jquery-en@googlegroups.com Looks like someone else had the same unresolved problem too: http://groups.google.com/group/jquery-en/browse_thread/thread/c929269adfd8ea99 On Mar 3, 8:22 am, marc0047 marc0...@gmail.com wrote: I am using slideToggle and it performs perfectly in FF, IE67, and the new Safari 4. However, in Safari 3.2.1, the elements slide out, but it starts of with a quick jerk and then slides. Has anyone else run into this problem and found a solution? Thanks!
[jQuery] Re: Validate Plugin disabling other JS on the page
ANSWER: This was being caused by the onclick event posting back, which the validate plugin had disabled. I changed the behavior of my radio buttons onclick method to get around this. On Mar 2, 1:16 pm, BSpizzle spar...@djsparrow.com wrote: Hello all, I am using the jQuery Validate plugin (http://docs.jquery.com/Plugins/ Validation) and am running into an issue with the other javascript I need to have running on the page. I have an Onclick event wired into a radio button in the form, but when one of the required fields fails validation, the radio button onclick event listed here is completely disabled and even when the validation requirement is met and the submit button is re-enabled, the other form javascript remains disabled: onclick=javascript:setTimeout('__doPostBack(\'_ctl0$ContentPlaceHolder $B\',\'\')', 0) I am using ASP.Net to generate my pages so unfortunately I am mostly at their discretion on how certain behavior is performed, but one of the things that I NEED to have work on the page is my autopostback features on my radio buttons. I do not have the radio buttons with a required class indicating that they should be part of this, but I do need their form submission values and since it's ASP.Net, the whole page is the form, so I can't just leave it outside and cheat with hidden values. I am newer to Jquery, so I have tried two different things in attempting to keep the javascript onclick event from being disabled: .filter and .not . .fliter seems to completely disable the entire form validation and let anything slide, and .not just isn't doing anything. Is there a way to have my cake and eat it too using this excellent plugin? Here is what I have in the javascript/jquery: script type=text/javascript $(document).ready(function() { var a = '_ctl0_ContentPlaceHolder_a'; var b = '_ctl0_ContentPlaceHolder_b'; var c = '_ctl0_ContentPlaceHolder_c'; $(#aspnetForm).not(document.getElementById(a), document.getElementById(b), document.getElementById(c)).validate();}); /script Here is what's in the html: form name=aspnetForm method=post action=SamePage.aspx id=aspnetForm onsubmit=return (g_submitted ? false : (g_submitted = true)); input id=_ctl0_ContentPlaceHolder_a type=radio name=_ctl0:ContentPlaceHolder:OPTION value=A onclick=javascript:setTimeout('__doPostBack(\'_ctl0$ContentPlaceHolder $A\',\'\')', 0) language=javascript /labelA/label br / input id=_ctl0_ContentPlaceHolder_b type=radio name=_ctl0:ContentPlaceHolder:OPTION value=multiplePassword checked=checked onclick=javascript:setTimeout('__doPostBack (\'_ctl0$ContentPlaceHolder$B\',\'\')', 0) language=javascript /labelB/label br / input id=_ctl0_ContentPlaceHolder_c type=radio name=_ctl0:ContentPlaceHolder:OPTION value=C onclick=javascript:setTimeout('__doPostBack(\'_ctl0$ContentPlaceHolder $C\',\'\')', 0) language=javascript /labelC/label input class=required name=blah minlength=1 / submit button cancel button etc... /form Everything else seems to work great, any thoughts?
[jQuery] Re: Automatically slide all divs up when one slides down
The javascript to do this would be the following, thanks everyone for your help. $('.qa-list div').each(function(i) { $(this).children('.answer').slideUp(); }); $(.question).click(function(){ var $this = $(this); if( $this.is('.question') ) { $this.children('.answer').slideDown(); $this.removeClass('question'); $this.addClass('question-answer'); $this.siblings('.qa-list div').children('.answer').slideUp(); $this.siblings('.qa-list div').removeClass('question-answer'); $this.siblings('.qa-list div').addClass('question'); } else { $this.children('.answer').slideUp(); $this.removeClass('question-answer'); $this.addClass('question'); } //return false; }); On Tue, Mar 3, 2009 at 3:45 PM, Brian Yanosik byano...@gmail.com wrote: So I have the following code and it works great. I am just curious how I can adapt it in order to only have 1 answer visible at one time. If once item is clicked, then on click of the other item, the last one automatically slides up. How would one go about doing this? JS: $(document).ready(function(){ $('.qa-list div').each(function(i) { $(this).children('.answer').slideUp(); }); $(.question).click(function(){ var $this = $(this); if( $this.is('.question') ) { $this.children('.answer').slideDown(); $this.removeClass('question'); $this.addClass('question-answer'); } else { $this.children('.answer').slideUp(); $this.removeClass('question-answer'); $this.addClass('question'); } //return false; }); }); CODE: div class=qa-list div class=questionQuestionbr / span class=answerthis is the answer/span/div div class=questionQuestionbr / span class=answerthis is the answer/span/div /div Thanks Brian -- Forwarded message -- From: marc0047 marc0...@gmail.com Date: Tue, Mar 3, 2009 at 3:40 PM Subject: [jQuery] Re: slideToggle is jerky in Safari 3.2.1 To: jQuery (English) jquery-en@googlegroups.com Looks like someone else had the same unresolved problem too: http://groups.google.com/group/jquery-en/browse_thread/thread/c929269adfd8ea99 On Mar 3, 8:22 am, marc0047 marc0...@gmail.com wrote: I am using slideToggle and it performs perfectly in FF, IE67, and the new Safari 4. However, in Safari 3.2.1, the elements slide out, but it starts of with a quick jerk and then slides. Has anyone else run into this problem and found a solution? Thanks!
[jQuery] Re: Moving from .get(xml file) to using .ajax
Make URL lowercase: ... url:kprxy.php, ... On Mar 3, 9:50 am, KrushRadio - Doc drega...@gmail.com wrote: Okay.. Thanks..I'll do that with the cache: false, thing. I still have the problem where it's not pulling the right data from the xml, as it used to before.. Any thoughts on that one, or if you can eyeball the second part of the code and let me know if there's something goofed? Thanks, Dan On Mar 3, 10:44 am, mkmanning michaell...@gmail.com wrote: You're still going to run into the issue of caching for requests to the same URL, even using ajax. The usual solution, as Ryan suggested, is to append changing data to the querystring of the ajax request, usually in the form of a timestamp: the_querystring+new Date ().getTime() As of jQuery 1.2, it will do that for you if you set the 'cache' option in the ajax call to false. $.ajax({ type: POST, cache:false, URL: kprxy.php, Unless your URL is going to change for every request, you will probably want to add this. On Mar 3, 6:52 am, KrushRadio - Doc drega...@gmail.com wrote: It should, but this is going to be an ajax application in the end.. I need to constantly pull it and display it on one page every 15 seconds On Mar 3, 3:17 am, ryan.joyce...@googlemail.com ryan.joyce...@googlemail.com wrote: if the browser is caching the query, would appending a parameter containing a random number or some such to the end of the request stop that?- Hide quoted text - - Show quoted text -
[jQuery] Re: Moving from .get(xml file) to using .ajax
If thats all it was, i'm going to ROFLStomp my keyboard. Thanks for your wisdom. I thought i was going out of my mind for a second. ~Doc On Mar 3, 3:18 pm, mkmanning michaell...@gmail.com wrote: Make URL lowercase: ... url:kprxy.php, ... On Mar 3, 9:50 am, KrushRadio - Doc drega...@gmail.com wrote: Okay.. Thanks..I'll do that with the cache: false, thing. I still have the problem where it's not pulling the right data from the xml, as it used to before.. Any thoughts on that one, or if you can eyeball the second part of the code and let me know if there's something goofed? Thanks, Dan On Mar 3, 10:44 am, mkmanning michaell...@gmail.com wrote: You're still going to run into the issue of caching for requests to the same URL, even using ajax. The usual solution, as Ryan suggested, is to append changing data to the querystring of the ajax request, usually in the form of a timestamp: the_querystring+new Date ().getTime() As of jQuery 1.2, it will do that for you if you set the 'cache' option in the ajax call to false. $.ajax({ type: POST, cache:false, URL: kprxy.php, Unless your URL is going to change for every request, you will probably want to add this. On Mar 3, 6:52 am, KrushRadio - Doc drega...@gmail.com wrote: It should, but this is going to be an ajax application in the end.. I need to constantly pull it and display it on one page every 15 seconds On Mar 3, 3:17 am, ryan.joyce...@googlemail.com ryan.joyce...@googlemail.com wrote: if the browser is caching the query, would appending a parameter containing a random number or some such to the end of the request stop that?- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[jQuery] linkselect plugin: problem with javascript set value
I'm trying to externally update the value of the linkselect field using this._itemSelect.linkselect(val, newValue); and am getting the following exception on FF3: 'self is undefined' on line 37, since the 'self' lookup from $.data returned null. Digging in to things, it looks like $.data is getting initialized with $input[0], but at least in my browser, the retrieval is being done with $select. Changing line 178 to $.data($select[0], linkselect, this); fixed the issue for me. Is this the proper fix? Can this get integrated? I'm also having an issue with the width of the dropdown list, my linkselect item is an inline element in a span, so it's unable to properly size the parent and the dropdown width is always set to the max-width from the CSS class. What's the proper way to get the list to size to its contents when its in an inline element? Thanks, Jason
[jQuery] Re: jQuery UI Question - Tool tip
Thanks Karl Jörn for both your responses.
[jQuery] Re: Automatically slide all divs up when one slides down
You could simplify your code to this (assuming you're adding/removing the classes for selection only and not styling): $(.question).click(function(){ $(this).children('.answer').slideToggle().end().siblings ('div.question').children('.answer').slideUp(); }); One thing you'll note however is that the answers show briefly and then are hidden by the .each() function. You can hide them with CSS by giving them display:none in your CSS. I'd like to suggest an alternate approach however: A question/answer list is more semantically represented as a definition list, which in addition would simplify your markup, while improving its accessibility: dl class=qa-list dtQuestion/dt ddthis is the answer/dd dtQuestion/dt ddthis is the answer/dd /dl In your CSS (to hide the answers initially): dl.qa-list dd{ display:none; } The JS: $(dl.qa-list dt).click(function(){ $(this).siblings('dd').slideUp().end().next().slideToggle(); }); On Mar 3, 1:05 pm, Brian Yanosik byano...@gmail.com wrote: The javascript to do this would be the following, thanks everyone for your help. $('.qa-list div').each(function(i) { $(this).children('.answer').slideUp(); }); $(.question).click(function(){ var $this = $(this); if( $this.is('.question') ) { $this.children('.answer').slideDown(); $this.removeClass('question'); $this.addClass('question-answer'); $this.siblings('.qa-list div').children('.answer').slideUp(); $this.siblings('.qa-list div').removeClass('question-answer'); $this.siblings('.qa-list div').addClass('question'); } else { $this.children('.answer').slideUp(); $this.removeClass('question-answer'); $this.addClass('question'); } //return false; }); On Tue, Mar 3, 2009 at 3:45 PM, Brian Yanosik byano...@gmail.com wrote: So I have the following code and it works great. I am just curious how I can adapt it in order to only have 1 answer visible at one time. If once item is clicked, then on click of the other item, the last one automatically slides up. How would one go about doing this? JS: $(document).ready(function(){ $('.qa-list div').each(function(i) { $(this).children('.answer').slideUp(); }); $(.question).click(function(){ var $this = $(this); if( $this.is('.question') ) { $this.children('.answer').slideDown(); $this.removeClass('question'); $this.addClass('question-answer'); } else { $this.children('.answer').slideUp(); $this.removeClass('question-answer'); $this.addClass('question'); } //return false; }); }); CODE: div class=qa-list div class=questionQuestionbr / span class=answerthis is the answer/span/div div class=questionQuestionbr / span class=answerthis is the answer/span/div /div Thanks Brian -- Forwarded message -- From: marc0047 marc0...@gmail.com Date: Tue, Mar 3, 2009 at 3:40 PM Subject: [jQuery] Re: slideToggle is jerky in Safari 3.2.1 To: jQuery (English) jquery-en@googlegroups.com Looks like someone else had the same unresolved problem too: http://groups.google.com/group/jquery-en/browse_thread/thread/c929269... On Mar 3, 8:22 am, marc0047 marc0...@gmail.com wrote: I am using slideToggle and it performs perfectly in FF, IE67, and the new Safari 4. However, in Safari 3.2.1, the elements slide out, but it starts of with a quick jerk and then slides. Has anyone else run into this problem and found a solution? Thanks!
[jQuery] jQuery UI 1.6rc6 - how to sort tabular data?
I know you can't actually sort tables, it's kinda broken. I can easily sort UL lists, but whenever I try to use float: left and width: XXXem to give set widths to each span, e.g.: lispan class=id32/span span class=nameBob Jenkins/span/ li #list li { clear: left; } #list li span { float: left; background: #ddd; margin: 1px; } #list li span.id { width: 2em; } #list li span.name { width: 12em; } #list li span.desc { width: 12em; } Well, the float: left seems to break sortable(). If I remove the float left, it works fine. How do I make each SPAN an exact set width? The only thing that seems to work is float:left combined with setting the 'width'. I'm just trying to make my UL look like a table so sortable() will work. Thanks..
[jQuery] Re: jQuery UI 1.6rc6 - how to sort tabular data?
Sorry, just realized this may be misleading. jQuery UI Sortable allows you to REORDER items in a list. I am looking to have a user drag/reorder items in a table, basically. On Mar 3, 4:20 pm, Sam H samh1...@gmail.com wrote: I know you can't actually sort tables, it's kinda broken. I can easily sort UL lists, but whenever I try to use float: left and width: XXXem to give set widths to each span, e.g.: lispan class=id32/span span class=nameBob Jenkins/span/ li #list li { clear: left;} #list li span { float: left; background: #ddd; margin: 1px;} #list li span.id { width: 2em;} #list li span.name { width: 12em;} #list li span.desc { width: 12em; } Well, the float: left seems to break sortable(). If I remove the float left, it works fine. How do I make each SPAN an exact set width? The only thing that seems to work is float:left combined with setting the 'width'. I'm just trying to make my UL look like a table so sortable() will work. Thanks..
[jQuery] browser detection for msie 6 7 and 8
What's the best way to detect these three browsers? Here's what I've come up with so far, but there's got to be a cleaner solution... $.browser.msie6 = ($.browser.msie /MSIE 6\.0/i.test(window.navigator.userAgent) !/MSIE 7\.0/i.test(window.navigator.userAgent)); if( $.browser.msie6 !/MSIE 8\.0/i.test (window.navigator.userAgent)) { //IE 6 else if ($.browser.msie (jQuery.browser.version 6.) (jQuery.browser.version 7.) ) { //IE 7 } else if ($.browser.msie (jQuery.browser.version 7.) ) { //IE 8 }
[jQuery] Re: Show/Hide Menu
great! but the important part: is it a nice or a bad puppy? g - Jack Nic Hubbard wrote: Yes! That is exactly what I was looking for! I have implemented it and it works perfectly, thank you! On Mar 3, 9:54 am, Jack Killpatrick j...@ihwy.com wrote: Here's an example of a way to handle that: http://www.ihwy.com/Labs/demos/Current/image-hover-menu.aspx - Jack Nic Hubbard wrote: Thanks. This almost seems like it would work. But, since the element that the hover is added to, and the element that is shown are different, by the time you move your mouse from the hover element to the element that is shown, your mouse moves out of the first element, and the shown div disappears. Essentially it needs to have the functionality of css dropdowns: http://www.cssplay.co.uk/menus/final_drop.html They stay out there until your mouse moves off of them. On Mar 3, 12:14 am, Jack Killpatrick j...@ihwy.com wrote: You might want to try .hover():http://docs.jquery.com/Events/hover#overout - Jack Nic Hubbard wrote: I have a menu that is activated on mouseover a link. The menu is a hidden div which appears. My problem now is how to remove/hide that div when a user move their mouse off of the menu. I have tried adding a mouseout event to the div, but because there are child divs inside that div, any mousing over them hides the parent div as well, which I don't want. I only want it to hide if the mouse is outside the parent div, not anywhere within it. // - Show Artists Menu When Link moused over -- $('a#Artists').mouseover(function() { // Show Our Artists Box $('#artistsBox').fadeIn('slow'); });//end mouseover // - Add Stuff When Link moused over -- $('#artistsBox').mouseover(function() { // Add a mouse out on our box $('#artistsColumns').mouseout(function() { // Hide Our Artists Box $('#artistsBox').fadeOut('slow'); });//end mouseover });//end mouseover div id=artistsBox style=display:none; div id=artistsColumnslinks and stuff in here/div /div Because the mouseout event is attatched to artistsBox, mousing over artistsColumns hides the div as well, which I don't want. Any ideas?
[jQuery] Re: Reordering rows using JQuery
As other's have said, you should do this server-side. Anyway, here's a way to do it: var csv = 'Row2,Row1,Row3', mytable = $('#mytable')[0]; //save the table for later csv = csv.split(','); //csv is now an array var ln = csv.length; while(ln--){ //loop csv array in reverse $('#'+csv[ln]) //build the id string #rowX .prependTo(mytable); } table id=mytable tr id=Row1 tdSome label 1 /td tdSome complex control/td /tr tr id=Row2 tdSome label 2/td tdSome complex control/td /tr tr id=Row3 tdSome label 3/td tdSome complex control/td /tr /table cheers, - ricardo On Mar 3, 3:54 pm, spdude sandeshm...@gmail.com wrote: anyone? On Mar 3, 8:51 am, spdude sandeshm...@gmail.com wrote: I dont want to sort the table. Rather, I want to reorder the tr based on a csv of the tr ids. This csv can be from the db, viewstate or session. I would rather not add the controls dynamically to the table as the rows have a lot of complicated custom controls and adding them dynamically may open up other issues with viewstate etc. On Mar 3, 7:02 am, Rasit OZDAS rasitoz...@gmail.com wrote: If I understand your problem correctly, you don't need JQuery for this, you can just create rows dynamically on start. JQuery is needed only when you need to change sorting in the middle, using Ajax etc. Tablesorter doesn't sort as you want, it sorts like ORDER BY query in SQL. I recommend using Jquery Sortable (in JQuery-UI). Rasit 2009/3/3 spdude sandeshm...@gmail.com I have an aspx page that looks something like this: tr id=Row1 tdSome label/td tdSome complex control/td /tr tr id=Row2 tdSome label/td tdSome complex control/td /tr tr id=Row3 tdSome label/td tdSome complex control/td /tr As soon as the page is loaded, I would want to reorder these rows based on the user's previously selected order (stored in a database) How would I use JQuery/JS to accomplish this? -- M. Raşit ÖZDAŞ
[jQuery] Re: Show/Hide Menu
Hmm, it looks nice to me. :) On Mar 3, 3:20 pm, Jack Killpatrick j...@ihwy.com wrote: great! but the important part: is it a nice or a bad puppy? g - Jack Nic Hubbard wrote: Yes! That is exactly what I was looking for! I have implemented it and it works perfectly, thank you! On Mar 3, 9:54 am, Jack Killpatrick j...@ihwy.com wrote: Here's an example of a way to handle that: http://www.ihwy.com/Labs/demos/Current/image-hover-menu.aspx - Jack Nic Hubbard wrote: Thanks. This almost seems like it would work. But, since the element that the hover is added to, and the element that is shown are different, by the time you move your mouse from the hover element to the element that is shown, your mouse moves out of the first element, and the shown div disappears. Essentially it needs to have the functionality of css dropdowns: http://www.cssplay.co.uk/menus/final_drop.html They stay out there until your mouse moves off of them. On Mar 3, 12:14 am, Jack Killpatrick j...@ihwy.com wrote: You might want to try .hover():http://docs.jquery.com/Events/hover#overout - Jack Nic Hubbard wrote: I have a menu that is activated on mouseover a link. The menu is a hidden div which appears. My problem now is how to remove/hide that div when a user move their mouse off of the menu. I have tried adding a mouseout event to the div, but because there are child divs inside that div, any mousing over them hides the parent div as well, which I don't want. I only want it to hide if the mouse is outside the parent div, not anywhere within it. // - Show Artists Menu When Link moused over -- $('a#Artists').mouseover(function() { // Show Our Artists Box $('#artistsBox').fadeIn('slow'); });//end mouseover // - Add Stuff When Link moused over -- $('#artistsBox').mouseover(function() { // Add a mouse out on our box $('#artistsColumns').mouseout(function() { // Hide Our Artists Box $('#artistsBox').fadeOut('slow'); });//end mouseover });//end mouseover div id=artistsBox style=display:none; div id=artistsColumnslinks and stuff in here/div /div Because the mouseout event is attatched to artistsBox, mousing over artistsColumns hides the div as well, which I don't want. Any ideas?
[jQuery] Re: How do I translate this in jQuery?
There's not much you can convert to jQuery. It's all javascript anyway: function getContentFromIframe(iFrameName) { var content = $('body', $('#'+iFrameName)[0].contentDocument).html (); $('#myiFrame-content').append(content); } - ricardo On Mar 3, 2:56 pm, Rick Faircloth r...@whitestonemedia.com wrote: I've made various attempts at translating this into jQuery without success. I guess I'm just not sufficient enough in regular JS to make it work. It's working, but I'd like it to be written as much as possible in jQuery syntax. Would some please translatethe first three lines of this into jQuery for me? Thanks, Rick function getContentFromIframe(iFrameName) { var myIFrame = document.getElementById(iFrameName); var content = myIFrame.contentWindow.document.body(innerHTML); $('#myiFrame-content').append(content); -- My reading of history convinces me that most bad government results from too much government. - Thomas Jefferson
[jQuery] Re: toggle a checkbox???
The best you can do is rewrite it to a simple ternary conditional and use the .checked property direclty: $(input[name^=REQ_ACCT_LAB_]).click(function() { $(input[name=MY_CHK]).attr('checked', this.checked ? 'checked' : ''); }); cheers, - ricardo On Mar 3, 4:15 pm, Jael jae...@yahoo.com wrote: thanks for the reply! in fact thats exactly what i'm doing but accidentally omitted that event in my post. So the if statement is as good as it gets? is there a better jquery (more efficient) way of doing this? James-279 wrote: What you did looks fine if it only runs one on page load. Which means if you check/uncheck after the fact, nothing else will happen. If you want it to work dynamically, you have to attach an event to the checkbox. Maybe something like: $(input[name^=REQ_ACCT_LAB_]).click(function() { if ($(this).is(:checked)) { $(input[name=MY_CHK]).attr(checked,checked); } else { $(input[name=MY_CHK]).attr(checked,); } }); On Mar 2, 11:36 am, Jael jae...@yahoo.com wrote: Hi all, I am new to this forum and hope someone can direct me a little.. I have a checkbox that needs to be checked/unchecked under the following rules.. if any checkboxes with id like REQ_ACCT_LAB_ are checked, then check it if all of the checkboxes with id like REQ_ACCT_LAB_ are unchecked, then uncheck it. Is there a better way of doing this? heres my code: if ($(input[name^=REQ_ACCT_LAB_]).is(:checked)) { $(input[name=MY_CHK]).attr(checked,checked); } else { $(input[name=MY_CHK]).attr(checked,); } Thanks! -- View this message in context:http://www.nabble.com/toggle-a-checkboxtp22233470s27240p22233470 Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context:http://www.nabble.com/toggle-a-checkboxtp22233470s27240p22315606 Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: converting HTML to XML using jQuery
Not showing your js function doesn't help much. All .group are descendants of .map, it's not about context. Maybe you want this (rough): $('.map').each(function(){ var xml = 'map'; $(this).find(' .group').each(function(){ xml += 'group'; $(this).find(' .group').each(function(){ xml += 'group'; xml += $(this).text(); xml += '/group'; }); xml += '/group'; }); xml+= '/map'; }); On Mar 3, 5:27 pm, DReed danreed...@gmail.com wrote: I have been struggling with trying to do the following... perhaps I am looking at it too hard since I have a feeling the solution is right in front of me (i hope). I have something like the following: div class=map div class=titleTitle/div div class=group Group Name 1 div class=groupGroup Name 1-1/div /div div class=group Group Name 2 div class=groupGroup Name 2-1/div /div /div I would like to turn this into XML, like: map titleTitle/title groupGroup Name 1 groupGroup Name 1-1/group /group groupGroup Name 2 groupGroup Name 2-1/group /group /map I have been trying using the .each() function but it doesn't seem to hold the context node (when my context is the .map node and I want to iterate the .group, it will iterate ALL of them, instead of the TWO directly under the .map element. I can brute force this with some recursion but I thought there must be a way to retain the context of the jQuery. Perhaps the .each way isn't the right approach? Thanks in advance.
[jQuery] Re: Optimize large DOM inserts
Josh, I find this really interesting, thanks for posting this. I'm curious: have you done any looking into 'moving' DOM nodes? IE: taking an existing set of nodes and moving them to under a new parent node (or appending them under various parent nodes, depending on their class or some other attribute)? Thanks, Jack Josh Powell wrote: Hey guys, This thread inspired me to write a blog article http://www.learningjquery.com/2009/03/43439-reasons-to-use-append-correctly I did some testing of the += and array.join methods of long string concatenation. Interesting stuff! It turns out that += and array.join are browser dependent in their execution time, although one method is quicker in a majority of current and next gen browsers. On Feb 8, 11:20 am, Kevin Dalman kevin.dal...@gmail.com wrote: Rick, based on what I've learned from testing, you have another option now... Here is a modified version of Mike's code - without generating the table. function populateDutyTable(response) { var currentDay = ''; var rows = response.QGETDUTYSCHEDULE.DATA; var out = [], o = -1; out[++o] = 'tbody'; // CHANGED for( var row, i = -1; row = rows[++i]; ) { var day = row[1]; if( currentDay != day ) { currentDay = day; out[++o] = 'trtd class=cell-day'; out[++o] = row[1]; out[++o] = '/tdtd class=cell-date'; out[++o] = row[2]; out[++o] = '/tdtd class=cell-blank colspan=5nbsp;/td/tr'; } out[++o] = 'trtd class=cell-blank-daynbsp;/tdtd class=cell-blank-datenbsp;/tdtd class=cell-am-am'; out[++o] = row[3]; out[++o] = '/tdtd class=cell-position'; out[++o] = row[4]; out[++o] = '/tdtd colspan=3Cell Content/td/tr'; } out[++o] = '/tbody'; // CHANGED $('#scheduleBody').append( out.join('') ); // CHANGED } A container around the table is no longer required because wrapping the rows in a tbody achieves the same performance as wrapping them in a table. Plus, you could now add rows without regenerating the entire table. This provides more options with no penalty. For example, now you could hard-code the table with column headers - for example... table id=scheduleBody thead tr thID/th thDay/th thDate/th thName/th /tr /thead /table This is cleaner and faster than adding column headers inside your Javascript loop. I suggest you try both methods, Rick. Use a timer (like MIike's sample pages) to confirm whether both are equally fast. Based on my tests, you may find appending to the table even faster, with cleaner markup as a bonus. Ciao, /Kevin On Feb 7, 3:20 pm, Rick Faircloth r...@whitestonemedia.com wrote: Hey, thanks Michael for taking the time to provide the explanation and the re-write. I'll put this into place and see how it performs. I'm sure it'll be *much* better! Rick
[jQuery] Re: I need a jsonp example
James - Thank You for that link! - Very Helpful I've been able to track down what *seems* to be my problem... The call we're trying to make is an HTTPS call, which (I believe) is considered 'cross-domain' even when on the same domain. That's why we chose to try JSONP in the first place. Now what's happening is that we've got two environments - a DEV and a STAGING. DEV can successfully call: http://staging.foo.com/handler.aspx https://staging.foo.com/handler.aspx and vice-versa for staging calling dev. However, when either environment tries to call that same handler within it's own environment it will only succeed with the version of the URL that's NON-SSL. I'm I missing something? Will jsonp not do an SSL call or something? Thanks for all the help so far - hopefully someone knows what I'm doing wrong!
[jQuery] Re: I need a jsonp example
c...@p! I just found the answer: We're using 1.2.6 and there's this patch we need... http://dev.jquery.com/ticket/3045 Thank you all for the help - that IBM link really did help...I can't believe this is so little documented. Thanks again!
[jQuery] Re: Building Columns From A List Of Items
Would it be a better idea to use the .slice() function rather than what I have? Couldn't I just use the same math function to calculate the number of items in each column? On Mar 3, 11:59 am, Nic Hubbard nnhubb...@gmail.com wrote: I understand now, and I appreciate your help. A new problem has arisen from this. It seems that this loops through elements grouped in 3, rather than apply the class for the first column first, then the second one. Here is what I mean. Say I have 9 p tags containing links. This is how the script writes the classes: p class=firstContent/p p class=secondContent/p p class=thirdContent/p p class=firstContent/p p class=secondContent/p p class=thirdContent/p p class=firstContent/p p class=secondContent/p p class=thirdContent/p So, when I group those by class name, and add a column div around them, they are completely out of their original order. What I really need to do is: p class=firstContent/p p class=firstContent/p p class=firstContent/p p class=secondContent/p p class=secondContent/p p class=secondContent/p p class=thirdContent/p p class=thirdContent/p p class=thirdContent/p This way, it will group them properly when I use the wrapAll function. Is there a way to do it this way? Thanks again for your help! On Mar 3, 11:02 am, brian bally.z...@gmail.com wrote: On Tue, Mar 3, 2009 at 1:48 PM, Nic Hubbard nnhubb...@gmail.com wrote: Should I keep the division by 10 on the Math function? No, as i said, that's the problem. There's not only no need for it, but it's giving you results you don't want. Quick: what's zero divided by ten? And what's the remainder of that result divided by 3? This should help to illustrate what's going on: $('#artistsColumns p').each(function(i){ var d = Math.floor(i/10); var n = d % 3; $(this).html('strongd:' + d + ' n:' + n + '/strongbr /' + $(this).html()); $(this).addClass(classNames[n]); });
[jQuery] Re: multiple conditions?
hey i tried that, and it didn't work. I played around with it for awhile trying everything i could, but to no avail :( any ideas? Ami wrote: var divFocus=false,textareaFocus=false $('div').focus(function () {divFocus=true}).blur(function() {divFocus=false;doSomething()}; $('textarea').focus(function () {textareafocus=true}).blur(function() {textareaFocus=false;doSomething()} function doSomthing() { if (!divFocus !textAreaFocus) alert('There is no focus on the divtextarea') } Hope it's help you. Aminadav On Mar 2, 4:38 am, homien...@gmail.com homien...@gmail.com wrote: I have a div with a textbod inside of it. When both of these lose focus, so the focus is not on either of them, then I want the div to move. How would I write the code that if both of these lose focus, THEN do whatever i want. I just want to know how to have 2 selectors, and when both of them lose focus, then do something. i'm probably missing the obvious... it's been a long day. thanks!
[jQuery] Re: converting HTML to XML using jQuery
@Dreed, could you maybe be a little more specific about why you need to do this in jQuery? A recursive function would be trivial (I can't see how it's brute force) and you could make it generic such that 'tags' are created out of the classnames, no matter what they are. On Mar 3, 3:53 pm, ricardobeat ricardob...@gmail.com wrote: Not showing your js function doesn't help much. All .group are descendants of .map, it's not about context. Maybe you want this (rough): $('.map').each(function(){ var xml = 'map'; $(this).find(' .group').each(function(){ xml += 'group'; $(this).find(' .group').each(function(){ xml += 'group'; xml += $(this).text(); xml += '/group'; }); xml += '/group'; }); xml+= '/map'; }); On Mar 3, 5:27 pm, DReed danreed...@gmail.com wrote: I have been struggling with trying to do the following... perhaps I am looking at it too hard since I have a feeling the solution is right in front of me (i hope). I have something like the following: div class=map div class=titleTitle/div div class=group Group Name 1 div class=groupGroup Name 1-1/div /div div class=group Group Name 2 div class=groupGroup Name 2-1/div /div /div I would like to turn this into XML, like: map titleTitle/title groupGroup Name 1 groupGroup Name 1-1/group /group groupGroup Name 2 groupGroup Name 2-1/group /group /map I have been trying using the .each() function but it doesn't seem to hold the context node (when my context is the .map node and I want to iterate the .group, it will iterate ALL of them, instead of the TWO directly under the .map element. I can brute force this with some recursion but I thought there must be a way to retain the context of the jQuery. Perhaps the .each way isn't the right approach? Thanks in advance.
[jQuery] innerWidth + scrolling
I have a div element with scrolling. Is there a way to measure the internal width counting the scrolling? I noticed innerWidth will return me the same independently of internal width Thanks
[jQuery] new Whitehouse.gov uses jQuery 1.2.9
just wanted to share that with everyone who doesn't follow me on identi.ca
[jQuery] innerWidth + overflow
Hello I have an element with internal scrollbar I noticed the innerWidth() property always return the same value indepentent of my internal scroll is there a way to measure the internal width, considering the overflow? Thanks
[jQuery] SuperFish not working
Hi, I am trying to build my FIRST joomla 1.5 site. I am am using rochen hosting (they host joomla.org etc) and i have a template installed from yootheme. I installed my joomla using a fantastico script provided to me by my host. I have had absolutely no issues installing any plugins or themes. Prior to installing the superfish module, the only other extension i have installed is JCE. In other words, this is a pretty clean install. I was shocked to find that a simple feature such as a dropdown menu, was not possible out of the box in joomla 1.5! Anyway, that led me to search the extensions, which led me to find this plug in. The problem is that the default installation of this plug in does not seem to work. You can view my site at http://www.astromediahosts.com/enable Right there on the homepage, in 3 different browsers, FF3, IE7, and Safari, there is a problem with the submenus. There are supposed to be items under both the about us and information tabs. These items only show up once when you mouse over, and they disappear when u try and mouse over a second time. I have not touched anything. I have not tweaked the javascript or touched the css. All i have done is select the menu type from the parameters option on the right of the module admin aread, and publish the module in the menu position, and reference my (now unpublished) mainmenu so that the extension would know what navigation to follow. What could i be doing wrong? For joomla extensions, is it necessary to add any javascript tags to the index.php? I have been going nuts for hrs trying to figure out what should be a pretty simple implementation. Any help will be appreciated. Thanks
[jQuery] [validate] french accents
How, I am trying to validate mails with jquery validate and would like to block french accents , eg à è etc how can I implelment this in the email regexp ? Thanks
[jQuery] Superfish Bug - Mouseout in FF does not work over input
I have a SF menu that expands over a form. With FF3, when I mouseout over any of the form fields, the menu does not collapse. I need to place the cursor back in the menu and mouseout somewhere else. This is only the case directly over the input, or textarea tags. If I slip the mouse between them it works fine. Any ideas as to what might be causing this? Maybe something with jQuery blur? I'm guessing that the following code is where the problem starts: code $a.each(function(i){ var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call ($li);}); }); /code
[jQuery] Ajax loading of HTML
Hi All, I am having a problem with loading an HTML file to populate a dropdown as follows with names of states in the USA: $(select[name=step_2]).load(./includes/usa.html); The HTML it is going into is as follows: label for=step_2 class=disabled* STEP 2) Select your State/ Province:/label span class=step_2select disabled=disabled name=step_2 Inserted dropdown goes here. /select/span When running the script I get the message in Firebug: Syntax error:[Break on this error] _block_windowOpen(); function (X) {\n xpopup.js (line 80) This works when running on a local wamp server but fails on remote servers...any ideas? Thanks.
[jQuery] Determine which radio button (if any) is selected on form load.
I have an order edit form that is fed from Coldfusion/SQL that shows a radio list of possible product selections. If the customer is editing an order that has already been submitted, one of the products in the radio list is selected. If it is a new order, none is selected. Upon load, I need to determine which one, if any, is selected so that I can turn manipulate other elements on the page. The div for the radio input list is id = ItemList. This below does not work, it returns Undefined in the alert box. $(document).ready(function() { alert($(#ItemList:checked).val()); }); Can someone throw this jPup a bone? Thanks SWimmer
[jQuery] Re: How do I translate this in jQuery?
function getContentFromIframe(iFrameName) { var myIFrame = $(#+iFrameName); var content = myIFrame.contents().find(body).html(); $('#myiFrame-content').append(content); On Mar 3, 9:56 am, Rick Faircloth r...@whitestonemedia.com wrote: I've made various attempts at translating this into jQuery without success. I guess I'm just not sufficient enough in regular JS to make it work. It's working, but I'd like it to be written as much as possible in jQuery syntax. Would some please translatethe first three lines of this into jQuery for me? Thanks, Rick function getContentFromIframe(iFrameName) { var myIFrame = document.getElementById(iFrameName); var content = myIFrame.contentWindow.document.body(innerHTML); $('#myiFrame-content').append(content); -- My reading of history convinces me that most bad government results from too much government. - Thomas Jefferson
[jQuery] Objects Methods as event handlers.
I've recently taken on a job where I have been required to use jQuery instead of my usual framework of choice - prototype. I've handled the transition well enough but one area of functionality has me befuddled - using object methods to handle events. I've been working around the problem but the workarounds are quite ugly. An explanation. First I'll give the code as it would look in prototype myClass = Class.create({ this.element: null, this.initialize: function( element ) { this.element = element; element.observe('click', this.onClick.bindAsEventListener(this)); }, this.onClick: function(e) { // actions on click here. } }); Now I know how to build classes in javascript without prototype's Class library. I also know how to use late binding and prototype modifications to achieve what that library abstracts. The problem is how am I supposed to replicate bindAsEventListener? I've tried... myClass = function( element ) { // element is an element somewhere in the dom that this class will manage a behavior for. // Assume for the purposes of this example that it's already encapsulated in a jQuery object this.element = element; this.onClick = function() { // on click actions. } this.element.bind('click', this.onClick ); } If I run the code as above the meaning of 'this' is lost. Unfortunately this.element.bind('click', this.onClick ).apply(this); // more or less what .bindAsEventListener actually does. won't work - it causes jQuery to issue an error. So how is anyone supposed to use object methods to handle events, a cornerstone of object oriented programming? If I'm to continue using this framework I need to find a solution to this problem.
[jQuery] AJAX in IE 6 providing Object does not support this property or method
Here is the function I have created to handle AJAX requests on top of the latest JQuery release: // Portal for an AJAX query function ajax_query(url, data) { var ajax_return = $.ajax({ url: '/scripts/ajax/' + url + '?' + data, async: false }).responseText; return ajax_return; } I call it with something like: alert(ajax_query(script.php,variable1=truevariable2=false)); Now this code simply does not work in IE 6, providing a Object does not support this property or method error. I've worked it down to either this function or JQuery itself that is causing the error as if I delete the calls to this custom function then the script does not produce any errors. Any help would be appreciated, thank you :D
[jQuery] jQuery plugins function calls
I have a jQuery plugin that adds a series of links to my page, and when each one is clicked, it should display the index of the link. The problem is that every link displays the string 11. This is because when I bind the click method, I pass in an actual function, which doesn't get interpreted until its called. So its always holding a reference to the variable i, and hence, uses its current value, which ends up being 11. The reason I can't simply do: $link.bind('click', 'alert(' + i + ');'); is because I need the click event to call a function WITHIN the plugin. Is there a correct way to do this? I need to call a function within the plugin and pass in the i index variable. jQuery.fn.myplugin = function() { return this.each(function() { function alertme(str) { alert (str); } for (int i = 0; i 10; i++) { var $link = jQuery('a/a'); $link.html(i); $link.bind('click', function() { alertme(i); }); $this.append(link); } } };
[jQuery] How do you handle 2 differents and 1 action?
I have the following piece of code which checks if a user has pressed the Enter key in a text input with id=text_input and then performs some action: $(document).ready(function() { $(#text_input).keyup(function(e) { // Checks if the Enter key was entered if(e.keyCode == 13) { // perform the action } }); }); I also have a button with id=push_button that I wish will perform the same action as above when clicked. How can I rewrite the above so that I check for either of those two events and perform that one action without code duplication?