jquery

Colorbox callback on gallery/ grouped photos/ slideshow?

Hi, I have a gallery setup to find the next span, this works, but the gallery navigation(next/previous/imageclick) is not passing the callback. $("a[ rel='gallery']").colorbox({ onLoad:function(){ $(this).next('span').show().prependTo($('#cboxContent')); $('span').addClass("current"); } }); I tried somet...

jquery name attribute of map element in IE

The following jQuery works fine in Firefox for me, but failed in IE6: $("<map></map>").attr("name",somevar).appendTo("#someElement"); The problem is that the map element never gets the name attribute generated which I can prove by calling alert($("#someElement").html()); and the fact that the image it is associated with doesn't have i...

How to specify to do a function in a specific area only, in jQuery?

I have this jQuery snippet: $(function() { $("ul > li").hover(function() { $(this).find("ul").stop(true, true).animate({opacity: 'toggle'}, 'fast'); }); }); This opens every <ul> what's inside in another <ul>, but I want to make this only for : <div id="header"></div> EDIT Here is the structure, I modi...

JavaScript will not run a second time

I am running a script using $(document).ready() it is performing the way I want it to on load up, however, the same script needs to be ran when an html select control is changed. What I need ultimately is for the filter and sort to run on initial load with sorting on Low to High, and then after the page is loading the user should be abl...

How to use jQuery in Google Sitemaps and is it allowed.

How do I use jQuery in a Google Sitemap and most importantly does it violate the specifications rules or will it be blocked by Google because of the jQuery? ...

Why is Jquery returning the wrong length?

I'm using this code to add an element to a form. Then I count the total number of elements with that class. However, Jquery .length returns the number of elements times two. Any ideas what I'm doing wrong? $(function () { function updateWeight() { var z = $("input.count").length; alert(z); } $("#addCatalogIt...

Jquery and radio buttons

So I have some custom radio buttons which I created using js and some css, now I want when I click on a custom radio button, to set the clicked radio button as checked and the order ones as unchecked, so it should be only one checed radio button at the time.Here is what i tried to do, but doesn't work. $('.custom-checkbox li span, ....

jQuery UI Datepicker Range

I asked a pretty similar question a few days ago, but this one is different enough that I didn't feel like derailing the other helpful topic. I basically want to set up two text input fields and hook them both up with jQuery UI's Datepicker to have them act as a range... I want the second input field start date to be contingent upon what...

ASP.NET MVC 2 Confused about Javascript

Hi I'm building my first MVC 2 app and I'm really confused by all the examples I'm reading. I am also using the Telerik MVC kit for their Grid, and other such controls. I've read many tutorials and watched videos but I can't quite grasp the pattern of where to place javascript and how to wrap blocks of code in the appropriate tags. For ...

How to make a image/content slider with jquery

Ive seen a lot of the tutorials and plug ins out there, and was curious about making one from scratch. Basically I want to have a nav with a "#prev" and "#next" link. A content container with a fixed width and height, overflow:none that contains several container div's that house content. Is it as simple as indexing the children of the c...

Show a number of text input form fields based on a number entered into another field

I have a form where a user may purchase three levels of tickets. With each level, the user chooses a quantity by entering the number of tickets into a plain text input field. When the user leaves that field by clicking on another or tabbing to another, I would like a number of new form fields to be created just below that line, the numbe...

Is it possible to implement "Remember Me" using jquery cookies?

Is it possible to implement "Remember Me" using jquery? If so, any suggestion how it can be done? EDIT: I am trying to remember username and password using jquery cookies.store cookies about username and password and read it the next time and redirect to a specific page. ...

What's wrong with jQuery, .css and z-index - i.e. find the error in the following code?

What's wrong with this? $("#tag_square").appendTo('#edit-area img').css({ position: "relative", left: "100px", top: "10px", z-index: "2"}); Everything up to the z-index works perfectly. Once I include the Z-index though, I get an 'uncaught SyntaxError - Unexpected Token' in the Javascript console. What gives? Any ideas on what ...

how can i trigger event when hidden div get focus in jQuery?

In a tabb design If there are multiple hidden div how can i trigger event when hidden div get focus using jquery. I tried "focus" but thats for form controls. please suggest ...

what is showErros function do in jquery validation

I am using Jquery validation plugin to validate my form at client side. I need to know what showError function does. It takes two parameters errorMap and errorList, what are these parameters. ...

handling the display of choices in dependent select elements, in html

Hi guys! Firstly, I am sorry, i just can't seem to phrase my question well. Setup: I am using Drupal to build this location-based application. i have a form which allows the user to select his/her location. the form has 3 'dependent' select elements e.g. country, city, state. they are dependent in such a way, that selecting a partic...

How to get request url in a jQuery $.get/ajax request

I have the code: $.get('http://www.example.org', {a:1,b:2,c:3}, function(xml) {}, 'xml'); Is there a way, to fetch the url it used to make the request after the request has been made(in the callback or otherwise)? I would want the output: http://www.example.org?a=1&amp;b=2&amp;c=3 ...

Set jQuery toggle back to beginning

I have this code to show/hide (toggle) a div when clicking a link: $('#complete-services-link').toggle( function () { $('#complete-services-box').fadeIn('fast'); }, function () { $('#complete-services-box').fadeOut('fast'); } ); The #complete-services-box is the div that is being shown/hidden, typica...

Disable button in update panel on async postback

I have multiple update panels with various asp buttons on a single page. I want to disable the buttons which caused the postback in update panel untill it completes. Is there a way to avoid using a third party control for this? through JQuery or any other method ? ...

My Return false is not working in this code..using jquery

$(function () { $('#form4').submit(function () { var val = $("#txtNewServiceTypeCategory").val(); $("#ServiceTypeCategoryName").children("option").each(function () { var $this = $(this); if (val == $this.val()) { alert("ServiceTypeCategory Name is already added! Please Choose D...