jquery

jQuery slideDown menu on .hover doesn't work until 2nd hover

The following code works successfully, except the menu slideDown only works on the second hover over my menu item. The first time it appears instantly, like no jQuery is applied at all the first time around. $(document).ready( function() { // animate dropdown menus $('#wp-admin-bar ul li').hover( function () { //show submen...

jcarousel external controls that remained changed

Hi I'm implementing a jcarousel very similar to this http://www.mint.com/ using jquery When a button is hovered it changes color the problem is that I want that button to remained changed until another button is clicked, like they did it on the link i mentioned. I've been working on this for quite a lot combining css, and all, but I w...

XML attributes to Array

Hello Everyone, I need to create a javascript array or object from an XML file that is structured as follows: <ITEMS> <TXT id="8" typ="1" pid="7" x="708" y="216" fcol="6777213" txt="sometext" hcmd="0" click="1"/> <TXT id="9" typ="1" pid="2" x="708" y="144" fcol="1231341" txt="some other text" hcmd="0" click="0"/> <GRAF id=...

How to load iframe on top of content in a neat sticky window with jquery

Im integrating a simple chatbox application into my site, which is simply added by iframeing chat.php I dont have a static place to put this on the webpage, and I want to load the iframe on top of the site's content on the top right (with ajax), which would remain visible unless I X it out at the top. Auto-triggering the chatbox to lo...

jquery getJSON function timing issue

I think my program is skipping result of JSON call. Is it possible to make a closure function here or make the program wait for JSON call to return? function username_not_duplicate(username) { var function_name = "get_username"; var parameters = [username]; var url = "/get_functions.php?function_name=" + function_name + "&param...

jQuery event delegation for select/options in Chrome

I am trying to bind a simple click event to an the selected option of a pulldown. $('select#myselect').delegate(':selected', 'click', function() { alert('selected'); }); This code works in Firefox, but not Chrome/Safari. Can I use the .delegate() to bind an option for a pulldown menu like this? If so, how? If not, what is...

jQuery Datepicker: Arrival and Depart textfields?

I apologize if this is a duplicate question but it's kind of hard to fiddle through all the datepicker requests.. I'm basically looking to implement this: I'm not really familiar with using datepicker other than a trivial setup. Has anyone had to implement this before, and if so how did you set it up to handle both arrive/d...

jQuery DataTables plugin - secondary sorting (multiple column)

Hello, I can't find a solution for this in DataTables plugin. What I want is to have secondary sorting. What I mean by that is - for example, I have a table with product name and price, something like this: NAME PRICE A product 22.00 $ C product 50.00 $ B product 50.00 $ D p...

<iframe src="reallylongpage.html#bottom" /> doesn't work

I have the following embedded iframe <iframe width="100%" height="400" src="reallylongpage.html" /> reallylongpage.html has 2 anchors #top and #bottom I want my iframe to load reallylongpage.html at the bottom of the page so I did <iframe width="100%" height="400" src="reallylongpage.html#bottom" /> But this has the undesirable ef...

Jquery select child of parent of anchor

I want to select and toggle() the child of the parent of the parent of an anchor. This is an example of what I am trying to do. It doesn't work :) <div> <div> <a href="#" onclick="$(this + ':parent:parent .inner').toggle();">hide</a> </div> <div class="inner"> To be toggled. </div> </div> ...

Using jquery to execute border:none and background-color:white on empty cells

Hi guys . So I have this (huge) table , classed with css (big_conv_tbl) . All "empty" cells have a &nbsp inside them , I'm also using an odd/even css script to make the table easier to read (and thus some "empty" cells have a gray background color) . What I want is to remove the borders and the background-color (set it to white) if the...

Can't see problem in JS

Hello, I want that when mouse is over an image, an event should be triggered ONCE, and it should be triggered again only after mouse is out of that image and back again, and also at least 2 seconds passed. If I leave my mouse over the image,it gets called like every milisecond,and by the logic of my function once you hover on the variab...

Detecting IE6 using Javascript/jQuery revisited

I need to detect IE6 in order to work around the lack of position:fixed. I've been using a simple regex: var isIE6 = /msie|MSIE 6/.test(navigator.userAgent); This works almost all the time, except for the user whose browser claims to be both IE6 and IE7: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE...

How to retrieve error message from an AJAX error callback in Grails ?

I am sending the following AJAX request : $.ajax({ type: 'POST', data: $(this).parents('form:first').serialize(), url:'/myapp/comment/saveOrUpdate', success: function(data,textStatus) {insertNewComment(data)}, error: function(xhr, textStatus, errorThrown) {alert(xhr.responseText);} }) ...and my controller action looks like this ...

How do I need to hit the controller on change on radio button using jquery

Hello Friends, I have a questions.. when initially page load I have two radio button in the page.. Add Edit when I select Add radio button I need to go the controller Action Add $("#Add").change(function () { // what should I write here to hit the controller? }); Thanks ...

jQuery Plugin On Event Return True/False

I'm creating a plugin that replaces alerts/confirms for a project and I was curious if there was a way to make it like a real confirm where you can do: if(confirm('Yes or no?')){alert('You agreed!');} Right now I could do with a call back using this syntax: $.alert('yes or no',{type:'confirm'}); But i want to be able to do: if($.a...

I am not able to hide the div tag using jquery?

Hello friends I have three div tags on my page.. I am trying to hide two div tags when initial page load <div id="firstpage"> </div> <div id="secondpage"> </div> <div id="thirdpage"> </div> my script is <script type="text/javascript> $(document).ready(function(){ $("#secondpage").hide(); $("#thirdpage").hide(); }); </script...

jquery namespaced events

How do I have a widget listen for clicks on other widgets but not listen to normal clicks on itself. For example: var $dialogWidget = jQuery('#dialogWidget'); $dialogWidget .bind('click.btn1.otherWidget',doSomething) .bind('click.btn2.otherWidget',doSomething2) .bind('click.btn1.otherWidget2',doSomething3); The problem with thi...

Cannot Pass All jQuery 1.4.2 Ajax Unit Tests With my Plug-in

I've created a plug-in that duck-punches the jQuery Ajax function. One problem that I cannot locate when running the Ajax unit tests for 1.4.2 It will not pass the two tests Ajax events with context jQuery.ajax context modification Test one has a test that always fails: function callback(msg){ return function(){ equals( this, ...

Changing input name value

Is it possible to change the name value of an input element? Here is my code but i can set anything but the name. $('#country').change(function(){ var $country = $(this); var $state = $('#state'); var $county = $("#county"); if($country.val() != 226){ $state.attr('name', ''); $state.closest('p').hide(); ...