[jQuery] Syntax similar to IN in SQL
Hi All, I am sure this is an easy question for someone in here. Is there a better, cleaner, shorter way to write this: if ( ($('#price_group_lesson').attr("value") == 'B') || ($ ('#price_group_lesson').attr("value") == 'C') || ($ ('#price_group_lesson').attr("value") == 'D') ){ $('#price_group_lesson_yes').slideDown('fast');} else{$('#price_group_lesson_yes').slideUp('fast');} I am creating a pretty custom questionnaire, and it has a lot of logic in it. I wish I didn't have to type it all out like that. I am sure there is something in javascript or jquery where I can say $ ('#var').attr('value').in("A","B","C") Thanks
[jQuery] [autocomplete] - Problem with display after upgrading from 1.0 to 1.0.2
Hi All, I just updated the version I was using 1.0 of the jquery autocomplete to version 1.0.2. And right away one thing does not work the same for me. The display used to be a nice list with no scroll bars and would say More at the bottom with arrows. Now it comes up with both a horizontal and vertical scroll bars (looks way worse). Anyone know why or how to fix it? Thanks, -Roman
[jQuery] Re: Select Odd/Even rows out of visible rows
actually doing $('table.basic tbody tr:visible:even').addClass('even'); does work, and it just has to go in the right spot after all the show/ hide logic is done, as well as be called every time something is changed. -Roman On Apr 28, 9:41 am, rsmolkin <[EMAIL PROTECTED]> wrote: > Hi All, > > I've got a little problem. I have a table in which some rows are > shown and hidden based on some selections. > > What I am trying to do is add the row-styping to this table, but what > happens is something doesn't work right with the :even selector, and I > get some rows next to each other of the same color. > > Does anyone know how to write a selector that would return all even > visible rows? > > I tried doing this but it doesn't work: > function rowColors(){ > $('table.basic tbody tr').removeClass('even'); > $('table.basic tbody tr:even:visible').addClass('even'); > }
[jQuery] Select Odd/Even rows out of visible rows
Hi All, I've got a little problem. I have a table in which some rows are shown and hidden based on some selections. What I am trying to do is add the row-styping to this table, but what happens is something doesn't work right with the :even selector, and I get some rows next to each other of the same color. Does anyone know how to write a selector that would return all even visible rows? I tried doing this but it doesn't work: function rowColors(){ $('table.basic tbody tr').removeClass('even'); $('table.basic tbody tr:even:visible').addClass('even'); }
[jQuery] Jquery spell checker
Has anyone seen a spell checker for text areas written in Jquery? I'm looking for one that is either stand-alone or can be used via AJAX connecting to ColdFusion. I would like to add a spell checker to all text areas that will work like Gmail. Thanks, -Roman
[jQuery] jQuery CharCounter Problem with limit reached
Hi, I'm using the jquery charcounter to count and limit characters in text areas. It's working well for the most part, except for the following problem. If I paste in text that exceeds the limit and it's truncated to say 1000 characters that are allowed, and then I go in and select a couple of words to delete and then click the delete key, it deletes all the text inside the text area not just the selected text. Very strange. Anyone has any idea? -Roman
[jQuery] Re: click() not binding to appended elment
Thanks for the post, this just help me figure out the problem I was having with binding click events to dynamically generated links. -Roman On Mar 26, 1:19 am, boermans <[EMAIL PROTECTED]> wrote: > The problem is that when you run: > > $('img.remove').click(function() { > console.log('test'); > return false; > > }); > > The image you are attempting tobindto doesn't exist. > To get around this you will need tobindthe remove function after > adding the player. > There's a few ways to do this - perhaps put it in a function: > > function bindremove(){ >$('img.remove').click(function() { > // your code > }); > > } > > And add it to the add player function: > > $('a#addPlayer').click(function() { > // your code > bindremove(); > return false; > > }); > > Not tested - but hopefully you get the idea? > > Cheers > Ollie > > On Mar 26, 7:25 am, Up-Works <[EMAIL PROTECTED]> wrote: > > > Do I have to use .bind('click','fn')? or another method to haveclick > > fire on dynamically added elements to the DOM?
[jQuery] Re: Jquery Selector even and first child (nested tables striping)
Ok, found a solution if anyone else is searching! $('table.basic tr:nth-child(even)').addClass('even'); -Roman On Mar 31, 2:45 pm, rsmolkin <[EMAIL PROTECTED]> wrote: > Hi, > > I've ran into a little problem. I'm using the code below to do > alternate row striping on a table. > > $('table.basic tr:even').addClass('even'); > > The problem is, one of the cells of this table contains another > (nested) table. So the tr:even selector is getting messet up, and is > applying the row color to the nested table and then skips the actual > next row in the table. > > Is there any way to do :even only on first level tr elements? I tried > doing > $('table.basic tr:first-child tr:even').addClass('even'); > But that doesn't work. Does anyone know how to do this right? > > Thanks, > -Roman
[jQuery] Jquery Selector even and first child (nested tables striping)
Hi, I've ran into a little problem. I'm using the code below to do alternate row striping on a table. $('table.basic tr:even').addClass('even'); The problem is, one of the cells of this table contains another (nested) table. So the tr:even selector is getting messet up, and is applying the row color to the nested table and then skips the actual next row in the table. Is there any way to do :even only on first level tr elements? I tried doing $('table.basic tr:first-child tr:even').addClass('even'); But that doesn't work. Does anyone know how to do this right? Thanks, -Roman
[jQuery] Lightbox v0.4 Button Placement
Hi All, Does anyone know how to move the buttons in the JQuery Lightbox v0.4 (http://leandrovieira.com/projects/jquery/lightbox/)? I would like to have the Close button in the top right corner, the next button in the bottom right corner and the previous button in the bottom left corner. Thanks, -Roman
[jQuery] Re: Dynamic Variables
Thanks everyone for great suggestions. I compbined some of these with some coldfusion to really condence down the code. -Roman On Feb 11, 7:32 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote: > Hi there, > > You could do something like this: > > $(':checkbox').click( > function() { > var idPart = this.id.split('_')[1]; > if ($(this).is(":checked")){ > $('#tbl_' + > idPart).show('medium'); > } > else{ > $('#tbl_' + > idPart).hide('medium'); > } > } > ); > > One thing you might want to do is add some context to the ":checkbox" > selector because it might be a little slow on its own. > > You could make this even shorter by using a ternary operator if you > want: > > $(':checkbox').click( > function() { > var idPart = this.id.split('_')[1]; > $('#tbl_' + > idPart)[$(this).is(":checked") ? 'show' : 'hide'] > ('medium'); > } > ); > > Hope that helps. > > --Karl > _ > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Feb 11, 2008, at 3:11 PM, rsmolkin wrote: > > > > > Hi, > > > I hope someone can help me out a bit. > > > I am finding myself doing a lot of code (as I'll paste below). It's > > basically the same block of code with different variables. > > > What I am trying to do is consolidate all that code into a funciton > > where I can declare all the checkboxes I need to create an Click > > function for, and then loop through them and generate the click > > handler as well as other functions for all of them. > > > Here is the code snippet: > > >$('#ckbx_wgmpo').click( > >function() { > >if ($(this).attr("checked") == true){ > > > > $('table#tbl_wgmpo').show('medium'); > >} > >else{ > > > > $('table#tbl_wgmpo').hide('medium'); > >} > >} > >); > >$('#ckbx_wgmse').click( > >function() { > >if ($(this).attr("checked") == true){ > > > > $('table#tbl_wgmse').show('medium'); > >} > >else{ > > > > $('table#tbl_wgmse').hide('medium'); > >} > >} > >); > >$('#ckbx_wgmoe').click( > >function() { > >if ($(this).attr("checked") == true){ > > > > $('table#tbl_wgmoe').show('medium'); > >} > >else{ > > > > $('table#tbl_wgmoe').hide('medium'); > >} > >} > >); > >$('#ckbx_tyd').click( > >function() { > >if ($(this).attr("checked") == true){ > >$('div#tyd_info').show('medium'); > >} > >else{ > >$('div#tyd_info').hide('medium'); > >
[jQuery] Dynamic Variables
Hi, I hope someone can help me out a bit. I am finding myself doing a lot of code (as I'll paste below). It's basically the same block of code with different variables. What I am trying to do is consolidate all that code into a funciton where I can declare all the checkboxes I need to create an Click function for, and then loop through them and generate the click handler as well as other functions for all of them. Here is the code snippet: $('#ckbx_wgmpo').click( function() { if ($(this).attr("checked") == true){ $('table#tbl_wgmpo').show('medium'); } else{ $('table#tbl_wgmpo').hide('medium'); } } ); $('#ckbx_wgmse').click( function() { if ($(this).attr("checked") == true){ $('table#tbl_wgmse').show('medium'); } else{ $('table#tbl_wgmse').hide('medium'); } } ); $('#ckbx_wgmoe').click( function() { if ($(this).attr("checked") == true){ $('table#tbl_wgmoe').show('medium'); } else{ $('table#tbl_wgmoe').hide('medium'); } } ); $('#ckbx_tyd').click( function() { if ($(this).attr("checked") == true){ $('div#tyd_info').show('medium'); } else{ $('div#tyd_info').hide('medium'); } } ); $('#ckbx_tydpo').click( function() { if ($(this).attr("checked") == true){ $('table#tbl_tydpo').show('medium'); } else{ $('table#tbl_tydpo').hide('medium'); } } ); $('#ckbx_tydgc').click( function() { if ($(this).attr("checked") == true){ $('table#tbl_tydgc').show('medium'); } else{ $('table#tbl_tydgc').hide('medium'); } } ); $('#ckbx_tydoe').click( function() { if ($(this).attr("checked") == true){ $('table#tbl_tydoe').show('medium'); } else{ $('table#tbl_tydoe').hide('medium'); } } );
[jQuery] Datepicker showon link click
Hi, Does anyone know how to make the Datepicker (calendar) be displayed by clicking on a link next to a textfield. I know it has a button option and a focus option, but our old calendar used to be launched by a link, so users are used to that. Does anyone know how to do that? Thanks, -Roman
[jQuery] Re: calling ajax with url parameter
Does this actually work? Did you get this to work? I am trying to do the exact same thing, so for each link I need to pass 3 parameters to by server script. -Roman On Dec 4, 6:03 am, Feijó <[EMAIL PROTECTED]> wrote: > I like to set my own attributes, like that > > click here > > > $(document).ready(function() { > $('#item1').click(function() { > $('#result').load('process.php', {a: $(this).attr('a'), b: > $(this).attr('b') }); > return false; > }); > > }); > > hugs > Feijó- Original Message - > From: "dimmex" <[EMAIL PROTECTED]> > To: "jQuery (English)" > Sent: Tuesday, December 04, 2007 3:53 AM > Subject: [jQuery] calling ajax with url parameter > > > Hello, > > > I'm pretty new to jQuery and want to implement some ajax. > > > I have a html like this: > > click here > > > > > After learning jQuery a little while, I got the way to call ajax > > something like this: > > > $(document).ready(function() { > > $('#item1').click(function() { > > $('#result').load('process.php', {parameters will be passed here}); > > return false; > > }); > > }); > > > from what I learnt, the parameters will be passed in format: {'a' : > > value, 'b': value} > > > My question, can I get the href part or specifically only the > > parameter (only 'a=1&b=2') and passing it and in my process.php I can > > access it just like $_POST variables ( $_POST['a'] and > > $_POST['b'] ) ? what jQuery function do I need to do that? what I'm > > thinking is something like $('#result').load('process.php', > > extract(getparameter(url))); > > > I hope my question is clear enough :) any help is appreciated. > > > Thanks. > > Dimm
[jQuery] Simple Table Filter
Hi, I've found a bunch of different filters for tables, but I need something much simpler. Can anyone help me out? I am displaying a list of Facilities ordered by State and City, where a facility name, phone, city and state are displayed. All I'd like to do is give the user ability to filter the list by State by selecting a State from a drop-down. I have this working in ColdFusion, but that's kinda slow, so I'd like to do it using JavaScript/jquery. Can anyone please let me know how to go about doing something as simple as hiding all the rows that don't match the state specified from a drop down and if another state is selected updating the table? Thanks, -Roman
[jQuery] Tablesorter and numbers formatted with commas
Hi All, Does anyone know how to get the Tablesorter to properly sort numbers some of which have a comma separating the thousands. What I mean is I have a range of numbers anywhere from 0 to 10,000, and I want 958 to be above 1,104 but by default it's not. Any suggestions appreciaged. Thanks, -Roman
[jQuery] Re: Flash and jQuery
Hi All, I tried doing this $(document).ready(function(){ $('#link_menu1').bind('click', function () { $('#mainTable').hide(); }); }); But it's not working. I think Flash is still taking away the click event. Can you please help me figure out how can I detect the click in flash and then have it call the jQuery function to hide the element? I am using sIFR'd links, so somewhere in the created Flash movie I think I have to detect a click and then call the javascript function, but I have no idea how to actually do it. Please help. -Roman On Oct 14, 2:06 pm, Pyrolupus <[EMAIL PROTECTED]> wrote: > I originally thought that it was justFlashand JavaScript > interaction, in which case you'd use the > getUrl('javascript:yourfunc()') ActionScript statement, but it sounds > more like you just want your previously working links to continue > working the way you remember them. > > I skimmed the sIFR docs and found the following: > > http://wiki.novemberborn.net/sifr/FAQ#replacing-links > > That *might* answer your question, but without a code example of what > you're trying to accomplish, I can't be sure. If you are simply > trying to use a link to get your show/hide behavior, then the link > above still helps you: essentially, you just want to wrap the sIFRed > text/element that you want to use for show/hide functionality and then > use that instead: > > Ugly Text to be > Prettified > > (script area) > sIFR.replace(sifrMe, blah, blah) //I don't use sIFR, correct as > necessary > > $('#showHideThing1').bind('click', function () { > myShowHideFunc(this); > > }); > > So, you replace the "siferMe" item and bind your click event to > showHideThing1. > > Pyro > > On Oct 14, 11:55 am, pixelwizzard <[EMAIL PROTECTED]> wrote: > > > > > Hi Guys, > > > Did you figure this out? > > > I have a problem with links that were converted using sIFR and then I need > > to use them to do a show/hide usingjQueryand it looks likeFlashis > > stealing my click event, so the click event never gets called byjquery. > > > Is there any way to getFlashto trigger the event for a specific link? > > > Thanks, > > -Roman > > > njsuperfreak wrote: > > > > Sweet! Good Find Brett, and thanks Sam! I think I am definitely going > > > to experiment with this. looks interesting... > > > > On Oct 4, 8:19 pm, Brett <[EMAIL PROTECTED]> wrote: > > >> Interesting, I googled up and found an example of > > >> this:http://www.quirksmode.org/js/flash_call.html > > > >> NotjQueryas such in the demo, but any function you write can refer > > >> tojQuery. > > > >> On Oct 5, 8:10 am, "Sam Sherlock" <[EMAIL PROTECTED]> wrote: > > > >> > yourflashwould need to be wmode=transparent > > > >> > and you'd need to call a javascript function from withinflashthat in > > >> turn > > >> > calls the grey box function > > > >> > sincejqueryapplies the onclick event to all anchors with a class of > > >> > greybox you'll need simluar code inside you function that you call from > > >> >flash. > > > >> > getURL('javascript:callGreyboxFromFlash()'); > > > >> > - S > > > >> > On 04/10/2007, njsuperfreak <[EMAIL PROTECTED]> wrote: > > > >> > > CanFlashcommunicate withjQuery? I would like to useflashto > > >> > > interact withjQuerylike opening up a dialogbox using the greybox.js > > >> > > plugin. How would I go about doing that any ideas? > > > >> > > The code is activated by the class="greybox" > > > -- > > View this message in > > context:http://www.nabble.com/Flash-and-jQuery-tf4569724s27240.html#a13159151 > > Sent from thejQueryGeneral Discussion mailing list archive at Nabble.com.- > > Hide quoted text - > > - Show quoted text -
[jQuery] two subscriptions to the same group
Hi All, This is strange, and I am not sure how it happened, but I think somehow I got 2 different subscriptions to this group, one as rsmolkin and one as pixelwizzard. I went to edit my membership and changed it to only get 1 daily e-mail, yet I am still getting every message posted. Any idea how I can fix this? -Roman
[jQuery] Show(1500) flicking on Firefox 1.0 and 2.0
Hi All, I am trying to fade in a table on a page when a page loads $(document).ready(function(){ $('#mainTable').hide().show(1500); }); This works exactly as expected in IE, but for some reason in Firefox there are 2 issues. First of all instead of actually fading in, it flies in form the right (which is kind of ok, since it's better then nothing, but I wanted it to fade in). Problem 2, after it's in position it briefly flickers off and on and then finally stays. Any ideas? -Roman
[jQuery] Re: Flash and jQuery
Hi Guys, Did you figure this out? I have a problem with links that were converted using sIFR and then I need to use them to do a show/hide using jQuery and it looks like Flash is stealing my click event, so the click event never gets called by jquery. Is there any way to get Flash to trigger the event for a specific link? Thanks, -Roman On Oct 5, 10:51 am, njsuperfreak <[EMAIL PROTECTED]> wrote: > Sweet! Good Find Brett, and thanks Sam! I think I am definitely going > to experiment with this. looks interesting... > > On Oct 4, 8:19 pm, Brett <[EMAIL PROTECTED]> wrote: > > > Interesting, I googled up and found an example of > > this:http://www.quirksmode.org/js/flash_call.html > > > NotjQueryas such in the demo, but any function you write can refer > > tojQuery. > > > On Oct 5, 8:10 am, "Sam Sherlock" <[EMAIL PROTECTED]> wrote: > > > > yourflashwould need to be wmode=transparent > > > > and you'd need to call a javascript function from withinflashthat in turn > > > calls the grey box function > > > > sincejqueryapplies the onclick event to all anchors with a class of > > > greybox you'll need simluar code inside you function that you call from > > >flash. > > > > getURL('javascript:callGreyboxFromFlash()'); > > > > - S > > > > On 04/10/2007, njsuperfreak <[EMAIL PROTECTED]> wrote: > > > > > CanFlashcommunicate withjQuery? I would like to useflashto > > > > interact withjQuerylike opening up a dialogbox using the greybox.js > > > > plugin. How would I go about doing that any ideas? > > > > > The code is activated by the class="greybox"