[jQuery] Re: SproutCore vs jQuery? Are there any comparisons out there?
If you look at their site - it seems it's much more focused on building actual applications. Looking interesting for sure but not sure if a direct comparison with jQuery or the other JS libraries can be made. http://www.sproutcore.com/documentation/getting-started/ Jim > -Original Message- > From: Andy Matthews [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 17, 2008 11:55 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: SproutCore vs jQuery? Are there any > comparisons out there? > > > Yeah...that's what I thought. I've never even heard of it > before WWDC. >
[jQuery] Re: Autocomplete with hidden ID
Richard, Jorn's Autocomplete plugin can be used to do this... http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ On the demo page you can see this in the Multiple Birds (remote) is returning another value in 'hidden input'. Jim > -Original Message- > From: Richard Dyce [mailto:[EMAIL PROTECTED] > Sent: Monday, June 16, 2008 5:17 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Autocomplete with hidden ID > > > Just a quickie - does anyone know of a jQuery plugin for creating an > autocomplete that acts like a i.e. I need people to > search by > name, and have them choose one from the list - but whilst displaying > the name, the form needs to return an associated ID (as well as the > name which will be ignored). > > TIA > > R >
[jQuery] Re: What point i should take care while upgrading to jQuery 1.2.6
> -Original Message- > From: Dushyant Patel [mailto:[EMAIL PROTECTED] > What point i should take care while upgrading to jQuery 1.2.6? > > Can anyone suggest me? I've been updating the application I've been working on with all of the latest releases and haven't run into any issues. Since 1.2.6 now includes the dimensions plugin - if you are using that - you can remove those references and files. Jim
[jQuery] [autocomplete] tab issue with autcomplete plugin
Jörn, have you made any progress on the TAB issue with the Autocomplete plugin? ie: If you in that field and tab away - you loose your tab order. I know it came up in the comments on the plugin page but I haven't heard any more updates on it... Thanks, Jim
[jQuery] Re: Help with W3C validation and jQuery
I'm rethinking my duplicate ID issue. What I'm considering now is giving one field a different name, and if they have JavaScript enabled - rename it... This should pass validation, and work if the user has JavaScript on or off... Jim
[jQuery] Re: Help with W3C validation and jQuery
CDATA tags fixed the IMG issue! Thanks! Jim > -Original Message- > From: tlphipps [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 12, 2008 11:03 AM > To: jQuery (English) > Subject: [jQuery] Re: Help with W3C validation and jQuery > > > You need to put some comment blocks around your Javascript/jquery code > so the validator will ignore it. > > something like this: > > > /* > your script here > > /* ]]> */ > >
[jQuery] Re: Help with W3C validation and jQuery
Yep - I'm running it through the WebDeveloper toolbar in Firefox - Validate Local HTML. Jim > -Original Message- > From: Roncioso [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 12, 2008 10:16 AM > To: jQuery (English) > Subject: [jQuery] Re: Help with W3C validation and jQuery > > > I don't think W3C Validator checks injected dom. > Did you tried to validate the document from local? >
[jQuery] Help with W3C validation and jQuery
I've got a site in which I'm trying to get W3C validated and running into a few issue with jQuery and I wondered how people worked around stuff like this: Here I'm injecting some HTML into my site... // append a graphic * to the req'd fields $('.reqdfield').append(''); W3C validator complains about: -- Line 20, Column 90: document type does not allow element "img" here. ...d.gif" alt="This field is required" />'); The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed). -- I've also got a few places where I have two form fields, one an autocomplete field, the other a static select field (I need to provide this for 508). I'm doing a show/hide with jQuery depending on if the user has JavaScript enabled, and the W3C validator complains about the fields having the same ID... Just curious how people are working around these type of isses using things like jQuery? Thanks, Jim
[jQuery] jQuery and tinyMCE help
I've got a form with several fields and I've added some real simple context help using jQuery with focus and blur. $("[EMAIL PROTECTED], textarea").focus(function() { $(this).next('.contexthelp').show(); }); But not one of the forms is using TinyMCE and I can't for the life of me figure out how to interact with it... I simply want my .contexthelp div to display when the user clicks anywhere in TinyMCE but so far everything I've tried has been unsuccessful. I've trolled the archives but haven't found anything helpful. Any suggestions? Jim
[jQuery] Re: Autocomplete: display errors
> -Original Message- > From: dineshv [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 30, 2008 10:36 PM > To: jQuery (English) > Subject: [jQuery] Autocomplete: display errors > > > My autocomplete is getting data from a server (using a localhost). > I've checked and the data is getting to the browser. But, the items > do not display and I'm continually getting the following set of > errors: > I find Firefox with Firebug installed to be really helpful debugging these kind of odd errors - you can watch what's going on 'behind the scenes' and see what is being returned during the autocomplete. Jim
[jQuery] Re: Checkbox Validation
I highly recommend Jorn's plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ If you check out his demos: http://jquery.bassistance.de/validate/demo/ He has an example of this... see the Topics/newsletter relationship on the second example. Jim -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Sat 3/29/2008 8:06 PM To: jQuery (English) Subject: [jQuery] Checkbox Validation I want to validate some inputs but only if a certain checkbox has been checked, whats the best way to do that? Thank you, Chris <>
[jQuery] Re: [validate] need help with addMethod
> It could be related to a different issue that I solved > recently. Could > you give the latest revision a try? > http://dev.jquery.com/view/trunk/plugins/validate/ I grabbed the latest version and still no luck... A few dumb questions: Where do I place the addMethod: $().ready(function() { == here? == $("#frmtelework").validate({ == or here? == rules: {} }); }); And I'm assuming that if my addMethod check failed - it would flag that field with the error I defined "You must read and agree to the terms and conditions before proceeding."? $.validator.addMethod("checkyesno", function(value) { if (value == 'Yes') { return true; } else { return false; } }, "You must read and agree to the terms and conditions before proceeding."); Thanks for the help!!! Jim
[jQuery] Re: [validate] - Strange problem with validations - fields disappear
> -Original Message- > From: Deep Ganatra [mailto:[EMAIL PROTECTED] > Basicaly I am trying to wrap error in list element so it can fit well > in my design. It works fine at the time of showing the error but once > the value in invalid field has been entered, thet whole field > disappears. I think it is because my elements are also wrapped in LI > and the plugin sets display of LI as non once the field gets > validated. > > Following is my HTML code: > > > First Name : id="first_name" class="inputText required" /> > Last Name : id="last_name" class="inputText required" /> > Yeah - it sound's like you may want to switch the wrapper to use a different element... You can use 'errorplacement' to place the error message in relation to the element that has the error. I know there are a few examples on Jorn's site (in the comments on the main page). An example from my code: errorPlacement: function(label, element) { // this will force all error labels to be placed after the postcontrol element label.insertAfter( element.parents().children('.postcontrol') ); }, Jim
[jQuery] Re: [validate] need help with addMethod
> -Original Message- > From: Jörn Zaefferer [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 26, 2008 2:33 PM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: [validate] need help with addMethod > > > Priest, James (NIH/NIEHS) [C] schrieb: > > Jörn, the issue is it's not a checkbox :) It's a set of > radio buttons: o yes o no > > > > The user must select 'yes' or they can't continue to submit > the form. > > > Okay, if you want to stick with radio buttons for a boolean value, > please post a testpage with what you've got so far. Yes - unfortunately it's a client decision to do the 'yes/no' ... AND it is an intranet page so I have no code to show :( But here is the HTML: I have read these terms and conditions and agree to all of the provisions contained above. Yes No Then for my validation: $.validator.addMethod("checkyesno", function(value) { if (value == 'Yes') { return true; } else { return false; } }, "You must read and agree to the terms and conditions before proceeding."); My rules: rules: { terms: {required: true, checkyesno: true} }, Seems simple but I can't seem to make it work! Thanks for the help! Jim
[jQuery] Re: [validate] need help with addMethod
> -Original Message- > From: Jörn Zaefferer [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 25, 2008 2:05 PM > > My method: > > > > $.validator.addMethod("checkyesno", function(value) { > > if (value == 'Yes') { > > return true; > > } else { > >return false; > > } > > }, > > "You must read and agree to the terms and conditions before > > proceeding."); > > > > My rules: > > > > rules: { > > terms: {required: true, checkyesno: true} > > }, > > > > > > But so far have not been able to make this work... What am I doing > > wrong?? > > > A checkbox' value doesn't depend on the checked state. The > value stays > the same, so you should check the checked-attribute. > > But that isn't necessary either, because the required method already > handles checkboxes (there are plenty examples). > > So whats the issue here? > Jörn, the issue is it's not a checkbox :) It's a set of radio buttons: o yes o no The user must select 'yes' or they can't continue to submit the form.
[jQuery] Need help with a toggle - works if I click twice!
My code: Health Status or Disease 54 Topics - Click To View Acute Lung Injury Agricultural Workers' Diseases Something Something Else My jQuery: $('div.topiccategory').toggle( function () { $(this).next().children().children().show(); }, function () { $(this).next().children().children('ul').children('li').children(':check box').not(':checked').parent().toggle(); }); This works - but I have to click on the category title twice! Argh! :) What am I doing wrong??? I've been tinkering around with it in Firebug but getting nowhere fast. Thanks! Jim
[jQuery] [validate] need help with addMethod
Trying to add a new validation method to check a yes/no set of radio buttons: My method: $.validator.addMethod("checkyesno", function(value) { if (value == 'Yes') { return true; } else { return false; } }, "You must read and agree to the terms and conditions before proceeding."); My rules: rules: { terms: {required: true, checkyesno: true} }, But so far have not been able to make this work... What am I doing wrong?? Thanks! Jim
[jQuery] autocomplete help - make another ajax call when results picked?
I'm using Jorn's Autocomplete plugin and am successfully using it to return a list of users along with a user_ID. What I'd like to do now is when the user selects a person from the autocomplete list - via Ajax take that user_ID, populate a table in my database and return another value . Right now I have: $("#personIDdisplay").result(function(event, data, formatted) { if (data) $('#personID').val(data[1]); }); This populates a hidden field (personID) with the value returned via autocomplete. What I'd like to do is instead that that value (data[1]) and use it to make another Ajax call to run a query and then return another value - but now sure exactly how to do that? :) Is it just a matter of sticking in a ajax call and doing something like this?? (psuedo code) $("#personIDdisplay").result(function(event, data, formatted) { if (data) $.ajax({ url: "dosomething.cfm", data: "id = .val(data[1]) ", success: function (data) { $('#personID').val(data); } }); I'm off to tinker but any feedback would be appreciated! Thanks, Jim
[jQuery] Re: Validate 1.2 Questions
> -Original Message- > From: jason [mailto:[EMAIL PROTECTED] > (1) How do you control where the error label appears for grouped > elements like radio buttons and checkboxes? Right now it's appearing > right after the first one for me. See 'errorPlacement' - example code below - this checks to see if I have a div or span after my label - if so it places the error AFTER those elements. If not it defaults to inserting it right after the label. $("#frmtelework").validate({ errorPlacement: function(label, element) { if ( element.next("div").length ) { label.insertAfter( element.next() ); } else if ( element.next("span").length ) { label.insertAfter( element.next() ); } else { label.insertAfter( element ); } $(label).wrap(''); }, rules: { // to make hidden elements required do: // elementwhichishidden: {required: "#parentelement:visible"}, personIDdisplay:{required: true}, homeaddress1: {required: true}, homecity: .. > > (2) How do you indicate dependencies within the markup, as opposed to > within the plugin call? In other words, if I have a group of radio > buttons, and a text input that is only required if a certain radio > button is checked, can I add something to the markup of the text input > to indicate that? I haven't done that but I think you could use the visible example like I've shown above to do something similar: elementwhichischecked: {required: "#parentelement:checked"} Or something along those lines... Jim
[jQuery] Re: ajaxStart - need a bit of help
Of course as soon as I post something I found this older post by Rey... http://www.mail-archive.com/[EMAIL PROTECTED]/msg16936.html It looks like it does what I need... unless anyone has any other suggestions - or something's been improved since then. Jim > -Original Message- > From: Priest, James (NIH/NIEHS) [C] > Sent: Tuesday, January 29, 2008 3:37 PM > To: jquery-en@googlegroups.com > Subject: [jQuery] ajaxStart - need a bit of help > > > I'm building a form - I've got one field where I'm allowing > the user to > select a radio button (selecting a division) and then doing > an Ajax call > to populate a related text field with a name. I've got a little > animated 'ajaxy' graphic that pops up to show activity: > > > // get division director - via radio button (divisionID) - ajax > call > $("input:radio[name='divisionid']").click(function() { > var foo = $(this).fieldValue(); > $.ajax({ > type: "GET", > url: "index.cfm?action=telework.getchief", > dataType: "html", > cache: false, > data: "divisionid=" + foo, > success: function(msg) { > $('#approval_2_Yes_2').val(foo); > $('#approval_2_Yes_2display').val(msg); > // alert('Division ID = ' + foo); > } > }); > }); > // show loading graphic > $('#loading').ajaxStart(function() { > $(this).show(); > }).ajaxStop(function() { > $(this).hide(); > }); > > But now I'm adding a few fields which are using Jorn's > autocomplete. One > of these fields is right next to the radio buttons above - and when I > enter data - the Ajax call kicks off and my graphic for the > other field > shows up :\ > > If it possible to define WHICH Ajax call you want the > ajaxStart applied > too? Or is there a better way to tackle this?? > > Thanks, > Jim >
[jQuery] ajaxStart - need a bit of help
I'm building a form - I've got one field where I'm allowing the user to select a radio button (selecting a division) and then doing an Ajax call to populate a related text field with a name. I've got a little animated 'ajaxy' graphic that pops up to show activity: // get division director - via radio button (divisionID) - ajax call $("input:radio[name='divisionid']").click(function() { var foo = $(this).fieldValue(); $.ajax({ type: "GET", url: "index.cfm?action=telework.getchief", dataType: "html", cache: false, data: "divisionid=" + foo, success: function(msg) { $('#approval_2_Yes_2').val(foo); $('#approval_2_Yes_2display').val(msg); // alert('Division ID = ' + foo); } }); }); // show loading graphic $('#loading').ajaxStart(function() { $(this).show(); }).ajaxStop(function() { $(this).hide(); }); But now I'm adding a few fields which are using Jorn's autocomplete. One of these fields is right next to the radio buttons above - and when I enter data - the Ajax call kicks off and my graphic for the other field shows up :\ If it possible to define WHICH Ajax call you want the ajaxStart applied too? Or is there a better way to tackle this?? Thanks, Jim
[jQuery] Re: http://jquery.com/api/ page broken
> -Original Message- > From: Benjamin Sterling [mailto:[EMAIL PROTECTED] > Sent: Monday, January 28, 2008 9:56 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: http://jquery.com/api/ page broken > > The http://jquery.com/api/ is outdated; the docs for the > current jQuery version is at http://docs.jquery.com/. Would it be possible to redirect /api => docs.jquery.com??? There are a few of these floating around... http://jquery.bassistance.de/api-browser/ Or maybe add a note that says "Official documentation/API is located... here" Seems like it would at least eliminate SOME of the confusion... :) Jim
[jQuery] Re: A Beginner Question
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > > You could use John Resig's .nextUntil() method. Karl - is that documented anywhere on the jQuery site - or any plans to incorporate that into the core? I saw a reference of that somewhere yesterday (maybe on your site) but I couldn't find it in the official docs so I figured it might have been old or depreciated. I'm going to save it now though :) Thanks! Jim
[jQuery] Re: A Beginner Question
> -Original Message- > From: Volkan Görgülü [mailto:[EMAIL PROTECTED] > > What I want to achieve is whenever I click an tag in I want > to show tags inside the clicked Look at your code - you are saying "when I click a DT" do toggle... but you aren't defining which dt. So of course it applies it to all of them. What you need to investigate is "this" ... Some psuedo code which should get you close: $('dt').click(function() { $(this).next().toggle(); }); So now it's saying - when you click THIS dt, toggle the next dd. Not sure exactly how you'd get all the dd's below the parent dt... Took me awhile to get my head around 'this' but now it completely makes sense. Jim
[jQuery] Re: Debug Tools - Charles, DebugBar, Firebug Lite
> -Original Message- > From: Phil Glatz [mailto:[EMAIL PROTECTED] > Sent: Friday, January 04, 2008 11:14 AM > To: jQuery (English) > Subject: [jQuery] Re: Debug Tools - Charles, DebugBar, Firebug Lite > > I use the Microsoft Virtual PC: > http://pingv.com/blog/glhines/200712/browser-testing-ie6 > I use that as well. I remember at one point people were wondering how isolated the different IE's were when installed on the same machine (considering the number of hooks IE has into the OS). Using a VM you are sure it's IE6 and only IE6. Jim
[jQuery] Re: Using jQuery in Wordpress
> -Original Message- > From: Benjamin Sterling [mailto:[EMAIL PROTECTED] > Not sure how to include what they have in the core, but I > think it is out of date anyways. I didn't even mess with trying to get whatever is included working - I didn't want to get stuck using an old version, etc. I just dumped jQuery in the root of my site and called it in my template header.php... Shameless plug for my wife's site: http://www.yourdoorandmore.com/ I want to next build a little gallery using the cycle plugin w/pager as well... http://www.malsup.com/jquery/cycle/pager3.html Jim
[jQuery] Re: Jquery Lightbox or Thickbox and Flickr?
> -Original Message- > From: bdee1 [mailto:[EMAIL PROTECTED] > i want to set up a photo gallery for a clients site and would > like to use the > http://leandrovieira.com/projects/jquery/lightbox/ Jquery > LightBox plugin > or somethign similar. that par is easy but i would like to > be able to use > images from flickr. that way the client would be able to I'm digging around looking for the same thing: http://www.projectatomic.com/en/flickr.htm Still in alpha though... Jim
[jQuery] Re: If I'm using toggle, how do I check if it's shown or hidden?
FYI - I added this to the FAQ: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_determine_the _state_of_a_toggled_element.3F Feel free to edit if there are better/additional methods. Jim
[jQuery] Re: Cycle Plugin help request (IE6/7 issue)
I'd check your CSS. I had to define the image size for the container holding my images in my CSS: .pics { height: 320px; width: 450px; padding: 0; margin: 0; } >From his site: "CSS Rules! When building your slideshows, remember that animation effects work best when both the container and slide have a fixed box." HTH Jim > -Original Message- > From: objective [mailto:[EMAIL PROTECTED] > Sent: Monday, December 17, 2007 8:58 AM > To: jQuery (English) > Subject: [jQuery] Cycle Plugin help request (IE6/7 issue) > > > Hey guys and gals... I'm having a little issue with this plugin and > was wondering if you could help. In my free time, I produce html > templates from other designer's PSDs and today I'm having an issue > with a slideshow I've implemented. Everything works fine in Firefox/ > Safari (both platforms) but IE is choking completely. You can see my > example here... http://www.objectivegiant.com/test/trc/index.html
[jQuery] Re: [SITE SUBMISSION] YourDoorandMore.com
> -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > Here's a new site from Jim Priest: > > http://www.yourdoorandmore.com/ Geez Rey - do you ever sleep :) Yep - I setup a little animation with the Cycle plugin over the weekend! Like everything else jQuery it was WAYYY too easy! Thank you Mr. Alsup! Next up is some kind of gallery... Jim
[jQuery] Re: animation: sequential showing / hiding : how-to?
> -Original Message- > From: Alexandre Plennevaux [mailto:[EMAIL PROTECTED] > now, it was suggested by my mate that they appear one after > the other, according to, say, their order of appearance in > the html markup. Not sure of your markup but maybe the Cycle plugin? jim
[jQuery] Re: cf ajax example
See if this helps?? http://www.thecrumb.com/2007/11/30/fetching-data-with-jquery/ What is the code for: req_processor_employee.cfm Jim > -Original Message- > From: interarnett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 12, 2007 6:42 PM > To: jQuery (English) > Subject: [jQuery] cf ajax example > > > I have created a simple app screen based off of the example/tutorial > on jquery website for coldfusion and ajax. > > I have firebug running and have stepped through the entire process. > All processes seem to be working correclty, I fill a value in a > formfield and onblur a query is invoked and dataset is returned. > (Which i can see in console in firebug...) > > I am just unable to get the values to display back on my screen in the > section defined via style sheet. > > There is a parameter for success in ajax call. > Success never happens it only comes back and says that there is an > error but do not know how to trap for error... > > Any help will be greatly appreciated > > here is javascript > // > // $(document).ready(function(){ > //$("#idm").blur( function() { > //var formval = { > idm:$(this) .val()}; > //$.ajax({ > // type: "POST", > // url: > "req_processor_employee.cfm", > // dataType: "json", > // data: formval, > // success: function(response){ > //$ > ('#contentdiv').empty().fadeIn(2000).append(response.rname); > } > }); > }); > > }); > // > > sytle sheet > > body {font-family: Arial, Helvetica, sans-serif;} > #databox { border: 1px solid Gray; >margin:30px auto 0px auto; >padding: 10px; >width: 200px;} > #contentdiv { color:red; font-size: 30px; margin-top: 10px;} > > > form field > > > id="idm" maxlength="6"> > > > > > >
[jQuery] redundancy - dimensions plugin and toggle?
I've got some toggle code where I want to check the height of something using the dimensions plugin and am not sure the best way to do this: $('.container').toggle( function() { $(this).removeClass('right').addClass('down'); // check height of window and if too tall - show bottom nav if ($('#wrapper').height() > 400) { $('#bottomnav').show(); } else { $('#bottomnav').hide(); }; }, function() { $(this).removeClass('down').addClass('right'); // check height of window and if too tall - show bottom nav if ($('#wrapper').height() > 400) { $('#bottomnav').show(); } else { $('#bottomnav').hide(); }; }); Seems like I should be able to simplify the height check instead of doing everything twice??? Thanks, Jim
[jQuery] Re: [NEWS] Getting jQuery Adopted in Corporations
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Although I keep coming up against the following: > > 1. Is jQuery going to be here for the long term? > 2. Why not use prototype, what are the benefits of jQuery over it? > > I've tried to answer these the best I can to my team, but if anyone > else fancies helping me convince them post up some more reasons on why > jQuery is the right framework to use. I just started using it on small projects - and then when the topic of javascript libraries came up - I already had a foot in the door. :) I'm not sure 'long term' and internet go together but I think with more and more big players using jQuery (Google!) that it will be around in some form or fashion for a long time. Jim
[jQuery] Re: jQuery taking a second or two to load?
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > // regular toggle with speed of 'default' > $('#toggle_atRisk').click(function(){ > $('#atRisk').toggle('default'); 'default' is not a valid speed? Speed: A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). Event: http://docs.jquery.com/Events/toggle#fnfn Effect: http://docs.jquery.com/Effects/toggle Jim
[jQuery] Fetching data with jQuery tutorial
Before Rey beats me to it :) I typed up a quick tutorial on my first use of Ajax w/jQuery: http://www.thecrumb.com/2007/11/30/fetching-data-with-jquery/ Just like everything else I've done with jQuery it was easy and quick to implement :) Soon as I have some time I'm also going to post the final results of my checkbox show/hide code which several people on the list (Karl, Trevor, etc) helped me with. Jim
[jQuery] Re: Explaining this or .this or .this()
I think you could do something like: $("div").each(function() { $(this).css('color', 'red'); }); Basically all this is doing is looping over each DIV on your page and at each DIV (this) it's changing the color of that div. Here is another one I did for a recent project - I have a list of div's each with a 'container' class: Item 1 Item 2 Item 3 Item 4 Item 5 I wanted to highlight the background of each div as the user rolled their mouse over them - this was basically a hack for IE6: $('div.container').hover(function() { $(this).addClass('pretty-hover'); }, function() { $(this).removeClass('pretty-hover'); }); Again - this is just saying - when you hover your mouse over THIS div.container - add a class. When you move your mouse off of it - remove the class. I think if you tinker around with stuff like this a bit - it start to click. Jim > -Original Message- > From: FrankTudor [mailto:[EMAIL PROTECTED] > I can't 'write' or 'create' in the environment i working. Could you > maybe work the example so that it outputs to the screen. I can make a > sample file with 'div' tags point to my jquery.js file. I have done > jquery scripts without the 'this' part and I would attempt to change > it but 'this' is a stumper for me. >
[jQuery] Re: hide/show (trying to prevent inline loop code)
I'm working on something similar - can you post your HTML and jQuery code?? Here's my thread: http://groups.google.com/group/jquery-en/browse_thread/thread/4c30c5ae19 ce901c/d6be93a0dd4fc205?lnk=gst&q=hiding+checkbox#d6be93a0dd4fc205001 Jim > -Original Message- > From: FrankTudor [mailto:[EMAIL PROTECTED] > Sent: Monday, November 19, 2007 10:16 AM > To: jQuery (English) > Subject: [jQuery] hide/show (trying to prevent inline loop code) > > > Hi all, I an trying to create a simple hide/show toggle with jQuery, > but My content loops over a query and so when I test it it opens all > my table blocks (since they have Identical code duplicated to the > length of the records). > > So then I got cleaver and created a variable that generates a random > number every time the code iterates the loop. > > But then I have all these copies of something that needs to be only > created once. > > So would other people manage this? > > Thanks, > Frank >
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > Isn't that what this does? > $(this).next('div:hidden').slideDown('fast').siblings('div:vis > ible:not(:has(input:checked))').slideUp('fast'); This is getting closer: $(this).next('div:hidden').slideDown('fast').siblings().find('input:chec kbox').not(':checked').parent().hide(); But then it won't expand a .details with only unchecked items. Jim
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Priest, James (NIH/NIEHS) [C] > Last question - would it be possible to have it collapse the > checkboxes > both when you click on the parent H3 or any other H3 (as it does now)? > That may not be possible but what do I know :) I'm going to show this > as it is now which may be good enough... Actually I'm tinkering with Karl's latest example with a greater data set (eventually there may be 100 checkboxes in each topic) - and the only problem is that Topics with NO checked items don't collapse... I had this sort of working with my attempt at hacking your show/hide accordian code (from learningjquery.com) but I'm stuck at the point where I collapse things and hide the unchecked items... hence my color change experiment below... // scrollTo: function will scroll the page back to the top when a user collapses a div near the bottom of the page $.fn.extend({ scrollTo : function(speed, easing) { return this.each(function() { var targetOffset = $(this).offset(); $('html').animate({scrollTop: targetOffset}, speed, easing); }); } }); $(document).ready(function() { // toggle the visibility of each topic when another is selected $('div.topiclist> h3').click(function() { // call custom function to scroll up $(this).scrollTo(); // switch graphic indicator $(this).removeClass('right').addClass('down').siblings('h3').removeClass ('down').addClass('right'); // hide unchecked items (for testing those are red) $(this).next('div:hidden').slideDown('fast').siblings('div:visible:not(: has(input:checked))').slideUp('fast').siblings().find('input:checkbox'). not(':checked').parent().css('color', 'red'); I'm trying to write this out so it makes sense (for you and me) :) --- 1) When the page initially loads - the topics list is collapsed with only the first topic expanded showing the list of unchecked items (this assumes ALL checkboxes are unchecked initially). Topic 1 0 item 1 0 item 2 Topic 2 Topic 3 --- 2) User then selects Topic 2 Topic 1 Topic 2 0 item 1 0 item 2 Topic 3 --- 3) User checks item 2 - then selects Topic 3 Topic 1 Topic 2 x item 2 Topic 3 0 item 1 0 item 2 --- 4) User selects Topic 1 Topic 1 0 item 1 0 item 2 Topic 2 x item 2 Topic 3 --- 5) User checks item 1 & 2 then selects Topic 2 Topic 1 x item 1 x item 2 Topic 2 0 item 1 x item 2 Topic 3 --- Does that even remotely make sense Jim
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > It's showing the very next div, and then hiding any other > sibling div that does not have a checked input. I must be > misunderstanding something. In the html snippet you provided, > you had one checkbox per div.details and one div.details per > h3. Will there be multiple checkboxes inside a div.details? > Will there be multiple div.details following each h3? If so, > that could change the equation. Karl - sorry the example HTML wasn't clear - it's ColdFusion and is dynamically generating the list... So yes - I'll have only ONE H3 per .details, and then MULTIPLE checkboxes per .details!! It DOES work in that it won't collapse if there is a checkbox checked. I just need to hide the unchecked ones. Then I'm thinking I could add an element at the bottom of the list that says "Show unchecked items" or something... or maybe a global 'show all' which I sort of have working already. Here is an example of the actual rendered HTML from ColdFusion: === Disease or Condition Acute lung injury ADHD Agricultural workers' diseases Major Scientific Discipline Applied mathematics Biochemistry Biophysics Thanks so much for the assistance!!! Jim
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > Sent: Friday, November 16, 2007 12:31 PM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: hiding checkbox AND label? > I think I'm beginning to understand what you're trying to do > here. I'm a little slow. ;-) > > When the user clicks on an h3, the following will happen: > 1. all div.details with ALL checkboxes inside of them > UNchecked will show all of their checkboxes (and labels) > 2. all other unchecked checkboxes (excluding those in #1) > will be be hidden > 3. all checkboxes -- unchecked or checked, doesn't matter -- > in the div.details immediately following the clicked h3 will be shown > > Let me know if I'm still not getting it. Otherwise, enjoy: Karl - you are NOT slow - I'm just doing a terrible job at describing things! :) This is REALLY close. I'm going over your code - I *knew* it would need to loop over an if/else just didn't know how! :) I'm going to have to tinker with your code to see what it's doing exactly :) :) Last question - would it be possible to have it collapse the checkboxes both when you click on the parent H3 or any other H3 (as it does now)? That may not be possible but what do I know :) I'm going to show this as it is now which may be good enough... Thanks so much for this! Now I'm off to the docs to see what all this is doing... I saw .end() in the docs but couldn't figure out how you'd use that and I see you used it here... :) Jim
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: trevorp [mailto:[EMAIL PROTECTED] > You started a new topic and abandoned your last one, not sure if > that was on purpose or not, but the code I pasted at the end of the Unintentional - it was an Outlook glitch on my part! > For your reference, the other topic is located at: > http://groups.google.com/group/jquery-en/browse_thread/thread/ > f95d372a5bf258e0?hl=en > Just copy and paste that into a page to test functionality. The > only thing I omitted is the inclusion of your jquery library. Trevor - I think I tried this a bit and then changed my inputs to use labels and then ran into issues and then got sidetracked trying to use Karls show/hide examples on learningjquery.com... :( I just changed my code around and got your example working too! It is a bit simpler functionality compared to the one Karl has been helping me with but it DOES work! I'll keep this one as 'Example Two' when I show it! Thanks! Jim
[jQuery] Re: hiding checkbox AND label?
Sorry - I hate Outlook... > > -Original Message- > > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > > > $('div.demo-show:eq(0) ... > > > > I doubt you'll need the :eq(0) part, and the "demo-show" > > class was for a demo, so you can safely change that in the > > HTML and match the change in the jQuery. > > Yeah - I just wanted to keep it the same to make sure I wasn't messing > something up! :) > > > $(this).next('div:hidden').slideDown('fast').siblings('div:vis > > ible:not(:has(input:checked))').slideUp('fast'); > > SO CLOSE! What I really need - is when the div collapses - is to HIDE > the unchecked items: > > Topics 1 0 item 1 0 item 2 0 item 3 Topics 2 Topics 3 So user selects Topics 1 x item 1 0 item 2 x item 3 Topics 2 Topics 3 And then clicks Topics 2 they would see: Topics 1 x item 1 x item 3 Topics 2 0 item 1 0 item 2 0 item 3 0 item 4 Topics 3 Hope that makes sense... This is really close - I'm going to tinker with it a bit but would love to hear your input! Jim
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > $('div.demo-show:eq(0) ... > > I doubt you'll need the :eq(0) part, and the "demo-show" > class was for a demo, so you can safely change that in the > HTML and match the change in the jQuery. Yeah - I just wanted to keep it the same to make sure I wasn't messing something up! :) > $(this).next('div:hidden').slideDown('fast').siblings('div:vis > ible:not(:has(input:checked))').slideUp('fast'); SO CLOSE! What I really need - is when the div collapses - is to HIDE the unchecked items: Topics 1 0 item 1 0 item 2 0 item 3 Topics 2 Topics 3 So user selects
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > Forgive me if you've already posted it, but would you mind > showing us the HTML? Labels can wrap around an input, but > they don't have to, so seeing what the relationship is > between the label and the input (checkbox) would help tremendously. Karl - sorry - code would help huh :) I was thinking about wrapping the label around the input - guess I could go either way on that one - but here's my current HTML (this is actually wrapped up in a ColdFusion loop so it outputs a huge list of topics and categories: Topic 1 0 item 1 0 item 2 Topic 2... 0 item 1 0 item 2 etc... HTML == TOPIC #qryTopics.topic# jQuery === // need to make this a function so we can re-apply row striping after collapse/expand?? $('label:odd').removeClass('even').addClass('odd'); $('label:even').removeClass('odd').addClass('even'); // show all unchecked by default? $('h3').click(function() { // show details div $(this).next().toggle("fast"); // toggle arrow indicator if expanded $(this).toggleClass('down').toggleClass('right'); // hide unchecked items (need to add some logic to show if none are checked $(this).next('.details').find('input:checkbox').not(':checked').parent() .hide(); }); This 'sort of' works. I can check the boxes - click on the H3 and then when I re-expand the H3 - I only see the checked items. The problem is if the user hides a topic without checking anything - I need to add in some logic - if NONE of them are checked to allow them to see all the unchecked items again - that's todays challenge... ;) Thanks for any insight you can offer! I learned a lot yesterday just in trial and error - but I'm always wondering when I do things in jQuery if it's the 'best' way... :) Jim
[jQuery] jQuery site down - docs
Anyone have an alternate URL for the jQuery docs - seems like the site is down and I need help :) Thanks, Jim
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > Forgive me if you've already posted it, but would you mind > showing us the HTML? Labels can wrap around an input, but > they don't have to, so seeing what the relationship is > between the label and the input (checkbox) would help tremendously. Karl - I've refactored this a bit after finding your show/hide example on learningjquery.com: HTML == #qryTopics.category# #qryTopics.topic# jQuery == $.fn.extend({ scrollTo : function(speed, easing) { return this.each(function() { var targetOffset = $(this).offset(); $('html,body').animate({scrollTop: targetOffset}, speed, easing); }); } }); $(document).ready(function() { $('div.demo-show:eq(0)> div:gt(0)').hide(); $('div.demo-show:eq(0)> h3').click(function() { $(this).removeClass('right').addClass('down').siblings('h3').removeClass ('down').addClass('right'); $(this).next('div:hidden').slideDown('fast').siblings('div:visible').sli deUp('fast'); $(this).scrollTo(1000); }); }); Now all I'd like to do is when the divs collapse - if there are checked items within it - keep them visible... Jim
[jQuery] Re: hiding checkbox AND label?
> -Original Message- > From: Gordon [mailto:[EMAIL PROTECTED] > > Be aware there is a slight speed penalty for using classes instead of > IDs, and there's a quite substantial speed penalty for using [] > attribute matching instead of IDs or classes. For that reason I'd > recommend using IDs or classes and try to avoid the fancier > selectors. Your web app will be snappier for it. > > Don't know how helpful this is but I hope you can find some use for > it. Gordon - thanks so much for this!! One thing I struggle with using jQuery is I know it *can* be done but am not sure of the best way or the alternatives (and their drawbacks)!! Jim
[jQuery] Re: how to loop over checkboxes and hide the UNchecked ones?
So far I've got this: $('h3').click(function() { $(this).next().toggle("fast"); $(this).toggleClass('down').toggleClass('right'); $(this).next('.details').find('input:checkbox').not(':checked').parent() .hide(); }); Which is getting closer. Upon page load - I see everything - then I check some items and if I click the H3 topic header - my div collapses and if I re-open - I only see the checked ones. Now I think I can maybe insert another checkbox at the end of the collapsed list: Topic x item 1 x item 4 0 view unchecked items And when they click on that - see everything again... Jim > -Original Message- > From: trevorp [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 14, 2007 2:41 PM > To: jQuery (English) > Subject: [jQuery] Re: how to loop over checkboxes and hide > the UNchecked ones? > > > Not necessarily elegant, but it works: > [using your previous code starting with $(this).next() and going from > there.] > > $('h3').click(function() { > $ > (this).next().children('div').children(':checkbox').not(':chec > ked').parent('div').toggle("fast"); > }); > > This assumes you have the following structure: > > > Heading 1 > > > > > cbcb1 > > > > cbcb2 > > > > > Heading 2 > > > > > cbcb1 > > > > cbcb2 > > > > cbcb3 > > > > the ids are entirely not necessary, just a habit. > > -Trevor > > On Nov 14, 12:38 pm, "Priest, James (NIH/NIEHS) [C]" > <[EMAIL PROTECTED]> wrote: > > Well I've got this: > > > > $('h3').click(function() { > > //$(this).next().toggle("fast"); > > $(this).toggleClass('down').toggleClass('right'); > > > > $("input:checkbox").not(":checked").parent().next().hide(); > > }); > > > > And that hides the checkbox - but I need to hide the > associated label as > > well. The parent().next() doesn't work above - I get one extra > > (unchecked) item in each group... :( > > > > Jim > > > > > -Original Message- > > > From: tlphipps [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, November 14, 2007 12:05 PM > > > To: jQuery (English) > > > Subject: [jQuery] Re: how to loop over checkboxes and hide > > > the UNchecked ones? > > > > > You might try this instead of using .each() > > > UNTESTED: > > > $("input:checkbox").not(":checked").hide(); > > > > > On Nov 14, 10:16 am, "Priest, James (NIH/NIEHS) [C]" > > > <[EMAIL PROTECTED]> wrote: > > > > I've got a series of topics - each with a list of checkboxes. > > > > > > Topic > > > > 0 item 1 > > > > 0 item 2 > > > > 0 item 3 > > > > > > When the user clicks the topic - I have the checklist > > > show/hide using > > > > toggle(). What I'd like is when the list closes - the > > > 'checked' items > > > > remain visible. > > > > > > Topic > > > > X item 2 > > > > X item 3 > > > > > > I'm struggling with how to loop through the list of > checkboxes?? My > > > > attempt to use .each() isn't working?? > > > > > > $('h3').click(function() { > > > > // $(this).next().toggle("fast"); > > > > // > $(this).toggleClass('down').toggleClass('right'); > > > > > > $('input:checkbox').each( function() { > > > > var checked_status = this.checked; > > > > if (!checked_status) > > > > { > > > > $(this).hide(); > > > > } > > > > }); > > > > }); > > > > > > Thanks, > > > > Jim > >
[jQuery] hiding checkbox AND label?
Argh - I'm close - but so far I can't seem to hide BOTH the checkbox and label: $('h3').click(function() { $(this).next('.details').find("input:checkbox").not(":checked").hide(); }); OR $('h3').click(function() { $('input:checkbox').each(function() { if (!this.checked) { $(this).next().hide(); } }); }); Both hide the checkbox only. The label remains!! I've tried a few things with parent().next() but either I can remove the checkbox OR the label but never both?? I'm sure I'm missing something simple here Thanks, Jim
[jQuery] Re: how to loop over checkboxes and hide the UNchecked ones?
Well I've got this: $('h3').click(function() { //$(this).next().toggle("fast"); $(this).toggleClass('down').toggleClass('right'); $("input:checkbox").not(":checked").parent().next().hide(); }); And that hides the checkbox - but I need to hide the associated label as well. The parent().next() doesn't work above - I get one extra (unchecked) item in each group... :( Jim > -Original Message- > From: tlphipps [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 14, 2007 12:05 PM > To: jQuery (English) > Subject: [jQuery] Re: how to loop over checkboxes and hide > the UNchecked ones? > > > You might try this instead of using .each() > UNTESTED: > $("input:checkbox").not(":checked").hide(); > > On Nov 14, 10:16 am, "Priest, James (NIH/NIEHS) [C]" > <[EMAIL PROTECTED]> wrote: > > I've got a series of topics - each with a list of checkboxes. > > > > Topic > > 0 item 1 > > 0 item 2 > > 0 item 3 > > > > When the user clicks the topic - I have the checklist > show/hide using > > toggle(). What I'd like is when the list closes - the > 'checked' items > > remain visible. > > > > Topic > > X item 2 > > X item 3 > > > > I'm struggling with how to loop through the list of checkboxes?? My > > attempt to use .each() isn't working?? > > > > $('h3').click(function() { > > // $(this).next().toggle("fast"); > > // $(this).toggleClass('down').toggleClass('right'); > > > > $('input:checkbox').each( function() { > > var checked_status = this.checked; > > if (!checked_status) > > { > > $(this).hide(); > > } > > }); > > }); > > > > Thanks, > > Jim > >
[jQuery] Re: how to loop over checkboxes and hide the UNchecked ones?
Sweet - that DOES work! One step closer!! Thanks, Jim > -Original Message- > From: tlphipps [mailto:[EMAIL PROTECTED] > You might try this instead of using .each() > UNTESTED: > $("input:checkbox").not(":checked").hide();
[jQuery] how to loop over checkboxes and hide the UNchecked ones?
I've got a series of topics - each with a list of checkboxes. Topic 0 item 1 0 item 2 0 item 3 When the user clicks the topic - I have the checklist show/hide using toggle(). What I'd like is when the list closes - the 'checked' items remain visible. Topic X item 2 X item 3 I'm struggling with how to loop through the list of checkboxes?? My attempt to use .each() isn't working?? $('h3').click(function() { // $(this).next().toggle("fast"); // $(this).toggleClass('down').toggleClass('right'); $('input:checkbox').each( function() { var checked_status = this.checked; if (!checked_status) { $(this).hide(); } }); }); Thanks, Jim
[jQuery] issue with new UI Datepicker
I'm trying to roll out a form with the new UI Datepicker and have an odd issue... Using the 'dialog' mode - I'm getting a form field popping up along with the calendar. I don't see this behavior on the demo - but I've stripped my code down to the bare minimum - grabbed all the latest (datepicker and BlockUI)out of the repo, still no luck. Screenshot: http://www.thecrumb.com/datepicker.gif Anyone using this successfully?? Jim
[jQuery] Re: Query for elements without a specific parent
> -Original Message- > From: Karl Swedberg [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 31, 2007 11:51 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: Query for elements without a specific parent > > I don't think next() will work in this case. Jochen is > dealing with parents and children here, and next() deals with > siblings. > > Jochen, try this instead: > > $('b').filter(function() { > return !$(this).parent('p').length; > }) > Karl - thanks for the clarification - I'm still learning! :) Jim
[jQuery] Re: Query for elements without a specific parent
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Text1 > Text2 > > How can I select the second , which is not a child of a ? As I > am a newbie, I played a little bit around with :not, filter(), but > unfortunately Use next()?? http://docs.jquery.com/Traversing/next#expr Jim
[jQuery] Re: Autocomplete - which one??
> -Original Message- > From: sgrover [mailto:[EMAIL PROTECTED] > touched in a while). I'm looking for suggestions on which is the > "recommended" plugin, and is relatively easy to use. I've had great luck with Jorn's version... http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ Good docs. Not sure about formatting - I've always stuck with the standard output with a few CSS tweaks. Jim
[jQuery] reproducing old Interface effects w/jQuery 1.2
Just curious if anyone had any examples of reproducing the old Interface effects: Highlight, bounce, etc... with jQuery 1.2?? Thanks, Jim
[jQuery] Re: pulling my hair out with validation plugin and radio/checkboxes
> -Original Message- > From: Priest, James (NIH/NIEHS) [C] > I'm using Jorn's validate plugin and have everything working great > except for the 'required' error messages for radio and > checkboxes. I've > dug through the comments, API and examples but am stuck... Arg - nevermind!! I'm going to develop a mailing list that simply goes to /dev/null because it seems like everytime I have an issue I resolve it immediately AFTER posting to a mailing list... I won't figure it out though until I hit 'send'. Just typing it up is not enough! :) I realized Jorn was included an additional label for the radio buttons and it is used for displaying errors... Jim
[jQuery] pulling my hair out with validation plugin and radio/checkboxes
I'm using Jorn's validate plugin and have everything working great except for the 'required' error messages for radio and checkboxes. I've dug through the comments, API and examples but am stuck... What I want: o Item 1 o Item 2 Error message goes here... What I'm getting: o Error message Item 1 o Item 2 Any ideas what I could be doing wrong??? Jim
[jQuery] Re: how to reset hidden radio fields???
> -Original Message- > From: Priest, James (NIH/NIEHS) [C] > Sent: Wednesday, October 24, 2007 9:33 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] how to reset hidden radio fields??? > > > What I'd like to do is if the user clicks 'yes', then 'no' again - > hiding the optional questions - I'd like to clear any they might have > checked in the optional question. So if they click 'yes' again - they > are presented with a clean slate. OK - I've re-written things: $("[EMAIL PROTECTED]'flexschedule']").click(function() { var mycheck = $("[EMAIL PROTECTED]'flexschedule']:checked").val(); if (mycheck == 'No') { $('##flexsched, ##flexother').hide('fast') $("[EMAIL PROTECTED]'scheduleID']").attr('checked', ''); $("[EMAIL PROTECTED]'FlexOTHER']").attr('value', ''); } else { $('##flexsched').show('fast'); }; }); And this seems to do what I want. Yeah for jQuery! If anyone has any suggestions on how to further improve the above - let me know :) Jim
[jQuery] how to reset hidden radio fields???
I've got a series of yes/no question - if the user selects 'yes' - I display a hidden div with additional questions: $("#flexsched").css('display', 'none'); $("[EMAIL PROTECTED]'flexschedule']").click(function() { $("[EMAIL PROTECTED]'flexschedule']:checked").val() == 'No' ? $('#flexsched').hide('fast') : $('##flexsched').show('fast') }); What I'd like to do is if the user clicks 'yes', then 'no' again - hiding the optional questions - I'd like to clear any they might have checked in the optional question. So if they click 'yes' again - they are presented with a clean slate. So far I haven't had any success... Any ideas? Thanks!!! Jim
[jQuery] Re: looking for advice on the best way to do this... autocomplete then fetch more data
> -Original Message- > From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] > This is actually pretty easy to accomplish. If you're only > passing back a > few pieces of information, you could pass the data back with the > autocomplete matches. The advantage of this is you don't have > to do another > lookup. The disadvantage, and it can be a big one, is that > you can really > increase the amount of data required to be sent on each > lookup. If there's a > lot of matches and a lot of data you're passing back, this can be > problematic for several reasons (memory consumption in the browser and > bandwidth issues.) Dan - thanks for the reply! I'll have to try it both ways and see what the performance hit is with the additional data... May have more questions later :) Jim
[jQuery] Re: Unsubscribe
> How can I unsubscribe from the JQuery mailing list? Thanks! > You can also send an email from the acct you signed up with to: [EMAIL PROTECTED] Jim
[jQuery] looking for advice on the best way to do this... autocomplete then fetch more data
I've got an autocomplete field (based on Jörn Zaefferer's plugin) which works great. I'm using it to grab a user from a database. What I need to do now is after the user selects their choice from the dropdown - I need to return to the db and grab more info based on their choice (address, etc). Or can I somehow return that data with the original query? Not sure which would be best performance wise... Still getting my feet with with Ajax and not sure the best way to do this - looking for advice and suggestions :) Thanks! Jim
[jQuery] Re: AjaxCFC + jQuery tutorial: part 2
http://cjordan.us/index.cfm/2007/10/18/jQuery--AjaxCFC-Tutorial-Part-2-H andling-Complex-Data Jim > -Original Message- > From: Andy Matthews [mailto:[EMAIL PROTECTED] > Sent: Friday, October 19, 2007 9:16 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: AjaxCFC + jQuery tutorial: part 2 > > I'll forgive your lateness if you post the link. > > > > From: jquery-en@googlegroups.com > [mailto:[EMAIL PROTECTED] On Behalf Of Chris Jordan > Sent: Thursday, October 18, 2007 11:35 PM > To: jQuery Group > Subject: [jQuery] AjaxCFC + jQuery tutorial: part 2 > > > I realize that this is way late in coming, but I've > finally put together part two of the AjaxCFC + jQuery > tutorial. I feel seriously guilty about not getting it out > before now, so I hope anyone who was interested in seeing it > still is, will forgive my lateness in getting it published, > and will find it useful and informative. >
[jQuery] Help with button script
I'm trying to implement some code I found here - basically just trying to learn more about jQuery: http://monc.se/kitchen/59/scalable-css-buttons-using-png-and-background- colors#comment-15755 $('.btn').each(function(){ var b = $(this); var tt = b.text() || b.val(); if ($(':submit,:button',this)) { if (this.href) { b = $('').insertAfter(this).addClass(this.className).attr('id',this.id).attr ('href',this.href); } else { b = $('').insertAfter(this).addClass(this.className).attr('id',this.id); } $(this).remove(); $('#'+this.id).click(function(){$(this).parents('form').submit();}); } b.text('').css({cursor:'pointer'}). prepend('').append($("").text(tt).append("")); }); This is throwing a "Node cannot be inserted at the specified point in the hierarchy" code: "3" error and I'm stuck and not sure how to debug - I'm using Firebug but haven't been able to pull anything useful. I'm using jQuery 1.2.1. Any ideas what is wrong? Thanks, Jim
[jQuery] Re: Opinions on YUI?
> -Original Message- > From: Glen Lipka [mailto:[EMAIL PROTECTED] > A great way to decide is to take a few of your "real" > use-cases. Try to implement in both libraries. > Then compare the results. Was it fun? Was it quick? Is it > maintainable? What is the code size? > Have a new person look at them both and ask, "Can you tell > what this code is doing?" > Then try again with a different usecase. Glen (and everyone else!) thanks for the feedback. I was thinking about doing this last night... I have 2-3 very simple jQuery scripts - I'll try to replicate them in YUI and then compare the code, etc. It will be a good 'real world' test - esp. since I'm still a relative newbie at jQuery as well... I think the big upswing in the Google Trends graph is due to the Ben's vibrate code... :) Jim
[jQuery] Opinions on YUI?
Tomorrow in our weekly meeting someone is going to discuss YUI and the possibilities of adopting it as a standard. I'm looking for opinions why jQuery may be a better choice!! :) I know this is a delicate topic and that there is no 'right' answer... Feel free to email me offlist if you like. Does anyone know of any kind of javascript library matrix that compares the feature sets of all the popular libraries?? Thanks, Jim
[jQuery] Re: Compressing your js files with Ant
> -Original Message- > From: Stephan Beal [mailto:[EMAIL PROTECTED] > On Sep 13, 4:45 pm, "Priest, James (NIH/NIEHS) [C]" > <[EMAIL PROTECTED]> wrote: > > This seems like a great > > solution to having editable scripts in your repository but deploying > > minimized scripts to production. > > Be careful with that, though, because minimization is a change to the > source, which means that the source you test is NOT the source which > you're uploading to your production environment. In working > environments with strict QA controls in place (e.g. a bank), this type > of "shortcut" would not be considered acceptable work practice. > > While minification/packing rarely leads to semantic changes in JS > code, it does on occasion happen. It is easy to write code which might > run in uncompressed form yet may not be correct once minification > occurs (e.g., forgetting to add a semicolon after: var x = function() > {...};). Thanks for the info Stephan! I would run tests against the deployed source but it's good to know this sometimes doesn't produce the same code. Jim
[jQuery] Compressing your js files with Ant
Someone just sent me this link and I found the "Minify your JavaScript and CSS files" section enlightening. I've been using Ant more and more to deploy my applications - as well as making use of jQuery and it's related plugins. This seems like a great solution to having editable scripts in your repository but deploying minimized scripts to production. http://www.julienlecomte.net/blog/2007/09/11/building-web-applications-w ith-apache-ant/ Thanks, Jim
[jQuery] Re: jquery 1.2 feedback
> -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > > http://ajaxian.com/archives/purple-include-19 > > Rey... > > Web Specialist wrote: > > Hey Rey: what's "Purple Include"? Ha! And here I thought you made it up :) That looks really cool! Jim
[jQuery] Re: Feeling pretty special right about now...
> -Original Message- > From: seedy [mailto:[EMAIL PROTECTED] > > Ive tried (and failed) a few times to make a graphic for a > jQuery mug with a > cheatsheet on it like this > http://www.cafepress.com/geekcheat.11507711 vi > mug . I can never fit it all on. > I would pay for that at a jQuery store for sure. LOL. That is hilarious. I could see me picking that up in the morning trying to figure out a command and pouring coffee all over my desk!! :) Jim
[jQuery] Re: Feeling pretty special right about now...
> -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 04, 2007 1:06 PM > To: jQuery Discussion > Subject: [jQuery] Feeling pretty special right about now... > > > Yep, I'm feeling pretty special right about now with my new > > JQUERY MUG & COASTER SET!! wut!!! Rey - please execute this code ASAP... $(document).ready(function() { $('#reydesk').click(function() { $('#jquerymug').hide("fast").sendTo("Jim"); $('#jquerymug').replace("crappyMug"); } }); Those look sweet!!! Any plans for a jquery 'store'? Jim
[jQuery] Re: Looking for a calendar picker that allows for two instances on one page
> -Original Message- > From: Andy Matthews [mailto:[EMAIL PROTECTED] > That's almost exactly what I'm looking for. Seems to drag a little bit > though...the hovers feel sluggish. Have you used this in > production before? Nope - you are on your own :) Looking through the API docs: http://docs.jquery.com/Plugins/Calendar/calendar#options There is a 'speed' option... speed (String, Number): A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000). Control the speed at which the calendar appears, it may be a time in milliseconds, a descriptive name ('slow', 'medium', 'fast'), or "" for immediately. Jim
[jQuery] Re: Looking for a calendar picker that allows for two instances on one page
> -Original Message- > From: Andy Matthews [mailto:[EMAIL PROTECTED] > > I'm updating this post with an image of what it is I'm looking for: > > http://www.commadelimited.com/uploads/datepicker.gif > Andy http://marcgrabanski.com/code/jquery-calendar/ Click the 'inline' menu item... That seems to be similar to what you are after?? Jim
[jQuery] Re: Question about Collapse/Expand
> -Original Message- > From: FrankTudor [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 30, 2007 9:44 AM > To: jQuery (English) > Subject: [jQuery] Question about Collapse/Expand > http://docs.jquery.com/Tutorials:Live_Examples_of_jQuery > > I am working with example b. > > The think I am trying to do is to make it default collapesed instead > of expanded. I'm headed out the door so this is a quick reply but... Couldn't you hide the element by default, and then do your slideDown on a click or whatever action you want to use to display the element... Some basic show/hide tutorials: http://www.learningjquery.com/2006/09/basic-show-and-hide http://www.learningjquery.com/2006/09/slicker-show-and-hide For the most part - you can replace show/hide - with slideUp/slideDown... HTH Jim
[jQuery] Re: Not Blowing My Own Horn jQuery Super GUI Example
> -Original Message- > From: Mitchell Waite [mailto:[EMAIL PROTECTED] > This interface is an example of what a novice non programmer > can do using jQuery and a number of its best plugins. The Wow - that's really slick for a not-too-long-ago jQuery "dummy"! :) Keep us posted as you complete it! My co-workers are probably wondering what in the heck I'm doing in here with all these bird sounds!! :) Jim
[jQuery] Re: jQuery Interface Highlight Bug?
I think they are working on a replacement for Interface so I imagine they are concentrating efforts on that vs. fixing old bugs... Jim > -Original Message- > From: Brandon! [mailto:[EMAIL PROTECTED] > Sent: Monday, August 27, 2007 3:30 PM > To: jQuery (English) > Subject: [jQuery] Re: jQuery Interface Highlight Bug? > > > Ouch, a 6 month old bug? I guess I'll have to just leave my callback > function in for now, unless someone knows a better work around? >
[jQuery] Re: jQuery Interface Highlight Bug?
> -Original Message- > From: Brandon! [mailto:[EMAIL PROTECTED] > > I am using the jQuery Interface plugin in a project and I am trying to > get the Highlight effect to work, but I am having a problem in > Internet Explorer (specifically IE6). When I use Highlight: > if (response == 'success') jQuery('#products').Highlight(2000, > '#FFC'); > > In Firefox this works fine, but in IE, since the element does not have > a specified background color, after the animation is finished, the This is a known bug - the Interface demo site: http://interface.eyecon.ro/demos/ifx.html#highlight-fx exhibits the same behavior in IE. See: http://dev.jquery.com/ticket/1014 Jim
[jQuery] Re: jquery books
So Rey - we can save our $$$ and just forward all our JS questions to you!! :) Thanks for the book list!! Jim > -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 22, 2007 9:20 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: jquery books > > > Aljosa, > > You should consider the following books as well: > > Pro Javascript Techniques by John Resig (lead developer of jQuery) > http://www.amazon.com/dp/1590597273/ref=s9_asin_image_3/103-50 > 06438-7850200?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=1 > 7NEJ61FXN0MS11BYFFH&pf_rd_t=101&pf_rd_p=278240301&pf_rd_i=507846 > > JavaScript: The Definitive Guide > http://www.amazon.com/JavaScript-Definitive-Guide-David-Flanag > an/dp/0596101996/ref=pd_sim_b_1_img/103-5006438-7850200 > > ppk on JavaScript > http://www.amazon.com/ppk-JavaScript-1-e-VOICES/dp/0321423305/ > ref=pd_bbs_sr_1/103-5006438-7850200?ie=UTF8&s=books&qid=118778 > 8723&sr=1-1 > > DOM Scripting: Web Design with JavaScript and the Document > Object Model > http://www.amazon.com/DOM-Scripting-Design-JavaScript-Document > /dp/1590595335/ref=pd_bxgy_b_img_b/103-5006438-7850200?ie=UTF8 > &qid=1187788723&sr=1-1 >
[jQuery] Re: Help with show/hide script
Wizzud - Just wanted to let you know I finally got around to implementing this - it works great!! After picking it apart - I learned a lot - thanks for the example! Jim > -Original Message- > From: Wizzud [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 16, 2007 5:17 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: Help with show/hide script > > > > The problem you have is due to the slideDown. Because that takes time > (whereas the hide() is instantaneous), clicking "Hide TOC" > while the toc is > still sliding won't stop the actions that take place (within > jQuery) during > and at the end of the slide. > > One possible alternative (of many) is ... > > var sliding = false; > $('mybutton').click(function() { > if(!sliding){ > var _m = $('#manual'); > sliding = _m.is('.bodywide'); > if(sliding){ > $('#toc').slideDown("slow", function(){ > sliding = false; > // putting the text change in here means the user is not > presented > // with "Hide TOC" until the code is in a > position to actually > action the click > $('#mybutton').text("Hide TOC"); > }); > _m.removeClass("bodywide").addClass("bodytoc"); > }else{ > $('#toc').hide(); > _m.removeClass("bodytoc").addClass("bodywide"); > $('#mybutton').text("Show TOC"); > } > } > return false; > }); > > ... which prevents any action on the click if the slide is still in > progress. >
[jQuery] Re: Where is the latest autocomplete plugin?
FWIW - Dan - do you think it would be worthwhile to pop a note and link on your autocomplete page letting people know about this one since it appears to be the most recent iteration?? http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ Thanks! Jim
[jQuery] Re: Where is the latest autocomplete plugin?
Thanks Rey! I grabbed that one (http://bassistance.de) and had it working way too fast... esp. for a Friday afternoon :) I luv jQuery! Jim > -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > Sent: Friday, August 17, 2007 3:18 PM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: Where is the latest autocomplete plugin? > > > Either one is fine but I know that on the second one, Joern > incorporated > alot of suggestions from Dan and Joern actively maintains > that version. > > Rey... > > Priest, James (NIH/NIEHS) [C] wrote: > > Just curious which is the latest - last one I used was on > Dan Switzer's > > site: > > http://www.pengoworks.com/workshop/jquery/autocomplete.htm > > > > But I also found this one: > > http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ > >
[jQuery] Where is the latest autocomplete plugin?
Just curious which is the latest - last one I used was on Dan Switzer's site: http://www.pengoworks.com/workshop/jquery/autocomplete.htm But I also found this one: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ Which says "Heavily improved Dylan Verheul's initial plugin, integrating modifications by Dan G. Switzer and Anjesh Tuladhar" That the latest and greatest? Thanks, Jim
[jQuery] Re: Help with show/hide script
> -Original Message- > From: Wizzud [mailto:[EMAIL PROTECTED] > > The problem you have is due to the slideDown. Because that takes time > (whereas the hide() is instantaneous), clicking "Hide TOC" After digging around I figured I should switch from toggle to click - and use an if/else - but wasn't sure how to do it :) Thanks for the code snippet!! > PS. If your #manual only ever has a class of either bodywide > or bodytoc, I > would suggest that you modify your css such that simply > adding/removing the > bodytoc class achieves the desired style change, rather than switching > unnecessarily between the 2 classes. True - I should come up with a 'default' style and then simply switch 'on' the other style... At this point I was just trying to make it all work :) Thanks! Jim
[jQuery] Help with show/hide script
I'm skipping around the jQuery book (finally!) and working on converting an existing PDF manual into an HTML doc - I created the following script to show/hide a table of contents - and widen the page content using a toggle: $(document).ready(function() { $('#mybutton').toggle( function() { $('#toc').slideDown("slow"); $("#manual").removeClass("bodywide").addClass("bodytoc"); $('#mybutton').empty().prepend("Hide TOC"); }, function() { $('#toc').hide(); $("#manual").removeClass("bodytoc").addClass("bodywide"); $('#mybutton').empty().prepend("Show TOC"); }); $('#mybutton').trigger("click"); $('.thickbox').after('(click image to enlarge)
'); }); It works - but if I rapidly click on the 'Show/Hide TOC' element - sometimes the TOC will still be visible... Looking in the book I see a similar example with the headline rotator. They set a variable and then check that when the function executes (on hover) to see if it's already been thrown. But I'm stuck in implementing something like that with the toggle... Any ideas or suggestions? Thanks!! Jim
[jQuery] Nice jQuery writeup
I didn't write this but saw it on Reddit while browsing at lunch: http://simonwillison.net/2007/Aug/15/jquery/ Jim
[jQuery] Re: Good Javascript editor or IDE?
> -Original Message- > From: Matt Penner [mailto:[EMAIL PROTECTED] > What recommendations on JavaScript editors or IDEs does anyone have? > Is there something sophisticated enough that can have intellisense > with jQuery or my own objects in external js files? I use Eclipse/CFEclipse to develop my ColdFusion and have lately been playing around with Aptana - works great for my CSS and I noticed it has jQuery support I think: http://www.aptana.com/ Jim
[jQuery] Re: Help with book example - alternating row colors
> -Original Message- > From: Jonathan Chaffer [mailto:[EMAIL PROTECTED] > > But now I'd like to add a bottom border to each 'set' (like the txt > > example above) but so far my attempts haven't worked... I either > > get the > > bottom border correct - or my striping on each 'set' gets > thrown off.. > > How about this? > > if (rowIndex % 2 == 1){ >$(this).addClass('bottom-border'); > }; > > That will add the "bottom-border" class to the second (last) item of > each group. You could insert this clause right after the > existing .addClass() line. Much better than the path I was going on with: $('table.chemtable tr:contains("ACTIVITY/UNITS:")').addClass("bottom-border"); It seemed to work but yours is much better! :) Thanks! Jim
[jQuery] Re: Help with book example - alternating row colors
> -Original Message- > From: mdrisser [mailto:[EMAIL PROTECTED] > It really depends upon how you're going about trying to add the bottom > border. The best way would be to either put the bottom border in > #chemTable tr { border-bottom: 1px solid #000;} or add a bottom border > to your add and even classes. (i.e. .odd, .even {border-bottom: 1px > solid #000;} That is assuming that each 'set' represented above is in > a single row. Sorry - should have clarified a bit more - each 'set' is two rows... So what I'm ending up with is: tr class="odd" tr class="odd" tr class="even" tr class="even" tr class="odd" tr class="odd" Which is what I want - now I just want to apply the border to the second row of each set. Jim
[jQuery] Help with book example - alternating row colors
In the book - there is an example for alternating row colors in a table, and an expanded version for alternating triplets. I've got that working - I have a table with two rows of chemical data: CHEMICAL NAME: BA (GROWTH STIMULANT) AMOUNT: 1 UNITS: FL.OZ. ISOTOPE:ACTIVITY: ACTIVITY/UNITS: CHEMICAL NAME: GADOLINIUM(III)CHLORIDE HEXAHYDRATE AMOUNT: 1 UNITS: FL.OZ. ISOTOPE:ACTIVITY: ACTIVITY/UNITS: Using the book code - I've got the background striped every other row: $(document).ready( function() { // $('table#chemtable tr:odd').addClass('odd'); // $("#chemtable tr:even").addClass("even"); var rowClass = "even"; var rowIndex = 0; $('table#chemtable tr').each(function(index) { if (rowIndex %2==0){ rowClass = (rowClass == "even" ? "odd" : "even"); }; $(this).addClass(rowClass); rowIndex++; }); }); But now I'd like to add a bottom border to each 'set' (like the txt example above) but so far my attempts haven't worked... I either get the bottom border correct - or my striping on each 'set' gets thrown off.. I'm thinking I need to setup up another index to loop over within the main loop? Thanks, Jim
[jQuery] Re: Are there any particular ways to debug jQuery code?
> Mitchell, I don't know of any Firebug tutorials > offhand, I would just Google > it and see what turns up. I also had this bookmarked (haven't watched it yet) http://ejohn.org/blog/hacking-digg-with-firebug-and-jquery/ Presented by John Resig: "This is an adaptation of a presentation that I gave while at Mashup Camp Boston. We're going to take an introductory look at the Firebug Firefox Extension and the jQuery JavaScript Library - combining the two to build a reusable bookmarklet that can manipulate Digg Posts and Comments."
[jQuery] Re: Are there any particular ways to debug jQuery code?
> -Original Message- > From: Mitchell Waite [mailto:[EMAIL PROTECTED] > > $("#nest").click(function() { > alert("got it"); > $("#nest").fade("slow"); I still haven't picked up my jQuery book again - this weekend! But couldn't your write this like: alert("got it").fade("slow"); Does the fade work if you remove the alert? > I just don't know how to systematically track this down. Do you have the Firebug plugin for Firefox? http://www.getfirebug.com/ Jim
[jQuery] Re: jQuery for Dummies
> -Original Message- > From: Mitchell Waite [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 19, 2007 3:28 PM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: jQuery for Dummies > > > Thanks to everyone for recommending the book, I ordered it right away. Mitch - glad you bought the book!!! (from one jQuery dummy to another) :) (from another thread) > I never touched CF, I am using jQuery with IIS and ASP.NET. I won't hold the ASP.NET thing against you... (ColdFusion rulez!) Now I need to finish this $*(@#$*&@#($ Ant presentation this weekend so I can get back to jQuery! Jim
[jQuery] Re: jQuery for Dummies
While I haven't gotten much futher along in the book (darn Ant presentation!) I'd suggest checking it out: http://www.packtpub.com/jQuery/book/mid/1004077zztq0 My 'review' http://www.thecrumb.com/2007/07/13/5-minute-jquery-book-review/ I can attest as a jQuery 'dummy' I'm getting a lot out of it! :) Jim > -Original Message- > From: Mitchell Waite [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 19, 2007 1:56 PM > To: jquery-en@googlegroups.com > Subject: [jQuery] jQuery for Dummies > > > I'm trying to learn jQuery from the tutorials at the web > site. They are very > good but assume a pretty good knowledge of javascript and > calling and using > functions in ways that bewilder me. > > Is there any kind of Idiot's Guide to using jQuery? > > If not does anyone want to co-author one with me? > > Mitch Waite > http://www.mitchwaite.com > http://www.whatbird.com > > >
[jQuery] Re: NEWS: 5 Minute Book Review: "Learning jQuery"
> -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > Sent: Friday, July 13, 2007 9:47 AM > > Jim Priest does an excellent job of reviewing the first couple of > chapter's of Karl Swedberg's newly released jQuery book, Rey - Do you ever sleep!?! I JUST posted that to my blog and was getting ready to post something here but Rey beat me to it! :) Jim
[jQuery] Re: jQuery in Action
I cracked open the book last night but only made it to chapter 2 (dang kids interrupting me!) I posted a quick 'review' on my blog: http://www.thecrumb.com/2007/07/13/5-minute-jquery-book-review/ I'm usually apprehensive about buying technical books sight unseen but so far I'm very happy with the contents of the book! Jim
[jQuery] Re: jQuery in Action
> -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > Sent: Thursday, July 12, 2007 3:23 PM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: jQuery in Action > > > Slacker! Get on it! Mine's waiting for me when I get home :) :) :) :) Type:Package Status: Delivered Delivered On: 07/12/2007 Jim