jquery

How to loop through array in jquery

i am tring to loop through an array i have the following code var substr = currnt_image_list.split(','); //This will split up 21,32,234,223, Am trying to get all the data out of the array. Can some one lead me in the right path please. ...

Manipulating strings in jQuery

Hi folks I've got an anchor tag with a specific URL to which I want to add a class. I'm currently doing this as follows: $('a[href=http://this.ismyurl.com/folder/file.html]').addClass('red'); The problem I have is that this URL is not consistent. The filename, file.html is always the same, so if I could manipulate this string and f...

Find id of an LI element in a nested UL LI structure using jQuery

Hi, I have the following sample HTML code: http://pastebin.com/Mya6tPc6 And here is the jQuery code I am trying to use: $("#folder1").click(function(){ alert($(this).attr('id')); }); $("#f1").click(function(){ alert($(this).attr('id')); }); Here is the problem: If the user clicks on the element 'folder1', it will display 'folder1'...

Childwindow javascript method opening another child window

I am opening a child window using window.showModalDialog(). In child window I am calling another javascript method OK button click. When I do "OK Button" click in child window, another new child window is opening un-wantedly. Please follow my steps Here is the Parent Javascript method with window.showModalDialog() 2.In ProfilePic.aspx...

simplemodal window positioning on ipad

I'm just finishing some work on a project viewer that presents a nested jQuery Cycle widget within a SimpleModal window. It's working very well, except that now I'm trying to debug a few things for iPad. Take a look a the graphic below for a better idea of what's happening, but basically SimpleModal seems to have trouble with the way mo...

How to make those dynamic anchor links with jQuery?

I've recently discovered a website which does something really cool! Example: There are two links "Cat" and "Dog". There are two DIV containers, id="catImage" and id="dogImage" The initial URL looks like http://mysite.com/#cat Initially, the cat image is visible Clicking on the Dog link will fade out the catImage div and fade in the d...

Jquery nextUntil() alternative.

I have the following code which it was provided by Nick in a previous question and it work like a dream. What I am trying "I am trying to generate a jquery script to make all tr elements from a table with class top clickeable and when one tr with class top is clicked all tr below with class bt until there is another tr class top will ...

JQuery image fade speed

What is the syntax to assign a speed to each fade? function fadeIn() { $(this).fadeIn( fadeOut ); } function fadeOut() { $(this).fadeOut( fadeIn ); } fadeIn.call($("#myImage")); ...

jQuery : drag and drop : find the id of the target

Hello friends I am developing a drag and drop app. I have a DIV that is draggable along the document and there are some other divs in the document, I can drag one div to other divs, but how can I find the id of the div to which I dropped the dragging DIV, I just want to know the id of the target DIV after placing another DIV over it. ...

Jquery UI Autocomplete - Way to show preferred

Hi. I'm a newbie programmer / designer trying to configure jquery ui autocomplete. I have it working, using a javascript object (array). The array contains retailer stores that we are directing our customers to. We have certain stores that are preferred and so we would like for them to come up earlier than other stores but I don't really...

Remove Pan control in Google Maps API V3

Is there any way to remove the circular panning navigation control but keep the zoom control in the Google Maps V3 API? I've tried forcing it offscreen with jQuery but every time the map is updated it comes back. Any ideas? Thanks! ...

jQuery scroll is not working correctly when inside div

I created a jQuery function that applies a class to a paragraph, and then scrolls to that paragraph when a button is clicked. It works fine when the paragraphs are relative to the document, but I want the scroll to happen inside a div. Currently, the scrolling is working, and it is applying the class correctly, but it is does not scroll ...

jQuery .change() stops working when I remove a debug alert()

So I have the following code at the moment: <form action=""> <div id="term"><select name="s2" > <option name="" value="">--Select Term--</option> </select></div> <div id="dept"><select name="s3" > <option name="" value="">--Select Department--</option> </select></div> <div id="course"><select id='selCourse' value=""> <option name=...

How do I break out of an $.each in jquery?

How to I break out of the following jquery each method when a condition is met; var rainbow = {'first' : 'red', 'second' : 'orange', 'third' : 'yellow'}; $.each(rainbow, function (key, color) { if (color == 'red') { //do something and then break out of the each method alert("i'm read, now break."); } }); ...

jQuery DOM node with additional selectors

I'm trying to do additional selections after I pass in a DOM node in jQuery. In this example, I'm trying to show a "hidden" submit button after a change in the select box (notice, I'm passing in the FORM element, NOT the SELECT element: <form id="UpdateRegistrationStatusForm"> <select id="registration_status" onchange="AdjustRegist...

Add a new image in jquery and make it clickable

I am trying to add an image in jquery and then make it clickable I have maked the following code below but it does not work. It adds the images but it will not make it clickable. $(".HeaderGifs").click(function() { alert("It Works"); }); $("#show_images").val()).append("<img class='HeaderGifs' src='images/text.jpg'></img>"); ...

Automatically convert css to mozilla specific css

If my css is: border-bottom-right-radius: 20px; is there a JavaScript library that will convert it to -moz-border-radius-bottomright: 20px; automatically if it detects a user agent that is a mozilla browser, example: Firefox? ...

How to reposition a dynamic HTML element on the right side of a browser window?

I am using jQuery to do the following in one function: initially I have a aboslutely positioned DIV; I set inner HTML of the DIV to some needed text/HTML; then I am showing the element at some certain coordinates using css({top: initialTop,left: initialLeft}). Everything works fine inside the left and center area of the page - I see th...

Modal popup flickers or flashes first time I click. Next click doesn't cause it to flash.

OK I am posting the whole code. So any tag with name=modal will render the modal. Hope this will help finding the flicker issue. This is how it is triggered: <a tp='#dialog' name='modal' tgt='bob' title='Send message'>Send message</a> JavaScript code: $(document).ready(function () { initmodal(); $("#dialog #mo...

JqGrid is not filling with data

I have all the required javascript included, and the proper locale (at least, I think): <script type="text/javascript" src="http://localhost/Web/Scripts/jqgrid/js/jquery.jqGrid.min.js"&gt;&lt;/script&gt; <script type="text/javascript" src="http://localhost/Web/Scripts/jqgrid/js/i18n/grid.locale-en.js"&gt;&lt;/script&gt; Here's the j...