jquery

Deselecting an element in jQuery

I have a collection of span elements. In the code I have a global variable that represents the "selected" object. Using the click event when a span is clicked I reset the object's class, reset the global variable, then set the object to the variable and change its class (to make it "highlighted"). This effectively toggles selection when ...

how can i get all inputs excluding buttons and hidden fields with jquery?

I've got the following which will excludes all buttons, but how can I also exclude hidden fields? $("#selector").find(":input:not(:button)").each(function (i) { // do something I'm sure this is probably simple, I just can't find it. Many thanks! ...

Moving an element to the body using jQuery

How can I move an element to the end of the body? Using jQuery, I want some given element to be moved to the body, preferably to be the last element contained by it. Imagine the following would be valid: $('#myElement').moveToTheEndOfTheBody(); Thanks! ...

Christmas advent calendar

I have a vision of an advent calendar, where there are pictures of real windows with shudders, and when the user clicks on a picture, the shudders open to reveal what's behind them. How can I do this? I suppose I could use the primitive slideDown method in jQuery. But is there a slideLeft and slideRight? Or an openDoor, where each sh...

Call a Javascript Function with Jquery

I have two functions in Javascript: function getWindowWidth(){ var x = 0; if (self.innerHeight){ x = self.innerWidth; }else if (document.documentElement && document.documentElement.clientHeight){ x = document.documentElement.clientWidth; }else if (document.body){ x = document.body.clientWidth; }return x; }function getWindowHeight(){ var...

How can I know if an element is a direct child of the body using jQuery

I want to perform some action on elements that are not direct child of the body. How can I check a particular element to know whether its partent is the body. Thanks! ...

Javascript parent page redirection from iframe.

Hello to all. I need to implement parent page redirection from iframe. I know that it is impossible to do in different domains due to browsers security. However I found that links have target attribute and tried to use it in the following way: <a href="http://google.com" target="_top" id="testParentRedirect">someLink</a> It works fin...

jQuery .load() not working in Chrome

.load() was working fine, but for some reason it's not in Chrome now (presumably some kind of update). I'm on Chrome 5.0.375.55. I've isolated the problem to this: index.htm <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; <script type="text/...

How to display a very long page like dzone.com?

Hi, If you ever visit dzone.com you'll notice that all the posts appear on 1 page only. When we scroll that page down, older posts will be added to the end of the page (and maybe some posts at the beginning of the page but outside the view port will be removed). My questions are: - how to know if the user scrolls down/up with javascrip...

how to validate

I have this Calendar Control I am using. A user can select any date from the calendar. I need to validate the dates like Saturday and Sundays and 1/1 and 1/25. If they select these days I need to show them a Popup message if it's not a valid date. Can anybody help me out? thanks ...

Triggering CSS :active selector for non-anchor elements

QUESTION: How do I trigger the :active state for non-anchor elements via JavaScript (jQuery)? While reviewing Section 5.11.3 of the W3C CSS2 specification in reference to :hover pseudo selector to see about triggering the activation of a , I came across the following which led me to believe it should be possible: "The :active pseu...

Jquery Galleria pause and play on hover

Hi. I have implemented the jquery Galleria plugin in a website, but would like for it to pause when I hover my mouse over it and play again, when I remove the mouse. How can I do this? Thanks Vayu ...

Javascript - remove part of cookie with a split('|') like array

I'm abit stuck. I'm using jQuery. I have a cookie which has the value such as : 1,something|2,somethingg|1,something We are treating it as [0] as id and [1] as name. I need to remove ONE where the id == '1' for example, this will leave the cookie like this: 1,something|2,somethingg How do I go about this, it will probally be in...

jQuery for dynamic Add/Remove row function, it's clone() objcet cannot modify element name

I'm try jQuery for dynamic Add/Remove row function, but I meet some question in IE8 , it's clone() objcet cannot modify element name and cannot use javascript form (prhIndexed[i].prhSrc).functionKey, but in FF it works very well, source code as attachment, please give me a favor to solve the problem. <script type="text/javascript" src=...

using jQuery $get to pull data

Hi, I am trying to send a date to the server as part of a get transaction, however, looking at the urls (through firebug), it appears that the var sDate is never replaced with its value. Sorry i'm very new to JS and Jquery, so this is likely a very elementary mistake - i'm guessing it has something to do with the map that i am trying t...

jquery.ajax returns content-type "html" on iis while it returns content-type "json" on local host

Hi, I am using jQuery.ajax function to make an ajax call to a page method in asp.net. I specifically set the content-type to "application/json; charset=utf-8". When I looked at the response in the firebug it says the content-type is html. Following is the code to my ajax call $.ajax({ async: asyncVal, type: "...

how to select a div within a list in jquery

I'm following a tutorial for a menu bar and I'm having trouble adapting it to use qTip because I cant seem to be able to find a way to select a particular element. <div class="leftside"> <!-- all things in floating left side --> <ul id="social"> <li><a class="rss" href="#"></a> <!-- icon --> ...

jqGrid: Editable column that always shows a select

Is there a way in jqgrid to have an editable column that uses a select like in this colModel example: { name: 'Options', index: 'Options', width: 150, align: 'left', resizable: false, editable: true, edittype: 'select', editoptions: { value: function() { return buildSelect(); } }, formatter: 'select' } but always shows th...

Populating a UL with Jquery

Hi Guys, I'm a little bit stumped with this UL I'm building. I've been able to populate the list no problem but it's all messed up when it comes to formatting. Here's my script: $.ajax({ type: "GET", url: "/shop/assets/xml/tonneau_makes.xml", dataType: "xml", success: function(xml) { var selectInfo = $("li.select...

jQuery UI datepicker performance

I have a textbox on my web page that is used to specify a date, so I'd like to use the jQuery DatePicker. However, most of my users are locked into using IE6 and the performance of the jQuery DatePicker is a little sluggish in this browser. Can anyone recommend an alternate JavaScript date picker, or any means of improving the display p...