jquery

jquery.quicksand position calculation problem

Hey all, I've been working on a little site for a couple days and have a the super cool jquery.quicksand plugin running to sort through portfolio entries and I'm having a problem when selecting the 'all' filter. If someone would take a second to help out, I'd be very grateful. Due to the nature of the problem, it'd be best for you to ...

how to remove table row based on contents of one of the cells in the row (with jquery)

hello, i'm trying to delete one row in a dynamically generated table; the problems is that none of these rows have any class or ids generated and i can't get at the code. it generates code like this: <tr> <td class="label">Who referred you?</td> <td class="data">somebody</td> </tr> <tr> <td class="label">terms</td> <td c...

jQuery question - how do I do this?

I am playing with the modal forms available with jQueryTools. I want to use the modal forms on one of my pages, using the example provided here: http://flowplayer.org/tools/demos/overlay/modal-dialog.htm I need to modify the example given above for the following reasons: My web page will have a dynamic number of forms on the page (the...

How do I store my websites header and footer in one location?

I am always rewriting my headers and footers and for every edit i have to manually copy and paste all the code into the web pages. Obviously this is the wrong approach but im not sure of the right one. My current idea is to have a "header" and "footer" div and then with jquery's $(document).ready load the divs with code. Im afraid it wil...

Converting UTS (UTC-0) times to BST in PHP or jQuery

I'm pulling the most recent listened tracks from last.fm and putting them on my website. Problem is, the times are retrieved in UTC-0 uts format and appear to be an hour out when comparing them to BST times in order to calculate a fuzzy time stamp ("about 5mins ago", "about an hour ago" etc). Is there any way solve this so the times al...

Input value problem when to fast typing

$("#input").keyup(function(){ console.log($(this).val()); }) Problem is when one is typing slowly "a" & "b" the above code will result in "a","b" in console log. But when somebody does it quickly the result is "ab","ab". It's easier to do with letters which are near on a keyboard eg. "e"&"r". How to avoid it? Events keydown and keypr...

check if mouse is over an object

Hi, I am working to modify a script, Here is original lines; function JT_init(){ $("a.jTip") .hover(function(){JT_show(this.href,this.id,this.name)},function(){$('#JT').remove()}) .click(function(){return false}); } I am trying to do; function JT_init(){ $("a.jTip") .hover(function(){J...

How to dynamically add an active state with jQuery to a gallery thumbnail

I'm using galleriffic to handle my image gallery and I'm having a problem with the thumbnail active states. Galleriffic doesn't have support for active states on the images - only the list items. Right now the gallery will assign a "selected" class to the current LI containing the thumbnail and I've been trying to use jQuery to target t...

jQuery Validation: How do I create a custom error message element (not just text)?

I've seen a lot of examples on how to use message: to have custom error text. What I'm trying to achieve is something different. I have client-side and server-side validation, so I want the same error message shown by both. To avoid duplication of code, it seems like having <div class="error" id="bad_email">Invalid e-mail</span> is the ...

Retrieving the Value of an input text field in Jquery

Absolute noob question. I have a form <form> <input type="text" id="cars" name="cars"/> </form> When the user clicks on a link , my jquery function needs to pick up the current value of this input field. How do I retrieve this value? Doing a $("#cars").val gives me a block of html and not the string typed in by the user, Also $("...

How to make a new parent class for an element w/ jquery?

So I have something like <div> <!-- other stuff then--> <button>Hey</button> </div> and I'd like to make that (using Javascript/JQuery) <div> <!-- other stuff then--> <div class="bw"> <button>Hey</button> </div> </div> Is that possible? I couldn't find anything with material on it online…but, I'm a totally JS noob, so...

Breaking changes in jQuery 1.3.2 to 1.4.2

I have wasted an entire day trying to fix problems with my pages. After I realized that the pages stopped working when I moved from 1.3.2 to 1.4.2, I changed that line in my template, and my pages continued to work as before. I have the greatest respect for the jQuery team and the library that they have created. I cannot for one moment ...

JavaScript drag-and-drop proxy

I want to enable drag-and-drop behaviour on my Web application. I have an image I want to drag. The image is behind another one that has transparent sections so that you can see the image beneath it. I do not want to change the order of the images. My thinking is I should use another layer on top of both images that is transparent an...

html input field options

Hi, I have a input field and on clicking that I will show a date picker to select the date. I would like to always make this field select using from that picker and not by typing. the reason is, i am just modifying this one field and don't want to touch the whole code to validate this field. i have given enough drop down options for th...

jQuery 1.4 change(), checkbox and IE

Hi! I have a page with a checkbox that is set to checked when the page is loaded. If/when the checkbox is unchecked I need to run a function. The following code works fine in all browsers with the exception of IE. In versions 7 and 8(haven't even tested 6) it works but you are required to uncheck it, check it, then on the second uncheck...

Jquery append element and then alter css?

Hi Everyone! I'm attempting to create a div tag and then alter it via css, but for some reason its not working here's my code: $('#draw').click(function(e){ var divToAdd = "<div id='box' style='display:block;background-color:red;width:100px;height:100px'></div>"; $("#area").append(divToAdd); }); $('#left').click(function(e){ //va...

How do I stop an animation "mid-stream" and reverse it?

Here is my HTML: <div id="nav_bar"> <div id="nav_image"> <img src="navimage.jpg" /> </div> </div> and my jQuery: $("#nav_bar").mouseenter(showNav).mouseleave(hideNav); function showNav(){ $("#nav_image").stop().fadeIn(250); } function hideNav(){ $("#nav_image").stop().fadeOut(2500); } The problem was that if the mouse...

Observing for insertion of new DOM nodes and calling a method on them

I'm writing some javascript using jQuery to call a method on all nodes with class datepicker. Here's what I have: $('.datepicker').my_method(); This works as expected - it calls my_method. However, I want to be able to call my_method on all new nodes that are inserted into the DOM with the class datepicker. I want similar functiona...

Stop loading of images on a hashchange event via JavaScript or jQuery

I am using the jQuery BBQ: Back Button & Query Library plugin to create a page that pulls in dynamic content when a link is clicked. When the link is clicked the hash is changed and new content is pulled in (the 'default' action of clicking a href is therefore disabled.) That part works just fine, but there is a problem. Example of my ...

Using hide()/show() with elements I hid 'manually' ?

Hi, I'd like to prepare a page using jsp, hiding an element in the jsp, then showing it using jquery later on, something like: // index.jsp: <% <div id='hideme' style='hidden: true' >hello</div> %> <!-- At runtime: --> $('#hideme').show(); What's the right way to hide the div in the jsp code such that the jquery hide()/show() method...