jquery

Should I use .find(".foo .bar") or .children(".foo").children(".bar")?

When using jQuery for DOM traversal both of these return the same results (I believe): $("whatever").find(".foo .bar") $("whatever").children(".foo").children(".bar") Which is preferable to use? ...

play mp3 file using jquery

Dear all, How can i play an mp3 file using jquery in website.I m using servlets or http to play a song.Also how can i calculate total time of song played. Regards Angelina ...

Jquery thumbnail popup on link Mouseover

Hello All, I have this peice of coding which simply swaps an image when a link is clicked, I also show some hidden html content which is positioned over the image. <script> if($.browser.msie && parseInt($.browser.version) <= 6){ $('#contentone, #contenttwo, #contentthree, #contentfour, .linksBackground').hide(); } $('#contentone, #...

JQuery selector

$(document).ready(function(){ $('#hideButton').click(function(){ $('#disclaimer,#clock').hide(); }); }); In the above code snippet, suppose I want to add both the code for show() function to show the content and for hide() function to hide the content. is it possible? ...

How to change jQuery toggle() status

Using toogle to show/hide the div, I've got a problem that when I hide my div with anothor function, I have to click twice on the button to perform correct action. Is there any way change the toggle switch like I clicked the button? $('#add_task').toggle(function() { if ($("#new_task_status").attr("value")==0) { $("#new_t...

Change a link's href value based on time

I'm coding a 'Connect to Meeting' page where i would like the link that allows attendees to join our GoToMeeting event to 'become active' 15 minutes prior to the start time. So the page users visit to see the connection info (meetingID, password) includes the start time of the meeting. I need a button ('Connect To Meeting') to change f...

jQuery: How to reverse sortable('serialize') arrays from last to first?

The discussion begins http://stackoverflow.com/questions/654535/jquery-what-to-do-with-the-list-that-sortableserialize-returns/2920760#2920760 How to reverse it from last to first, updateList.php?id[]=5&id[]=4&id[]=3&id[]=2&id[]=1&&action=update? <ul> <li id="oreder-5">5</li> <li id="oreder-4">4</li> <li id="oreder-3">3</li> <li id="or...

Works in Firefox but not IE

Hello all, I make use of the following to find a string in a particular element, if it exists, tick a checkbox. This works great on Firefox but not internet explorer (8). I am having trouble finding why. $.fn.searchString = function(str) { return this.filter('*:contains("' + str + '")'); }; var myID = $('div').searchString(files_ar...

jQuery, .empty() and memory

Hello, my application (ASP.NET MVC) shows a page which loads data constantly, at certain intervals. The jQuery script calls a controller and this one renders a different partial view, based on certain conditions. This partial view is the appended to the DOM with jQuery; previous elements are removed with the empty() method. $(...

How to load a gallery from another page into a div on my page?

Ok so I am new to jquery. What I am trying to do is to have multiple galleries in one page. The in another page I have a div and some links. Depending in which link you click on the gallery to be displayed in the div should change. All my links have different Ids and all my galleries too. I know there should be a way to do it with Jq...

scroll function jquery

I have a fixed header. i want to change the opacity when i scroll down and restore the opacity when i scroll up (at top of the page) i write down this simple script: $(window).scroll(function () { if(scrollY == 0){ $("#header").animate({ opacity: 1 }, 1000); } if(scrollY > 0){ $("#header").animate({ opacit...

How to use the jquery jpagination plugin

Hi, does anyone out there know how to use the jquery recordset pagination plugin called jpagination? I have searched the net but there is no substantial info, all it says is use $(elementID).paginate(), what element are they referring to, is it a table, div where the table is, what. Any help will be appreciated. ...

jQuery: Split <td> from <tr>

Hey, I have a string containing <tr>s and <td>s. I want to split the data from the <td>s into an array. So that this: <tr> <td>Test</td> <td>Hey</td> </tr> <tr> <td>Test2</td> <td>Hey2</td> </tr> Becomes: array[0] = { test, hey } array[1] = { test2, hey2 } ...

Tablesorter Pager not working in Safari or Chrome

Hi all. I am building an app using the tablesorter plug-in and it's pager plug-in. Things work perfectly fine in Firefox and IE, but in Safari (4.0.4 on a PC) and Chrome () I get errors when it hits the following code that binds the tablesorter pager. I took the pager binding out and it worked, so something is going wrong somewhere in th...

DOM Element Width before Appended to DOM

I'm sure the answer is no, but is it possible to determine the width of an element before it is appended to the DOM? Once it's appended, I know I can use offsetWidth and offsetHeight. Thanks ...

JQuery and JSON - Add element

Hello, I have a JSON variable defined as: var myCollection = { "data": [ { "name":"Joe", "id":"1" }, { "name":"Bill", "id":"2" }, { "name":"Dave", "id":"3" } ] }; I have a JavaScript function that is responsible for adding items to the data element in myCollection. However, I'm not sure how to add a name/id pair to th...

jquery ui dialog button

Hello, With a jQuery UI dialog, I need to be able to set tooltips on buttons... I have the following code: buttons: { 'My Button' : function(e) { $(e.target).mouseover(function() { alert('test'); }); } This allows me to do something on "mouseover" but only once the button has been clicked. What do I need to do in or...

Disable list of holidays in Jquery date picker

How to disable a list of holidays using jquery date picker? ...

ASP.Net MVC - How to associate control made visible by jquery action to web model

I have a DropDownList populated with countries. When the user picks US I need to show dropdown with US states. If user picks CA - show dropdown with CA provinces...else show a TextBox. Depending on the country picked I hide/show using jQuery. That works ok. The problem is in the ActionResult when user submits. Html.DropDownList("S...

JQuery datepicker

Coud someone help me with this? I am getting these question marks in the graphic and i'm not sure why? I have seen these symbols before and i am sure it had something to do with charset. I am using: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> Here is my JQuery code <script type="text/javascript"> ...