[jQuery] How do i populate two dropdown menus?
Hi How do i populate dropdown menuB depending on the selected option in dropdown menuA??? I am parsing the menu data from a mysql db with php??
[jQuery] How do i get this mega dropdown with jQuery??
Hi all, I am trying to get this mega dropdown menu: see textielmuseum.nl/ So far i have: bldd.nl/prototypes/megamenu/test2.html But i can´t get the hoverIntent to work? here´s my try W.I.P bldd.nl/prototypes/megamenu/test4.html Any tips, ideas how i to get my mega dropdown to work on hover and hide it??? Regards,
[jQuery] How do I extract this value?
Hi, I am using JQuery 1.3. I have this basic structure in my HTML ... li id=myid ... a class=edit href=javascript:edit(1234) ... /a ... /li How do I extract the 1234 from HTML assuming I know the id of the li element? Thanks, - Dave ps - I know its bad practice to have the javascript function in there, but sadly this is code I inherited and I can't change the href at this point.
[jQuery] How do I allow not add width to the li tag with jQuery Cycle Plugin
I use this jquery-plugin: http://jquery.malsup.com/cycle/ Each li-tag gets a calculated width allowing the contents to 2 lines, but line 1 is sufficient. 2 lines breaks the design. The added width is not necessary. Is it possible NOT to add to this? Can anyone help me? It would be a great relief!
[jQuery] How do i navigate within an ajax div??
Hi, i use this $(#products).click(function() { $(#content).css(overflow-y, scroll); $(#content).load(list.php); }); and i have a loop of 10 products in list.php with a pagination. but how can i use the pagination as it doesn't stay in div #content??
[jQuery] How do I select all elements whose id's begin with ... ?
Hi, I'm using JQuery 1.3. How do I write an expression to select all elements whose id's begin with DatePref? These are all input type=text elements if that matters. Thanks, - Dave
Re: [jQuery] How do I select all elements whose id's begin with ... ?
$('input[id^=DatePref]') On Tue, Dec 15, 2009 at 8:10 AM, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: Hi, I'm using JQuery 1.3. How do I write an expression to select all elements whose id's begin with DatePref? These are all input type=text elements if that matters. Thanks, - Dave -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] How do I unbind all onclick events from a button?
Hi, I'm using JQuery 1.3. I have a button and I want to completely clear it of any onclick events associated with it so that clicking it will do absolutely nothing. If I know the ID of the button, how do I do this? Thanks, - Dave
[jQuery] How do I write an express to access all radio button elements?
Hi, I'm trying to access all radio button elements with this expression .. var expr = $(element[type='radio']); but the experts among you know this isn't correct. What is the correct expression? Thanks, - Dave
Re: [jQuery] How do I write an express to access all radio button elements?
$('input[type=radio]') Thanks Regards, Dhruva Sagar. On Wed, Dec 9, 2009 at 9:03 PM, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: Hi, I'm trying to access all radio button elements with this expression .. var expr = $(element[type='radio']); but the experts among you know this isn't correct. What is the correct expression? Thanks, - Dave
Re: [jQuery] How do I write an express to access all radio button elements?
$(':radio') http://docs.jquery.com/Selectors/radio - Richard On Wed, Dec 9, 2009 at 10:41 AM, Dhruva Sagar dhruva.sa...@gmail.comwrote: $('input[type=radio]') Thanks Regards, Dhruva Sagar. On Wed, Dec 9, 2009 at 9:03 PM, laredotorn...@zipmail.com laredotorn...@zipmail.com wrote: Hi, I'm trying to access all radio button elements with this expression .. var expr = $(element[type='radio']); but the experts among you know this isn't correct. What is the correct expression? Thanks, - Dave
[jQuery] How do I trigger an event when a user presses a key within a text field?
Hi, What is the event that I trigger if a user enters (or deletes) a character within a textfield with id = username? Thanks, - Dave
Re: [jQuery] How do I trigger an event when a user presses a key within a text field?
On Sat, Dec 5, 2009 at 1:16 PM, laredotorn...@zipmail.com laredotorn...@gmail.com wrote: Hi, What is the event that I trigger if a user enters (or deletes) a character within a textfield with id = username? Thanks, - Dave Bet you can find it in here: http://docs.jquery.com/Events -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
Re: [jQuery] how do i prevent having a paragraph tag for the text AFTER i expand?
it would be helpful to see a page with the html output rather than your php variables. Also, try using a span rather than a div for the expandText. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 5, 2009, at 6:04 AM, Kei Simone wrote: Hi i noticed that whenever i expanded the text, the subsequent text expanded. and the expand prefix... also tends to be on the next line. Please advise. This is my expand code. $(document).ready(function() { // override some default options $('div.expandable div').expander({ slicePoint: 160, // default is 100 expandText: 'div class=expand- buttonnbsp;nbsp;nbsp;nbsp;nbsp;Expand/div', // default is 'read more...' //expandSpeed: '2000', // speed in milliseconds of the animation effect for expanding the text //expandPrefix: '...', expandEffect: 'fadeIn', collapseTimer:0, // re-collapses after 5 seconds; default is 0, so no re-collapsing userCollapseText: 'Collapse' , // default is '[collapse expanded text]' afterExpand: function($thisElement) { var vendorParaID = $thisElement.attr('id'); var underscore = vendorParaID.indexOf('_'); var vendorID = vendorParaID.substring(0, underscore); $(#vendor_img_+vendorID).replaceWith($preloadImgVendor [vendorID]); var heightOfDIV = $thisElement.height(); if(heightOfDIV 290){ $thisElement.attr({style : height:290px;overflow:auto}); } //console.debug($thisElement); }, onCollapse: function($thisElement, byUser) { //alert($thisElement.attr('id')); var vendorParaID = $thisElement.attr('id'); var underscore = vendorParaID.indexOf('_'); var vendorID = vendorParaID.substring(0, underscore); $(#vendor_img_+vendorID).replaceWith($preloadImgVendorCrop [vendorID]); var heightOfDIV = $thisElement.height(); if(heightOfDIV 68){ $thisElement.removeAttr(style); } //console.debug($thisElement); } }); }); This is my div for the expandable. div class=expandable div id={$vender.id_manufacturer} _desc{$vender.description}/div /div
[jQuery] how do i prevent having a paragraph tag for the text AFTER i expand?
Hi i noticed that whenever i expanded the text, the subsequent text expanded. and the expand prefix... also tends to be on the next line. Please advise. This is my expand code. $(document).ready(function() { // override some default options $('div.expandable div').expander({ slicePoint: 160, // default is 100 expandText: 'div class=expand- buttonnbsp;nbsp;nbsp;nbsp;nbsp;Expand/div', // default is 'read more...' //expandSpeed: '2000', // speed in milliseconds of the animation effect for expanding the text //expandPrefix: '...', expandEffect: 'fadeIn', collapseTimer:0, // re-collapses after 5 seconds; default is 0, so no re-collapsing userCollapseText: 'Collapse' , // default is '[collapse expanded text]' afterExpand: function($thisElement) { var vendorParaID = $thisElement.attr('id'); var underscore = vendorParaID.indexOf('_'); var vendorID = vendorParaID.substring(0, underscore); $(#vendor_img_+vendorID).replaceWith($preloadImgVendor [vendorID]); var heightOfDIV = $thisElement.height(); if(heightOfDIV 290){ $thisElement.attr({style : height:290px;overflow:auto}); } //console.debug($thisElement); }, onCollapse: function($thisElement, byUser) { //alert($thisElement.attr('id')); var vendorParaID = $thisElement.attr('id'); var underscore = vendorParaID.indexOf('_'); var vendorID = vendorParaID.substring(0, underscore); $(#vendor_img_+vendorID).replaceWith($preloadImgVendorCrop [vendorID]); var heightOfDIV = $thisElement.height(); if(heightOfDIV 68){ $thisElement.removeAttr(style); } //console.debug($thisElement); } }); }); This is my div for the expandable. div class=expandable div id={$vender.id_manufacturer} _desc{$vender.description}/div /div
[jQuery] How do i reset the form feilds in an iframe in my page
Hi everybody, i have one page called console.php ,now in that page i have an iframe with id = 'well_frame' how do i reset the feilds in the form that is in that iframe from console.php.
[jQuery] How do I stop my div from sliding?
Hi all. JQuery noob here. I'm building a site right now that has a left column navigation and the navigation is nested inside a div, which is nested inside a table cell (i.e., td). I'm using JQuery to make it so when the user scrolls down the page, the div slides down with smoothly and always stays at the top of the page. I have this working just fine, but when I change resolutions (i.e., 1024x768), the div scrolls over the bottom of the page, which is what I don't want. How can I calculate in order for the div to know when it hast reached the bottom of the table cell? I tried using outerHeight to calculate the height of the table cell and then subtracting the height of the div from it, but I'm clearly doing it wrong because it's still not working. You can view the page I'm referring to at www.ts24.com/watersedge/overview.cfm. The JS code I'm using is below. If anyone has any pointers, I'd really appreciate it. Thanks! Jesse var name = #scroller; var menu_top_limit = 0; var menu_bottom_limit = $('#holder #scroller').outerHeight() - 560; var menu_top_margin = -15; var menu_shift_duration = 500; var menuYloc = null; /// $(window).scroll(function() { // Calculate the top offset, adding a limit offset = menuYloc + $(document).scrollTop() + menu_top_margin; // Limit the offset to 0 pixels... // This keeps the menu within it's containing TD boundaries if(offset menu_top_limit){ offset = menu_top_limit; // Give it the PX for pixels: offset += px; } /*else if(offset menu_bottom_limit){ offset = menu_bottom_limit; offset += px; }*/ // Animate: $(name).animate({top:offset}, {duration:menu_shift_duration,queue:false}); });
[jQuery] How do you make text selectable when using IE browser?
Hi, We recently had our site redeveloped by a professional firm. We originally requested that users not be able to copy and paste text from our site. This has created an outcry and we would like to have text be selectable. I see that they achieved this by using jquery which I am not familiar. I believe that I have found the snippet of code that turns this ability off/on but I do not know how to write the correct code to allow selection of text. This is an IE specific issue, not a problem in Firefox. I have done some investigation online and found this: http://dev.jqueryui.com/ticket/4773 It looks cut and dry but placing this solution in the js file does nothing. Can you provide guidance on this issue? Thanks!
[jQuery] How do I extract a part of received data
I explain... I try to load only a part of my data file (named Elements.html). It will load all the data file with var elem = $('#section_news', data); I am unable to load only a section of this file if I use var elem = $('#section_news', data); Could you please help me find out what part of my code is incorrect? Thanks Here is my code $.get(Elements.html, function(data){ // get id section_news for the receive data var elem = $('#section_news', data); $('#content').empty().append(elem); }); My host html body div id=content/div /body My Elements.html data file p id=section_newsHello World!/pp id=section_homeHello Fred!/ p
[jQuery] How do I extract a part of received data
I explain... I try to load only a part of my data file (named Elements.html). It will load all the data file with var elem = $(data); I am unable to load only a section of this file if I use var elem = $('#section_news', data); Could you please help me find out what part of my code is incorrect? Thanks Here is my code $.get(Elements.html, function(data){ // get id section_news for the receive data var elem = $('#section_news', data); $('#content').empty().append(elem); }); My host html body div id=content/div /body My Elements.html data file p id=section_newsHello World!/pp id=section_homeHello Fred!/ p
[jQuery] How do I extract a part of received data
I explain... I try to load only a part of my data file (named Elements.html). It will load all the data file with var elem = $('#section_news', data); Here is my code $.get(Elements.html, function(data){ // get id section_news for the receive data var elem = $('#section_news', data); $('#content').empty().append(elem); }); My host html body div id=content/div /body My Elements.html data file p id=section_newsHello World!/pp id=section_homeHello Fred!/ p
[jQuery] How do I prevent the newly entered text in the text input from disappearing upon focus?
I posted this yesterday, but didn't see my original in my email, so didn't know if it never made it, or if it was perhaps just not answered.but I thought I'd post it again so if anyone has any ideas. Rick --- In code prior to this, if an empty text input is found in a form upon submission, the text Entry required. is put into the text input. Once all the text inputs have been validated, then the function below is run to address handling the error messages and user text input: function validation() { $(':input.inputError').each(function() { $(this).focus(function() { $(this).val(''); }); }); $(':input.inputError').each(function() { $(this).blur(function() { if ( $(this).val().length 0) { $(this).removeClass('inputError').css({'background-color':'#ddd' , 'color':'#000'});} if ( $(this).val().length == 0 ) { $(this).val('Entry required...'); } }); }); } It all works well, except for the fact that once I do make an entry into an invalid field, and blur out of that field, then re-focus the cursor in that same field, my valid data entry is removed. With the code above, I try to avoid that happening by removing the class, input error, which is happening according to Firebug, so I'm not sure why the val is being reset to '' or nothing upon re-focus. Is it the order or structure of the code that's the problem? Thoughts? Have I missed another fundamental javascript coding principle, MZ? ;o) Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] How do I prevent the newly entered text in the text input from disappearing upon focus?
In code prior to this, if an empty text input is found in a form upon submission, the text Entry required. is put into the text input. Once all the text inputs have been validated, then the function below is run: function validation() { $(':input.inputError').each(function() { $(this).focus(function() { $(this).val(''); }); }); $(':input.inputError').each(function() { $(this).blur(function() { if ( $(this).val().length 0) { $(this).removeClass('inputError').css({'background-color':'#ddd' , 'color':'#000'});} if ( $(this).val().length == 0 ) { $(this).val('Entry required...'); } }); }); } It all works well, except for the fact that once I do make an entry into an invalid field, and blur out of that field, then re-focus the cursor in that same field, my valid data entry is removed. With the code above, I try to avoid that happening by removing the class, input error, which is happening according to Firebug, so I'm not sure why the val is being reset to '' or nothing upon re-focus. Thoughts? Have I missed another fundamental javascript coding principle, MZ? ;o) Rick --- Those who hammer their guns into plows will plow for those who do not. - Thomas Jefferson
[jQuery] How do I load an external http xml request with jquery?
How do I load an external http xml request with jquery? Below is a url when pasted into a web browser like firefox, an xml document is shown. This is for the CPanel XML API. http://hostingz.org:2086/xml-api/createacct?username=WeAreWatchingplan=hostingz%5FFH5ip=ncpmod=x3password=changemecontact email=contact.wearewatch...@gmail.comdomain=thewawbloguseregns=0reseller=0 How do I make this work in jquery using an xml request? -- View this message in context: http://www.nabble.com/How-do-I-load-an-external-http-xml-request-with-jquery--tp25029520s27240p25029520.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] how do I hide an element after my function completes
I have a hidden spinner div. When my jquery function is called -- I show the spinner. But, how do hide I the spinner div after the ajax request has completed? $(function() { $(.pagination a).live(click, function() { var loader = $('#loader') loader.show() // -- hidden loader div $.get(this.href, null, null, script); return false; }) });
[jQuery] how do you add your site to the sites using jQuery list?
when going to the 'edit' link on http://docs.jquery.com/Sites_Using_jQuery_UI it says it's locked from editing. Is there any way to add another site to that list of successful jQuery sites?
[jQuery] How do I compare two form fields using the form validation plugin?
I have a form with two radio button lists. Each list has the same set of choices. I want to make sure that something is checked in both lists and that the value in the first list is not the value in the second list. I know I could write my own submit handler to do this, but I'd like to work within the jquery form validation plugin because I already use it in other places. Any ideas how to do this?
[jQuery] How do I make sub-navigation links?
I'm relatively new to jQuery - I'm a server-side man, PHP - and I'm trying to discover how to make sub-navigation links appear under my main nav bar when a main link (with children) is hovered. It is no problem for me to do in PHP and I am including the sub-nav in a side bar, but I would also like to have the same links appear under the main nav bar using jQ CSS. Can someone point the way for me on this? Is there a plugin that already does this? In PHP, I have logic that determines the sub-nav links based on the current page id and applicable pages (and therefore links) based on their parent id. I don't know how to get this info to jQuery or AJAX so that it displays on hover. Any help would be appreciated.
[jQuery] How do I re-locate the jcarousel module on the page?
Crazy reallybut I have been trying to re-position the module on my html page and I can't get it to move to where I want it. I have tried the following: - Creating a new page with only the example carousel on the page - Wrapping the entire module, from id=wrap down in a div and positioning that div. - Tried to adjust my own carousel in the page I am building and repositioning it with both div and span tags. All to no avail. I can't seem to move the module. Can someone please explain where these positioning setting should be located (If included in the default config) or how I can set this up so I can move the module around the page. Thanks in advance.
[jQuery] how do you make superfish a global include and dynamically write 'current' class?
I racking my brain because I can't use PHP for this site. :-( I have used all the different variations of suckerfish and superfish for a long time now. With this version to help alleviate massive updating, I want to make this one a global include and have the script pick up the page URL and write 'class=current in the li or the href. I'm thinking some mix of the navbar version of this: http://users.tpg.com.au/j_birch/plugins/superfish/#examples and this: http://onerutter.com/jquery/jquery-highlight-navigation-menu-v02-script.html but its not working for me. Can anyone help out? please and thanks
[jQuery] How do a create a loop in my slideshow? (pelase help)
I have create a slide show that has next and previous buttons and an area of 'dots' that link to a specific slide, however I'm having difficulty in looping the sideshow so it runs automatically. Ive tried making a loop function but it seems to act strangely. I'm pretty new to jquery and would really appreciate some help. Code: $(document).ready(function(){ //global fade time var fadetime = 500; //global amout of slides var current = 0; var amountOfSlides = $(#slideshow .slide).size(); //create links for each slide in the dot area var theDots = ; var dotCounter = 0; var firstDot = ' class=current '; $(.slide).each(function(){ theDots = theDots + 'a href= name='+ dotCounter +' ' + firstDot +' /a '; firstDot = ; dotCounter++; }); $(#dot-area).html(theDots); //next button $(#next).live(click, function(e){ e.preventDefault(); //make current selector var currentSelector = .slide:eq( + current + ); var currentDotSelector = #dot-area a:eq( + current + ); current = parseInt(current); current = current + 1; if(current == amountOfSlides){ current = 0; } //make next selector var nextSelector = .slide:eq( + current + ); var nextDotSelector = #dot-area a:eq( + current + ); //remove .current from dot and add it to new one $(currentDotSelector).removeClass(current); $(nextDotSelector).addClass(current); //fade out current and fadein next $(currentSelector).fadeOut(fadetime,function() { $(nextSelector).fadeIn(fadetime); }); }); //previous button $(#previous).live(click, function(e){ e.preventDefault(); //make current selector var currentSelector = .slide:eq( + current + ); var currentDotSelector = #dot-area a:eq( + current + ); current = current - 1; if(current 0){ current = (amountOfSlides - 1); } //make next selector var previousSelector = .slide:eq( + current + ); var previousDotSelector = #dot-area a:eq( + current + ); //remove .current from dot and add it to new one $(currentDotSelector).removeClass(current); $(previousDotSelector).addClass(current); //fade out current and fadein next $(currentSelector).fadeOut(fadetime,function() { $(previousSelector).fadeIn(fadetime); }); }); //dot click $(#dot-area a).live(click, function(e){ e.preventDefault(); //current selector var currentSelector = .slide:eq( + current + ); var currentDotSelector = #dot-area a:eq( + current + ); //the one to fade to current = $(this).attr(name); var dotSlide = .slide:eq( + current + ); var newDotSelector = #dot-area a:eq( + current + ); //remove .current from dot and add it to new one $(currentDotSelector).removeClass(current); $(newDotSelector).addClass(current); $(currentSelector).fadeOut(fadetime,function() { $(dotSlide).fadeIn(fadetime); }); }); //begin loop function slideshowLoop(){ //make current selector var currentSelector = .slide:eq( + current + ); var currentDotSelector = #dot-area a:eq( + current + ); current = parseInt(current); current = current + 1; if(current == amountOfSlides){ current = 0; } //make next selector var nextSelector = .slide:eq( + current + ); var nextDotSelector = #dot-area a:eq( + current + ); //remove .current from dot and add it to new one $(currentDotSelector).removeClass(current); $(nextDotSelector).addClass(current); //fade out current and fadein next $(currentSelector).fadeOut(fadetime,function() { $(nextSelector).fadeIn(fadetime).fadeTo(3000, 1); slideshowLoop() }); } slideshowLoop(); }); Any help would be much appreciated. Cheers.
[jQuery] How do I implement this jQuery/AJAX effects on my page?
If you go here, http://demo2.analoganalytics.net/publishers/7/offers and click on Email and Txt for any coupon offer, I would like to duplicate that exactly on my page. By looking at their script, it looks like they're using Prototype. However, I'm new to jQuery and wondering can the almost exact same effect be apply to jQuery? Perhaps a combination of fadeIn, fadeOut, slideDown and slideUp? On that page, I'm wondering how after submitting the email, it clears the box to display the Thank You! Your coupon is on its way to em...@email.com and then the original element content appears again? Also, by clicking the email image, the original element contents clears, without the email textbox and submit button showing. How is that achieved? I know this may be a newbie question, but I'd like to see a simple example on to duplicate the exact same thing. I'll handle the server- side (PHP mail() and SMS code in a separate page). So this means, the script also uses AJAX as well right?
[jQuery] How do I add parameters dynamically, right before the form submit ?
Hi, When the user clicks on the submit button, I would like to add some parameters to the form before submitting it (standard post submit, no ajax) How may I achieve this ? Thank you for any help. -- View this message in context: http://www.nabble.com/How-do-I-add-parameters-dynamically%2C-right-before-the-form-submit---tp24548550s27240p24548550.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] How do I toggle two DIV's with two different buttons
Hello, I just started using jquery and have been really impressed with it so far. I have been able to get it to do everything that I want with the exception of getting having two different buttons toggle the divs. I want them to be independently able to be used but if one is active and the button is clicked, then it will become inactive. This is the code that I have so far. It changes the classes of the divs on click and it works very well. This is that last this on my list of to do's for this project. Any help would be greatly appreciated. a href=# id=themeToggle class=themeclassChangerChange Theme/ a|a href=# id=searchToggle class=searchclassChangerSearch/a $(#themeToggle).click(function () { var $this = $(this); if( $this.is('.themeclasschangerActive') ){ $(#themeChange).toggle(slide, { direction: up }, 500); // This moves the entire div $(this).removeClass(themeclasschangerActive); $(this).addClass(themeclassChanger); } else { $(#themeChange).toggle(slide, { direction: up }, 500); // This moves the entire div $(this).removeClass(themeclassChanger); $(this).addClass(themeclasschangerActive); } return false; }); $(#searchToggle).click(function () { var $this = $(this); if( $this.is('.searchclasschangerActive') ){ $(#hiddenSearch).toggle(slide, { direction: up }, 500); // This moves the entire div $(this).removeClass(searchclasschangerActive); $(this).addClass(searchclassChanger); } else { $(#hiddenSearch).toggle(slide, { direction: up }, 500); // This moves the entire div $(this).removeClass(searchclassChanger); $(this).addClass(searchclasschangerActive); } return false; });
[jQuery] How do I cause a javascript variable to retain leading zeros?
If i have a user with, say a password that starts with a leading zero, how can I cause jQuery to retain and not drop the leading zero? Rick Ninety percent of the politicians give the other ten percent a bad reputation. Henry Kissinger
[jQuery] How do I (client side) programatically set jQuery rating
I can't seem to figure out how to set the star rating value at client run time. Can you please reply with a sample? Thanks. Sekhar.
[jQuery] How do i use JQuery Autocomplete for multiple words
I have an autocomplete field and am just wondering how can i use it for multiple words? When i type the first word it works perfect, but when i space and type in the second word, its sends the two words back to the server and of course the results are wrong! eg. when i type the two words, 'Java javascript' the first word 'Java', autocomplete works well, pull the list. but when i space and type javascript, autocomplete sends 'Java +javascript' to my ajax function. Any ideas how to fix this? Gath
[jQuery] How do i control window scrolling with two divs(top, bottom)
Hopefully someone can help me! :) What I want to do is control a window/div scrolling via the use of two div's. Example. 1) First div named top(#top), which will be fixed to the top 2) Second div is bottom(#bottom) which is fixed to the bottom of the window. 3) An image in a content div(#content) with is say 2000px long All I want the divs top and bottom to do is scroll up or down slowly when they are hovered? How do i find the current position of the #content div and +/-? Any suggestions?
[jQuery] How do we change the css stylesheet of selected accordion header
Can anyone please tell me ,how do we change the css stylesheet of selected accordion header. I want that the selected accordion should have different background color and other which are not selected should have different background color.
[jQuery] how do we change the css stylesheet of selected accordion header ???
Can anyone please tell me ,how do we achieve that the selected accordion header should have different background color and other headers which are not selected should have different background color. I am naive with Jquery , jquery generates some kind of CSS associated ..how do we overide that ? Please help..
[jQuery] How do I set the value of a form element?
I'm sorry for being so thick, but I'm stuck. Please, can someone view the source of this page... http://www.eastexhaust.com/jquerytest.html ...and tell me why it is not setting the value of the form element? ricardobeat wrote: $('#myspan').text( $('#partnum').val() ); http://docs.jquery.com/Attributes On Mar 29, 6:07 pm, webguy262 webguy...@yahoo.com wrote: I have two forms on a page (www.eastexhaust.com/inventory.php). One uses ajax to generate a part number by selecting values from a series of selection boxes. The other form emails the part number so we can reply with a quote. Everything works fine in FFox, but does not work in IE. Therefore, I have had to make things harder by asking the user to copy and paste their part number into the email form instead of having it entered there automatically. To display the part number to the user, I'm using this in the JS... document.getElementById('myspan').innerHTML = result; ...and this in the html... To get the variable in the email form, I'm using this in the JS... document.getElementById('partnum').value= result; ...and this in the html... input type=text name=partnum id=partnum readonly As I said, this works everywhere but not in IE. How can I use Jquery to make it work across the board? Thanks! -- View this message in context:http://www.nabble.com/ajax-problem-in-IE-tp22772776s27240p22772776.html Sent from the jQuery General Discussion mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/ajax-problem-in-IE-tp22772776s27240p23011076.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] How do get the ID of an element that has been clicked ?
Hi all. This might be more of a javascript problem rather than a jquery problem, but I'm also wondering if there is a 'jquery way' of solving it. Given this code: DIV id=div_one/DIV DIV id=div_two/DIV DIV id=div_three/DIV DIV id=div_four/DIV Lets say that the user is invited to click one one of these divs. How do I get the id of the div that was clicked ? Thanks.
[jQuery] How do I access global variables for id's, etc.?
I would like to be able to do something as simple as p id=scriptmyGlobalVariable/scriptxyz/p, but apparently the marks are a problem. I'm able to output a global variable value like this: pThe value of myGlobalVariable is scriptmyGlobalVariable/script./p Is there some way to use global variable values with an id attribute? Thanks, Rick --- It has been my experience that most bad government is the result of too much government. - Thomas Jefferson
[jQuery] How do I get Triggered event to stop looping?
Hello, Currently opening a dialog box and then trying to trigger some code to run once the dialog box has opened. The code is triggered by the following code: $(a.addGoal).trigger('click'); The addGoal code runs fine, the only issue I have is that the code keeps looping. I have already tried to use unbind in the addGoal code block, but this interferes the creation of the next dialog box. Any ideas Martin
[jQuery] How do you iterate across elements with the same class name?
I have a bunch of hyperlinks with class 'hello_world'. I want to assign each one of them a random colour. I can set the colour for all of them with the following: $(a[class=hello_world]).css(color, red); How can I iterate over every element with class name 'hello_world'?
[jQuery] How do I subtract 64 pixels from the value of a div's height?
Here is my code: $(document).ready(function () { var contentDivHeight = $('#contentDiv').css('height'); // pseudo-code: var calculatedHeight = $(#clickMe).click(function(){ $(#leftNavBox-contentPages).animate({height: calculatedHeight}, fast); }); }); I need the value of calculatedHeight to be 64 pixels less than contentDiv. So, if contentDiv is 600px, calculatedHeight needs to be 536px. Jeremy
[jQuery] How do I change the q= parameter?
Hello This is a great script, there's no doubt about that. However, I need to use this script with Drupal, and Drupal already uses a $_GET[q] parameter, and the autocomplete script seems to interfere with that. I've heard that I can change the q= parameter somewhere in the jquery.autocomplete.js file, but I don't know where. I'm using version 1.0.2 of the autocomplete jQuery plugin. Can someone tell me what and where do I have to make changes so that I can put query= instead of q= ? Thanks in advance
[jQuery] How do I adapt this code for multiple uses?
I have got some code http://pastebin.com/mc99132c which counts how many characters have been entered in a textbox and subtracts it from the maxlength to show how many characters are left. If I add a new textbox I don't want to copy and paste the code down and rename the variables so is there a way of navigating the DOM tree to change just the element currently being edited? Cheers, Ian. http://pastebin.com/mc99132c
[jQuery] How do I extract XML CDATA?
I'm trying to display the description field from an RSS feed that I don't control -- the RSS feed inserts the contents as CDATA... ?xml version=1.0 encoding=UTF-8? channel ... description![CDATA[Has Chancellor Palpatine given the go ahead to execute Order 66 or is the TomTom lawsuit about nothing more than GPS?]]/description ... /channel If I remove the CDATA notation, the code below populates $summary with the contents: var $summary = $('div/div') .html($('description', this).text()); But I get nothing when the CDATA notation is there (and switching .html to .text has no effect).
[jQuery] How do I translate this in jQuery?
I've made various attempts at translating this into jQuery without success. I guess I'm just not sufficient enough in regular JS to make it work. It's working, but I'd like it to be written as much as possible in jQuery syntax. Would some please translatethe first three lines of this into jQuery for me? Thanks, Rick function getContentFromIframe(iFrameName) { var myIFrame = document.getElementById(iFrameName); var content = myIFrame.contentWindow.document.body(innerHTML); $('#myiFrame-content').append(content); -- My reading of history convinces me that most bad government results from too much government. - Thomas Jefferson
[jQuery] How do you handle 2 differents and 1 action?
I have the following piece of code which checks if a user has pressed the Enter key in a text input with id=text_input and then performs some action: $(document).ready(function() { $(#text_input).keyup(function(e) { // Checks if the Enter key was entered if(e.keyCode == 13) { // perform the action } }); }); I also have a button with id=push_button that I wish will perform the same action as above when clicked. How can I rewrite the above so that I check for either of those two events and perform that one action without code duplication?
[jQuery] How do you handle 2 differents and 1 action?
I have the following piece of code which checks if a user has pressed the Enter key in a text input with id=text_input and then performs some action: $(document).ready(function() { $(#text_input).keyup(function(e) { // Checks if the Enter key was entered if(e.keyCode == 13) { // perform the action } }); }); I also have a button with id=push_button that I wish will perform the same action as above when clicked. How can I rewrite the above so that I check for either of those two events and perform that one action without code duplication?
[jQuery] how do I code jquery image gallery inside ajax tabs?
They both work on their own, but when I click on the ajax tab that contains the image gallery html, its just a blank page? What do I need to change to get this to work? Thanks, Arianna
[jQuery] How do I update this with ajax??
Hi!! I have a page with DatePicker and a list of events that occur in some respective date. So, when a person selects a date in DatePicker, this date is passed as an argument to a method (I'm using asp.net mvc) and this method returns me all the events of the chosen date. The problem is the page refreshes every time this process is done. So, what's the best way to make this via Ajax?? $.ajax.get?? $.ajax.post?? What do you recommend? And how can I when update this list events of my page?? Thanks in advance!! André
[jQuery] how do I invoke a cluetip from code?
I just want to fire up a cluetip just like an Alert(). e.g pseudo code: if(!condition){ cluetip(try again!) } thanks in advance
[jQuery] How do I add/subtract currency with jquery?
I have a group of form fields that will contain prices in dollar and cents (0.00) that a user enters. After the user enters the prices in all the product fields, discounts in the discount fields (indicated by something like -5.00), and a deposit in the deposit field, they click a calculate button to show the final total in the balance due field. I'm too new to jquery to even produce example code. I found a plugin to format currency, but haven't seen anything that does what I need to do. Any ideas? Thanks...
[jQuery] How do i extract the index of an item based within a table?
Hi, I'm trying to write some jquery code so when i click on the relevent item price, it alerts me with the quantity of that item and also displays the content of the h2 header just before the relevant table, is there a way somehow of finding out the index of the 'td' which is clicked, and then extracting the quantity in the row above with the same index. also be able to grab the text from the h2 header before the table, so in effect, when i click on the '40p each' box within the first item table, it alerts me with the quantity being 1000, and also the h2 header of 'First Item Named here' Can someone please help!? Example : h2 class=sublistingFirst Item Named here/h2 pinformation goes here/p table class=price_table tr th Quantity/th th 1000 /th th 5000 /th th 10,000 /th th 15,000 /th th 20,000 /th /tr tr td Price /td tdstrongpound;400/strongbr / span class=each_item40p each/span/td tdstrongpound;1650/strongbr / span class=each_item33p each/span/td tdstrongpound;3200/strongbr / span class=each_item32p each/span/td tdstrongpound;4800/strongbr / span class=each_item32p each/span/td tdstrongpound;6200/strongbr / span class=each_item31p each/span/td /tr /table h2 class=sublistingsecond Item Named here/h2 pinformation goes here/p table class=price_table tr th Quantity/th th 1000 /th th 5000 /th th 10,000 /th th 15,000 /th th 20,000 /th /tr tr td Price /td tdstrongpound;400/strongbr / span class=each_item40p each/span/td tdstrongpound;1650/strongbr / span class=each_item33p each/span/td tdstrongpound;3200/strongbr / span class=each_item32p each/span/td tdstrongpound;4800/strongbr / span class=each_item32p each/span/td tdstrongpound;6200/strongbr / span class=each_item31p each/span/td /tr /table script type=text/javascript //![CDATA[ $('.each_item').parent().mouseover( function(){ $(this).css('background-color','#F90'); $(this).css('cursor','hand'); $(this).css('cursor','pointer'); }).mouseout(function() { $(this).css('background-color','#EFEFEF'); $(this).css('cursor','default'); }).click( function() { alert('display quantity based upon the pricebox and also display the previous h2 heading'); } ); //]] /script
[jQuery] How do i extract the index of an item based within a table?
Hi, I'm trying to write some jquery code so when i click on the relevent item price, it alerts me with the quantity of that item and also displays the content of the h2 header just before the relevant table, is there a way somehow of finding out the index of the 'td' which is clicked, and then extracting the quantity in the row above with the same index. also be able to grab the text from the h2 header before the table, so in effect, when i click on the '40p each' box within the first item table, it alerts me with the quantity being 1000, and also the h2 header of 'First Item Named here' Can someone please help!? Example : lt;h2 class=quot;sublistingquot;gt;First Item Named herelt;/ h2gt; lt;pgt;information goes herelt;/pgt; lt;table class=quot;price_tablequot;gt; lt;trgt; lt;thgt; Quantitylt;/thgt; lt;thgt; 1000 lt;/thgt; lt;thgt; 5000 lt;/thgt; lt;thgt; 10,000 lt;/thgt; lt;thgt; 15,000 lt;/thgt; lt;thgt; 20,000 lt;/thgt; lt;/trgt; lt;trgt; lt;tdgt; Price lt;/tdgt; lt;tdgt;lt;stronggt;amp;pound;400lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;40p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;1650lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;33p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;3200lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;32p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;4800lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;32p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;6200lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;31p eachlt;/spangt;lt;/ tdgt; lt;/trgt; lt;/tablegt; lt;h2 class=quot;sublistingquot;gt;second Item Named herelt;/ h2gt; lt;pgt;information goes herelt;/pgt; lt;table class=quot;price_tablequot;gt; lt;trgt; lt;thgt; Quantitylt;/thgt; lt;thgt; 1000 lt;/thgt; lt;thgt; 5000 lt;/thgt; lt;thgt; 10,000 lt;/thgt; lt;thgt; 15,000 lt;/thgt; lt;thgt; 20,000 lt;/thgt; lt;/trgt; lt;trgt; lt;tdgt; Price lt;/tdgt; lt;tdgt;lt;stronggt;amp;pound;400lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;40p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;1650lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;33p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;3200lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;32p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;4800lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;32p eachlt;/spangt;lt;/ tdgt; lt;tdgt;lt;stronggt;amp;pound;6200lt;/stronggt;lt;br /gt; lt;span class=quot;each_itemquot;gt;31p eachlt;/spangt;lt;/ tdgt; lt;/trgt; lt;/tablegt; lt;script type=quot;text/javascriptquot;gt; //lt;![CDATA[ $('.each_item').parent().mouseover( function(){ $(this).css('background-color','#F90'); $(this).css('cursor','hand'); $(this).css('cursor','pointer'); }).mouseout(function() { $(this).css('background-color','#EFEFEF'); $(this).css('cursor','default'); }).click( function() { alert('display quantity based upon the pricebox and also display the previous h2 heading'); } ); //]]gt; lt;/scriptgt;
[jQuery] How do I use BlockUI with Jquery?
I know this may sound extremely dumb, but how do I actually use BlockUI?? I've got jquery working perfectly, but how do I access BlockUI's methods etc? I must make a reference to it somewhere? There is nothing in the documentation. Many thanks
[jQuery] How do I get the index of the currently clicked textbox?
Hi, How do I get the index of the currently clicked textbox? I have 5 textboxes in a form, all of which I am binding a click event. Here is the code: $(#associate-form input[type=text]).bind(click, function() { alert(this); //what is its index position from the 5 other textboxes? }); Thanks in advance.
[jQuery] How do I use JQuery to implement a live search feature for Google Web Search API?
How do I use JQuery to implement a live search feature for Google Web Search API? Here's some help. http://code.google.com/apis/ajax/playground/#set_site_restrict http://exscale.se/archives/2008/05/16/jquery-live-ajax-search-plug-in/
[jQuery] How do I get the actual HREF of a link?
Here's the short version: I have a link: a id=testlink href=page.htmlpage.html/a But when I do this: alert($('#testlink')[0].href); I get this: http://localhost/page.html How do I get the *actual* HREF of the link (page.html), and not the mangled version? Thanks! -- The long version: I have a few links in HTML: a href=/page1.html/page1.html/a a href=http://localhost/page1.html;http://localhost/page1.html/ a a href=http://localhost:80/page1.html;http://localhost:80/ page1.html/a a href=http://localhost/page2.html;http://localhost/page2.html/ a a href=http://www.google.com/page1.html;http://www.google.com/ page1.html/a When I do this: $([href]).each(function() { var matches = $([href=' + this.href + ']); console.log(Searching for HREF \ + this.href + \, text \ + $(this).html() + \ ); matches.each(function() { console.log(Found: HREF \ + this.href + \, text \ + $(this).html() + \ ); }); }); I get this: Searching for HREF http://localhost/page1.html;, text / page1.html Found: HREF http://localhost/page1.html;, text http://localhost/ page1.html Searching for HREF http://localhost/page1.html;, text http:// localhost/page1.html Found: HREF http://localhost/page1.html;, text http://localhost/ page1.html Searching for HREF http://localhost/page1.html;, text http:// localhost:80/page1.html Found: HREF http://localhost/page1.html;, text http://localhost/ page1.html Searching for HREF http://localhost/page2.html;, text http:// localhost/page2.html Found: HREF http://localhost/page2.html;, text http://localhost/ page2.html Searching for HREF http://www.google.com/page1.html;, text http://www.google.com/page1.html; Found: HREF http://www.google.com/page1.html;, text http:// www.google.com/page1.html The problem is that elem.href is returning a mangled version of the HREF, but the [href='...'] selector requires the URL exactly as it is written in the HTML. So when an element has /page.html as it's HREF, doing elem.href returns http://localhost/page.html; instead. So to search for the /page.html HREF, I have to search for: [href='page.html'] [href='/page.html'] [href='http://localhost/page.html'] [href='http://localhost:80/page.html'] [href='https://localhost/page.html'] [href='https://localhost:443/page.html'] Where localhost and 80 must be determined by javascript at runtime to reflect the current server and port. Also, the /page.html and page.html are not comprehensive. The javascript would also have to check for all permutations of ../page.html, folder/../page.html, etc. The root of the problem here is this: how can I get the *actual* HREF of a link via javascript, and not the mangled version?
[jQuery] How do I show the label text in an input
Hi, Apologies for this noob question, but I really need help and I have tried numerous techniques to get this right. A client has asked me to create an accessible form that has text describing what to put in the input area shown within the input. However, they don't want a label above it. To keep the form accessible, I've created a class that positions the labels in the form -px to the left and used JQuery to add that class to the labels so they are visible if Javascript is disabled. However, I need to use JQuery to show the label text and place it within the input so visitors know what each input is for. I can't just add value attribute (i.e. input value = / ) because I'm using this for a PHP form variable. Can anyone help me with this? I assume it can't be too difficult to do...right? Thanks
[jQuery] How do I communicate with other windows with jquery
On firefox mutiple tabs, how do I manipulate the other tabbed window, such as set focus or change css on a specific element?
[jQuery] How do I abort a function?
If I want to abort a function based on a condition, what is the command to do that? if x == 0 abort this function... Thanks, Rick
[jQuery] how do I change the opacity of the sub-menus?
Please help a newbie! I've installed superfish on my web site, and it's working great except for one thing: the sub menus are transparent and it's causing some confusion for my users. I can't seem to find the file and the line to change the opacity setting so that it becomes completely opaque. check out my web site to see the issue. http://www.sydneydragonblades.com/joom/ Thanks in advance, Albert P.S. is this file (the one to be recommended) also where all the other customisations can be made?
[jQuery] How do i generify this action to happen for every radio button with id=other
I have a form On form I have several groups of radio buttons. Many (most) of these groups of radio buttons has one in the group with a value of other and an id of unique_id_other. When a user selects other an input text field is shown and the other radio button goes away. This is done via code such as the following: [code] // in IE you must use the click event, in other browsers change. var evt = $.browser.msie ? click : change; $(#sample_other).hide(); $(inp...@name='sample']).bind(evt, function(){ if ($(inp...@name='sample']:checked).val() == 'other') { $(#sample_other).show(); $(#edit-sample-other-wrapper).hide(); $(this).parents('div:eq(2)').find('.description').hide(); } else { $(#sample_other).hide(); $(#edit-sample-other-wrapper).show(); $(this).parents('div:eq(3)').find('.description').show(); } }); [/code] Question is - how do I generify this, make it into a function such that I don't have to write one of these blocks of code for every set of radio buttons with an 'other' choice? thanks K Currently I have a bunch of calls for each
[jQuery] how do I change the opacity of the sub-menus?
Please help a newbie! I've installed superfish on my web site, and it's working great except for one thing: the sub menus are transparent and it's causing some confusion for my users. I can't seem to find the file and the line to change the opacity setting so that it becomes completely opaque. check out my web site to see the issue. http://www.sydneydragonblades.com/joom/ Thanks in advance, Albert P.S. is this file (the one to be recommended) also where all the other customisations can be made?
[jQuery] How do I use the JSON api to enter a value in a p tag?
How do I use the JSON api to enter a value in a p tag? Code is here http://codedumper.com/flickr-api-using-jquery-json Example is here http://sampleswap.uk.to/json/test.html Yeah the code I've got is fine for images. But what if I want to create a p and fill it with data from the api.
[jQuery] How do I retrieve all INPUT elements from within a div
Hello all, I've a DIV that looks like div id=left /div and this DIV contains text-boxes, check-boxes and drop-downs. Say, I've to retrieve only text-boxes from this DIV--what is the best possible way to do that? Any help will be highly appreciated. Thanks, Oltmans
[jQuery] How do I delete the content of a cloned filefield?
Hi, all... and Happy New Year (a little early. US East Coast, 8pm)! I'm cloning a filefield, and, we'll assume, the user has already used the browse button to locate a file. When this filefield is cloned, the file path from the previous field is still in the new field. I want to empty the filefield. I tried this: $('.image-next :last').attr('value', function() { return this.value.replace(); (The image filefields have the clas image-next) But that didn't work...no errors, but content was still in the field. Suggestions? Thanks, Rick
[jQuery] How do I cache
I would like to have a registration form cached for 1 year public and private. How do i go about it. Thats what I tried and register.html was not cached. jq.ajax({ type: POST, url: http://www.example.com/register.html;, dataType: html, cache: true, success: function(response) {} }); = content of register.html div form name=registerForm method=post onsubmit=return false; autocomplete=off input type=text name=username id=username value=/ input type=password name=pass id=pass value=/ input type=text name=email id=email value=/ /form /div
[jQuery] How do I make a partial textarea autocomplete?
Hello, Is there an example of partial autocomplete? By 'partial' I mean, only a part of textarea gets suggestions. Users in my project are supposed to start a message in a textarea with 'Dear UserName' I want to make this UserName part either clickable like in Office documents custom fields, and when a user is editing this part I want to show a list of options (usernames from a database). I can work out the backend, but I have no clue where to begin to make such a textarea. Please help. Thanks a ton. Sam
[jQuery] how do i select all anchors OUTSIDE of a specific tag
How do i select all of the anchor links that are NOT in the div x? body a href= onclick=alert('TODO');return false;outide div 1/a div id=x diva href= onclick=alert('TODO');return false;inside div 1/ a/div a href= onclick=alert('TODO');return false;inside div 2/a a href= onclick=alert('TODO');return false;inside div 3/a /div a href= onclick=alert('TODO');return false;outide div 2/a a href= onclick=alert('TODO');return false;outide div 3/a /body // this doesn't work $('body').not('#x').find('a').click(... // this doesn't work $('a').not('#x a').click(...
[jQuery] How do I write a function to close shadowbox?
For my success callback (I guess that's what you call it...) I've got a series of events after an $.ajax post. Here they are: $('#contentdiv').empty().fadeIn(1000).append(response.login); $('#my_story').empty().fadeIn(2000).append(response.my_story); $('#email').empty().fadeIn(2000).append(response.email_address); $('#pass').empty().fadeIn(2000).append(response.password); These evens happen inside a shadowbox modal window. After the last one, I want to auto-close the shadowbox. The shadowbox command for doing that is .close() . What I can't figure out is how to reference shadowbox itself like I do elements with an id or class, etc. Anyone got a pointer for this? Thanks, Rick
[jQuery] How do I create an auto scaling background?
Take a look at http://ringvemedia.com/shanghai Do you see how if you resize the browser window, the background image automatically scales? How would I do this with jquery?
[jQuery] How do I build a variable array/object to use $.post?
Hi, I'm struggling a bit to get $.post to work. I can get it working as documented, ie. $.post(url, { param1: 1, param2: 2 } ); but I want variable fields on my form (identified by the class 'edit_field') to be posted to the url I thought the approach below would work, postdata is built correctly, but it sends nothing. What am I doing wrong? thanks var postdata = []; // get all the edit fields $.each($('.edit_field'),function() { postdata[this.name] = $(this).val(); }); // and sent it away $.post(/spt/newcanonical, postdata, function(data) { alert(data); });
[jQuery] How do you get the name of a tag/node/element?
I'm trying to convert an xml node into an object...all I want to do is find the name of the tag...function function initObjArray(xml, arr, tagName){ (xml).find(tagName).each(function(){ var o = new Object(); var t = $(this); var c = t.children(); c.each( function(){ var key = $(this).TAGNAME; var val = $(this).text(); o[key] = val; }); }); } So that: fruit typeapple/type colorred/color /fruit will be: fruit.type = apple; fruit.color = red;
[jQuery] How do i submit a new plugin?
I wanted a gallery viewer which would accomodate multiple sets of photos in which each set could correspond to one event. Additionally I wanted it to pick the set-name, thumbnails paths, full pics paths and captions text etc from javascript object/array instead of markup. And I was impressed by looks and function of JQGallViewer. Taking inspiration(I did not take much from its code) from it I have made this plugin which is simple yet works fine. This is my first learning of jquery. I wish to share this plugin with the community. Could anyone please guide how to go about it?
[jQuery] how do you get a div from an ajax form return?
I'm using the jquery forms plugin for an ajax request and update. I set the target option to the desired div that I want to update. The problem that I'm running into is that it will update the div with the contents of the entire page rather than the just the contents of that div. I'd like to do this without creating another view for just the div alone. What is the proper way to do this? Return the calls results to a variable and then parse the variable for the desired div? Is there another way? Thanks in advanced.
[jQuery] How do I write an expression to get all checked items of a certain class?
Hi, How do I write a JQuery expression that will give me all the elements that are inputs of type=checkbox, that have class=subscrCheckbox and that are checked? Thanks, - Dave
[jQuery] How do I reference PHP for an ID value?
In a simple world the function i'm trying to perform is: $(document).ready(function(){ $(button).click(function () { $('.cars#seats').slideToggle(slow); }); }); But I'm working in Wordpress. What I'm trying to do is for each entry be able to toggle the main content of the entry to either a hidden of visible state. When a person clicks a button which is placed within the post next to the title text, the visible state of the main content is toggled. Using the simple example I can easily toggle static content, but I believe my issue to lie in the fact that the post ID is derived from PHP. How do I solve the issue? I've tried: $(document).ready(function(){ $(#post-?php the\\_ID\\(\\)\\; \\?\\button).click(function () { $('#post-?php the\\_ID\\(\\)\\; \\?\\.content').slideToggle(slow); }); }); *Which i thought to use after checking the jQuery FAQ and also tried: $(document).ready(function(){ $(post-?php the_ID(); ?button).click(function () { $('#post-?php the_ID(); ?.content').slideToggle(slow); }); }); Neither worked. Please help me out! Thanks in advance -MP -- View this message in context: http://www.nabble.com/How-do-I-reference-PHP-for-an-ID-value--tp20573038s27240p20573038.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] How do you use LiveQuery with ajaxForm inside tab panel?
Hi, I am using JQuery UI tab panel and one of the tab has remotely loaded form which I submit using ajaxForm... Once I submit form and in case server return error message for any invalid values, then I correct form and resubmit...After this new response is coming in new page. I know page elements are bind only once in ajax call and new form is not bind for bind ajax call. but question is how to find form for new ajax call so that all my response comes inside tab panel...I tried couple of things but nothing is working for me... I can share my code...Please let me know if you have any idea... var $tabs = $('#myFriends ul').tabs({ load: function(e, ui){ // bind form using 'ajaxForm' $('#importFriendsForm').ajaxForm({ target: '#importFriendsSuccess', success: function(data,jqForm,options){ /* $(#importFriendsForm :input[type=text] ).attr(disabled,true); $(#importFriendsForm :input[type=password]).attr(disabled,true); $(#importFriendsForm :submit).attr(disabled,true); */ }, error: function(xhr){ $(#importFriendsError).html(Request Failed, Please try after some time. HTTP Response Status is:+ xhr.status + and Status Text is: + xhr.statusText); } }); } }); });
[jQuery] How do I reset to the original positions of a sortable list? (using the .sortable() method)
Hey all, I'm using this sortable method: http://docs.jquery.com/UI/Sortables/sortable Works perfect! I have one question though: When a certain action is taken by the user, I want to reset the original order of the lis in the list. I can't seem to figure out how to do that. Does anyone have any tips? Thanks!
[jQuery] How do I move contents from different frames in a frameset with Jquery?? Tried and can't get it to work!
Hello! I have tried this with the advice of a few in #jquery channel on Freenode and I cant get this to work. Here is my situation: I have a frameset with 2 frames: One's frame source is frame1.html (with Id of bottomFrame) and frame2.html ( with id of mainFrame). mainFrame source (frame2.html) has a div tag with the id of adDiv and this div tag contains an Iframe. bottomFrame source (frame1.html) has a div tag with the id of destinationDiv. I am trying to move the contents of adDiv (the iframe) from frame2.html to destinationDiv (frame1.html). I cant get it to work. I have tried the frameReady plugin (dunno if this is its purpose), but I cant get anything to work. Can i achieve this by only using jquery? Here is the code: //== titleUntitled Document/title script type=text/javascript src=jquery-1.2.6.js/script script $(document).ready(function(){ $(#mainFrame).find(#adDiv iframe).appendTo( $ (#bottomFrame).find(#destinationDiv) ); }); /script /head frameset rows=50,50 frameborder=no border=0 framespacing=0 frame src=frame2.html id=mainFrame title=mainFrame / frame src=frame1.html scrolling=No noresize=noresize id=bottomFrame title=bottomFrame / /frameset noframesbody /body /noframes/html I have also tried contents().find , but I have no idea how to work all this out. Im a noob yet with Jquery. Is the frameReady needed and what syntax? I have tried the same above code (and contents().find ) and I cant get anything to work. I would love is somebody could guide me on how to get this to work! Thanks Eric
[jQuery] How do I keep from focusing a readonly field?
Hi all, I have a table that I will usually want to focus the first input box in the first column in the last row. Something like this: table tbody tr ... /tr tr td input -- selects this one input type=hidden /td td input /td /tr /tbody /table And I use this to do that part: $('tbodytr:last-childtd:first- childinput').focus().select(); The problem is, in some cases, that input field is readonly, so I don't want to select it. I want to select the input in the next TD. If an input is readonly, the parent TD has the readonly class. I tried the following, but they didn't work: $('tbodytr:last-childtd:not(readonly):first- childinput').focus().select(); $('tbodytr:last-childtd:not([EMAIL PROTECTED]):first- childinput').focus().select(); $('tbodytr:last-child[EMAIL PROTECTED]):first- childinput').focus().select(); $('tbodytr:last-childtd:not([EMAIL PROTECTED]readonly]):first- childinput').focus().select(); I think the last one is close, but the parent TD could also have another class. Can anyone help?
[jQuery] How do i use JQuery ?
Im trying to download JQuery but its downloading a .download file ... what should i do ?
[jQuery] How do I remove a plugin melodramatically
All, If I were to add a plugin to an element on a page, say clueTip. How could I remove the plugin from the element when I want without reloading the page? Regards, Dan
[jQuery] how do I fix the position of an element?
Hello, I am a first time JQuery user, and was wondering how would I go about getting an element, say a php page that I loaded into a small block on my html page... now when I scroll up, down, left or right I would like this element(the loaded php page in the small block) to be fixed to the position on the screen, that is it moves up, down, left or right to compensate for the users scrolling. I hope that makes sense. In advance Thanks for Your Help!!! -- View this message in context: http://www.nabble.com/how-do-I-fix-the-position-of-an-element--tp19774250s27240p19774250.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] How do I update my control after I submit data to my database?
If I use jQuery .ajax to submit to my myUpdate.php file, after I do that, how do I then update my control that I submitted the information to update in the first place? For example, I have username textbox on a form, and I submit that username to a database. I then have a div or label that needs to show that newly submitted username if it is submitted to teh database correctly. I know how to submit the context of the textbox username to the database (.ajax,etc.), but not how to refresh that part of the page to show the database content. Thank you for any links or help.
[jQuery] How do I access the function handlers of an event.
$('#myid').click() will trigger the click event; and $('myid').click(function(){alert('clicked');}); will bind that function to the click event but how do I return the function that would be called when $('#myid') is clicked? (note: return, not call) Thank you,
[jQuery] How do I find out what the type of the HTML object?
So I got this code: $(document).click(function(e){ var target = $(e.target); }) How do I find out what HTML object (A, SPAN, DIV...) the target var is? Thanks.
[jQuery] How do I cache a page once it has been loaded via AJAX?
How do I cache a particular page that has been loaded via Ajax GET request. I want it to stop the GET request after it has been loaded and simply show data onclick. I set the cache setting to 'true' and it still calls the request. What am I doing wrong? code a id=myLink href=javascript:;My Link/a div id=myContainer/div script $(document).ready(function() { $.ajaxSettings.cache = true; $('a#myLink').click(function(){ $.ajax({type: GET, url: 'myPage.jsp', cache: true, dataType: 'html', success: function(html) {document.getElementById('myContainer').innerHTML = html;} }); }); /script /code
[jQuery] how do I stop a further event will be ahppened again if current event has not yet finished
Hi, all If an event hasn't finished how do I prevent the same event being triggered again? Thank you in advance! Jack
[jQuery] How do I run an ajax request on form submit?
Im new with jQuery and I have quite quickly turned a 54 line script into a 5 line jQuery script :) However all I want to do now is run an ajax request on the form submit but the problem I am finding is that it seems the form gets submitted before the ajax query returns its data - thoughts? script type=text/javascript $(document).ready(function() { $(form#RegForm).submit(function() { $.get(gencode.php,function(response) { response=response.split(\n); $(#serialnumber).val(response[0]); $(#passcode).val(response[1]); }); return true; }); }); /script Thanks Jim
[jQuery] How do I do a Ajax request before form submits
Hi, I created a form which I wanted to submit using jQuery (I'm new to jq) but before the submit I wanted to run an ajax request and attach the returned result to the form for posting. However it seems the form submits before the ajax request is returned, I can see the code generated in the DB but it never gets attached to the form. If I set the return false; and hit submit the ajax process runs and is attached to the forms hidden field correctly but obviously the form does not get submitted, any thoughts for a 'green skin' on this matter? script type=text/javascript $(document).ready(function() { $(form#RegForm).submit(function() { $.get(servertime.php,function(response) { response=response.split(\n); $(#serialnumber).val(response[0]); $(#passcode).val(response[1]); }); return true; }); }); /script Cheers Jim
[jQuery] How do you close a thickbox from an iframe and also refresh page
Hi, I've been trying to finish off a review section on my site but having trouble. I have a working review TB that pops up and holds the form for the review in an iframe. Once someone enters all the form info and submits it shows a thankyou message. At this point I would like the user to be able to click a button or link and close the thickbox containing the iframe and also refresh the page below it so they can see the review they have just added to the site. Here is a link to the test page - please help. http://www.weddingvenues.com/3558--The Milton--reviews--1.html ps. I have no idea about javascript so if you post and say 'just add a tb_refresh{}' I won't know what to do with it. Would you mention what html goes around it and the place and file to add it to. Don't mean to moan but thought it would save a bit of time :)
[jQuery] How do I write a JQuery expression for this?
Within a span with class TreeView, there is a table. Within the table, there are TD's. I want to select the TD's whose content ends in .pdf. How would I go about writing an expression to, say, apply a class to only those nodes? Thanks for your help, - Dave
[jQuery] How do I change the target value for all links with a target of _top
I am embedding an external page (with permission) in an iframe on my page. The problem is when the page has a link with a target value of _top it navigates out of the frame. An example link I could try to change is: a target=_top href=http://jobsearchlog.com;Job Search Log/a I want to change the target attribute value to an empty value or even better remove the target attribute from the link. I have been successful at using $('[EMAIL PROTECTED]http://;]') to identify external links so I figured $('[EMAIL PROTECTED]_top]') would work to identify the links with that target but it doesn't seem to work. Any help would be greatly appreciated.
[jQuery] How do I find and replace HTML comments?
Hello, I have a HTML page and I've included a HTML comment above my title tag which says: !-- this is my comment {2008} -- titlethe title of my page/title everytime the page is loaded I want to use jQuery to insert the current year in place of 2008, so if some one views the page next year then the jQuery script will update the comment to read: !-- this is my comment {2009} -- titlethe title of my page/title How do I do this in jQuery, I'm new to the library and can't seem to find an answer to this anywhere on Google. Many thanks for you help. Kind regards, M.