jquery

Accessing Parameters *and* Events in function from jQuery Event

Hello all, This is a follow-up question to a different question I asked not too long ago. Typically, you can access an event in a function call from a jQuery event like this: $item.live("click", functionToCall); and in the function: function functionToCall(ev) { // do something with ev here, like check 'ev.target' } But what if ...

How to use jQuery in affiliate sites?

Let's say I want to give my partners a simple <script src> tag to include some dynamic content on their site, loading from my site. Is there any way I can use some javascript framework in my .js file so I can do some more fancy things? jQuery? I assume this is a problem as it might conflict the site's own javascript code? What if they a...

jQuery form zip code to state function

I'm trying to convert a preexisting javascript function into a jQuery function. The function comes from http://javascript.internet.com/forms/zip-to-state.html and aims to convert a user-entered zip code into a state. I'm using jQuery 1.3.2, with all the necessary plugins, but I'm not very familiar with jQuery syntax and how to convert th...

jQuery ajax images preload

Hi. Given this, which preloads an image: $('<img />') .attr('src', 'source') .load(function(){ $('.profile').append( $(this) ); // Your other custom code }); do you know how to do the same but for several images? I tried something like : var img1 = new Image(); var img2 = new Image(); $(img1).attr('src', ...

JS event handlers. Creating nice CSS button with jquery and integrating with jquery.validate and/or jquery.form

So, i'm writing a plugin using js with jQuery, that will replace all buttons (input type=submit and <button>) on my site's pages with nice buttons that look something like <a href='#'><span class='label'>Ok</span><i></i></span> At the very beginning i ran into trouble: some of my buttons don't just submit the form - some are hooked with...

jquery contains help

I have some html which I would like to manipulate. Its structure is as follows: <tr> <td> <nobr>TEXT_TO_LOOK_FOR</nobr> </td> </tr> I've written a function here which hides the row containing this text, but I'm just wondering if anyone can clean it up. I feel like it is probably making jquery do more work than it needs t...

show/hide div based on radio clicked with class

hello. I have 4 radio buttons that correspond to 4 different divs. i want to fadeOut the current div and then fadIn the new selected one. right now its working but just fades between images. Also is there a way to change the divs based on the radio's class and not value? Code I currently have: <input type="radio" name="myRadio" class...

jQuery disable form element when checkbox is checked

I have a complicated jQuery form and I want to disable several form elements if a certain checkbox is checked. I'm using jQuery 1.3.2, and all the relevant plugins. What am I doing wrong here? Thanks, Dakota Here is my HTML: <li id="form-item-15" class="form-item"> <div class='element-container'> <select id="hou...

Jquery replace string

May sound like a total noob question but i'm looking for a javascript (and or jquery) function to replace an element in this code : <embed id="ply" width="800" height="400" flashvars="file=http://example.com/play/" allowscriptaccess="always" allowfullscreen="true" quality="high" bgcolor="#00000" name="ply" style="" src="/vide...

datepicker in JQuery UI Dialog shows calender on dialog open

I have a JQuery modal dialog with 2 JQuery UI datepicker inputs. My problem is that when the dialog opens the calender is already open on the page. I am not sure if this is because it is getting focus but the net result is that it shows on dialog open. Here is my code: <script type="text/javascript"> $(function() { ...

How can i break/exit from a each() function in JQuery?

I have a code: $(xml).find("strengths").each(function() { //Code //How can i escape from this block based on a condition. }); How can i escape from the "each" code block based on a condition? Update: What if we have something like this: $(xml).find("strengths").each(function() { $(this).each(function() { //I want to...

jQuery: Binding and Unbinding Live Click Events

Hi, So there are two constraints to my question: I must use an external function call in my click event, and I must use a live click event, rather binding a typical click event. So my problem is that I'm trying to unbind a click event after it occurs, and then rebind it once the click event code is complete. I'm doing this to preve...

Get the selected option from a list

hello, I'm trying to get the selected option via jQuery everytime I change it, and eventually the value attribute, buy I always have problems with js!! HTML <select> <option value="us">United States</option> <option value="gb">United Kingdom</option> <option value="de" selected="selected">Germany</option> <option value="fr">France<...

Cursor location in text-input fields

There is a lot of information on how to place the cursor exactly where you want it to be in a textarea. None of it seems to work for an <input type="text"> field. Basically, when the page loads, I have an input field with text in it, and it's focused. The problem is that the cursor is at the end of the pre-written text. I need it to be ...

How to use properly use thickboxes in my application?

I have a couple questions regarding thickboxes. I am developing a site that needs a few thickboxes on the home page to be displayed at different times. When the thickboxes are shown, it will trigger an API call and display feedback in the thickbox. I decided to go with displaying the thickboxes inline to reduce the amount of Ajax call...

DatePicker minDate relative 1 month from start date

How do I set the #endDatePicker 1 month to the future of the selected date from #startDatePicker? I am not figuring this one out but I am sure it is easier than I am making it. Here is what I am starting out with. Now I need a function that calculates exactly 1 month(not just 30 days) into the future based on the selected date from the...

Repeat a jQuery AJAX POST function

I have a clickable div loading the next 5 comments from my database, sort of how Twitter loads new tweets into your timeline. I have a few other POST functions in my code and they can be fired off multiple times, but this one won't. Here's the code - the comments are returned from a URL (the site is codeigniter), inserted into a hidden...

How do you control an html ordered list number from jQuery?

I currently have the following html which does not show the ordered list properly on IE7: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <style> li { min-height: 20px; } </style> <ol id='id-booking-steps'> <li>Stackoverflow</li> <li>Superuser</li> <l...

Use JQuery to keep active sub-navigation open when loading a new page

I have built a sidebar navigation that collapses & expands when the nav titles are clicked. this all works great. however, if i expand / open one of the nav groups and click to go to a page, when the new page loads all the nav groups start out closed again. I would love to find a way for the active nav group to stay open. Here is what I...

How to apply jQuery Accordion to radio button group?

Is it possible to apply the jQuery accordion effect on a group of radio buttons? I tried putting each radio input into it's own div, but then the radio buttons themselves don't select/unselect when I click on them. ...