jquery

jQuery .eq(x) returns different element in IE than in FF/Chrome

I am using the .eq() method to select a specific child element of a known element. It appears that the element indices are different in IE and in Chrome/FF, as .eq(2) returns different values depending on browser. (The element I'm looking for shows up as .eq(2) in FF/Chrome, but .eq(3) in IE) For example, alert($(this).parent().childre...

Intergating dokuwiki and jquery

Dokuwiki us prototype, my site use Jquery. If there is another way to alter Dokuwiki javascript, instead using jQuery.noConflict(), or/and var $j = jQuery on my jQuery? I open all .js files on Dokuwiki, search for "$(" and replace it with "$DW(", and it works like a charms, but I had to deal with every Dokuwiki plugins that has javascr...

jQuery event order and waiting till animation complete

I have an slider animation but on clX.click event #close div hides before it is animated -250px left. How to wait till the animation completes and then hide #close div? $(document).ready(function() { $("#open").click(function() { if ($("#close").is(":hidden")) { $("#open").animate({ ...

jQuery AJAX type: 'GET', passing value problem.

I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:"userId=12345&userName=test", success:function(data){ alert('successful'); } }); In my console output is: GET:http://sample.com/createUser?userId=12345&userName=test params: userId 12345 userName test In my script i ...

show loading gif of image only if it is really loading it for the first time

i have 2 img elements. 2 id's for them: rimg and limg. limg is the loading gif and rimg is the reloaded full vertsion of the image. the is the code to show the loading before image finish to load: $("#limg").fadeIn("fast"); $("#rimg").attr("src",$(that).attr("bsrc")).load(function(){ $("#limg").fadeOut("fast",function () { ...

How to know the target element that raised the event in the ajax response callback?

I am posting to the server using jquery ajax using $.post. After server returns the response, I process the response in the callback function. In this callback function, how can I know which element was clicked on. Please check the following. In the function handleServerResponse, I would like to know the DOM element that raised this eve...

how to compare two element in jquery

var a=$('#start > div:last-child'); var b=$('#start > div.live')[0]; alert(a==b) alert(a==$(b)) it always false, how to compare two element in jquery, thanks ...

jQuery deleting cookies using cookies plugin

I am using this plugin to store some cookies: https://code.google.com/p/cookies/wiki/Documentation I was wondering how i would go about deleting all cookies with a certain prefix and/or delete all cookies that have a certain value. I need this to be done once some user has completed their journey through my application. For example i...

jQuery Prepend an Image

Hi Guys, I am trying to add a prepend of an image and then define it's attributes. Little confused as how to do this - currently I have the following but it's not working. The HTML is <div id="testID" class="test1"> <div id="testID2" class="test2" ></div> </div> And the JS is var test123 = somecode{} jQuery(test123).find...

Jquery - Hide specific div

I have several divs that share a common class. If one of these divs do not have a child div, I want to hide the div. I can find the right div but I'm unable to hide it. This is my code, $(function() { if ($(".adRight.childen('div')").length == 0) { $(this).hide(); } }); What should I use instead of ...

Jquery - Create hidden form element on the fly

What is the simplest way to dynamically create a hidden input form field using jquery? ...

not able to remove nested lists in a jQuery variable

Hi I have a nested oredered list which i m animating using this code... var $li = $("ol#update li"); function animate_li(){ $li.filter(':first') .animate({ height: 'show', opacity: 'show' }, 50...

jQuery slide in from outside the screen and IE ofverflow issue

I needed a div to slide in from beyond right edge of the screen. So I defined the CSS: #mydiv { position: relative; left: 2000px; } and to prevent scrollbars: body { overflow-x: hidden; } Then in jQuery: $("#mydiv").animate({"left":"-=2000px"},1500); This solution worked just OK in FF and Chrome but than I found out overflow-x: hi...

Jquery DateJs, is there validation for full date?

Hi all, I just find out about the power of date js, And its great!!! As I am a newbie I was wondering if there is any kind of general validitation for different types of full dates. eg. var d1 = Date.parse('2000-10-18, 10:06 AM'); alert(d1.toString('HH:mm')); If date is ('200-10-18, 10:06 AM'), of course it doesn't like it. So my q...

Range issue with ui-slider

Hi, I’m trying to set up a range with a slider. I would prefer if both cursors did not overlap in the same value. In other words, how do I get the sliders to freeze and stay put when the minimum value slider and the maximum value slider come next to each other. Any ideas? Thank you in advance. ...

Can't load flash code into page with jquery ajax

I am trying to load some flash banner code (from database) into a webpage using jquery ajax. It is all working when adding the flash code in code-behind but when I am trying to load it with ajax some flash banners make the complete website disappear and only shows the banner. I am using jQuery Ajax and the response is in html like: <...

Jquery checking that passwords match with php + Json

I have a form that I am validating with JS and PHP. Everything is going well so far apart from when I try to check if the passwords match. Here is the form: <div> <label for="passlength">Password, valid: 0-9</label> <input type="text" name="passlength" value="<?=@$_REQUEST['passlength']?>" id="p...

Extending the Google CDN version of jquery to add datepicker

I'm using jqueryUI solely for the datepicker feature. It's great if you can get away with using plain jquery because then you can import it from Google's CDN, which is potentially faster than your own CDN (if any) and heightens the chance the user will already have it cached, but you can't do this with jqueryUI. I'm wondering, since jque...

Run a function when a DOM element is created

Hi folks, I want to bind an event to a certain class and ID for when matching objects are created in the DOM. I am doing this as I have some jQuery code in an ASP UpdatePanel, which causes the DOM to be re-loaded on its partial postback. I have reset the events with live(), however I need to call a 2 line initialisation function as soo...

How do I use Jquery to find and select a Multi Select option by the Value?

I can't seem to figure out how to correctly select a Multi Select option by the Value and leave the other options that are selected alone. Update It does work, thanks! I had the multi-select hidden and I thought firebug would update the option to "selected" but it doesn't. When I "show" the multi-select box after setting the attr to s...