jquery

.click() event executed only the first time

I have the next script, "/cashflow/arrow/" calls a django view that gets the data and works with it. Then it returns the data that is loaded in the html. The script works fine in the first click, but when I want to click a link again, nothing happens. <script> $(document).ready(function(){ var prev_months = {{ prev_months }} ...

problems trying to use jquery to zoom and pan an image map

Hi!~ I've been working on this for a while now (many months!!) -- using jquery to zoom and pan an image map - which is a bit outside my current skill level so I'm excited that I have gotten this far!!~ but the functionality is not as smooth as it needs to be (the zoom in and out needs to be smoother) - and there are some larger issues wh...

jQuery - disable input field based on another field selected value

I'm searching for a jQuery plugin that does this. for example: <label><input type="checkbox" depends_on="foo=5" name="boo" ... /> Check </label> <select name="foo" ... > <option value="5" selected="selected">5</option> <option value="15">15</option> <option value="25">25</option> </select> so the checkbox would only be enabled ...

HTML just cannot get focus instead of disabled

Hello, I am currently trying to see if there is a way to not disable an input but not allow the input to get focus. I am doing this because I still need the backend to retrieve the data but just not allow the user to certain times to edit the input fields. Since disabled doesn't return data to the backend that doesn't work. The way I am ...

Jquery, blockUI. Problem in IE 7,6.

Ok when I'm calling $.blockUI in Internet Explorer 7 it gives me javascript error: Object doesn't support this property or method When I lunch Firefox in IE 6 mode with firebug it tell me that s.setExpression is not a function this code is in blockUI javascript. I dont understand... maybe it is conflict with jquery? Becose whrn ...

jQuery UI autocomplete + CakePHP

I'm setting up jQuery UI autocomplete on a CakePHP site, and feel like I'm missing something really obvious, but it's almost working... So the simple jQuery code is: $(function() { $("#SearchQuery").autocomplete({ source: "<?= $session->base ?>/search/complete", minLength: 2 }); }); This connects to my search ...

How to change the theme of the jqGrid?

Hi every one, I'm looking for the way to change gqGrid theme for the current version. I've started to use jqGrid in my ASP.Net MVC 2 application recently and download some demo solution/projects. I tried to change the theme of the grid by changing the theme ui javascript but it doesn't work for me. Looking at the document doesn't help m...

How to get rid of empty data in Craig Stunz's demo application ?

I download Craig Stunz's demo application from his blog and run it from Visual Studio 2010. The result is the grid with its UI but no rows. What should I do to make it works? ...

jQuery: Looping over elements writing their ID attribute to an array?

Hello, I'm trying find a bunch of <label>s in a form of mine based on an array of elements and their id attribute. eg. [ input#country , input#other-country ] would be able to find <label for="country"> , <label for="other-country"> and so on… so far I have this code: var LOCATION = {}; LOCATION.option = form.find('input[name=locati...

Is there a way to compare 2 colors in JS, like 'If Color A is darker than #202020'

The background color for one of my pages is set pulled from the background color the users set as their twitter background color. I have a page that has a rounded box with a black border. The border doesnt look good if the background color is dark, so i'd like to remove the border of the background is darker than an arbitrary hex color...

jquery change background image on hover

Hi. I have several divs that I want to generate css background images for. They will change on hover. Yes, I'm aware that I could easily do this in css, but it needs to be done in jquery. Code: $(document).ready(function() { $('.hoverBox').css('background', 'url(img/box' + id + '.jpg)') $('.hoverBox').hover(function(){ ...

jquery ajax load() does not load internal css for webkit browsers

The css part is totally not reflected in the output (for webkit only, others ok), it is as if no css was defined, javascript works tho... Ajax call $("#output_area").load("abc.html"); abc.html sourcecode: (Angle brackets are omitted) !DOCTYPE HTML html head style type="text/css" css.. css.. ...

Adding input buttons using JQuery

I have a interesting problem I need to solve. A customer wants to enter a customer id (using a scanner) in a input element and using AJAX, it will fill another input element with the customer name. A new input element should be added and focus set, so the customer can enter another customer id. I have two issues that I need help solvi...

How to include an external plugin inside of another jQuery plugin being authored.

I am building a custom jQuery plugin for a project I am working on. I want to return an object that is custom to another jQuery plugin...rather than having to make sure that each page that uses my plugin also has this other plugin, is it possible to include it in the actual plugin itself? Rather than type the following on each page tha...

jQuery scan table th's for * and give parent a color!

hey guys, i have a rather (for me) complicated task with jquery. i want to scan an entire table for its th elements. if a th element has a ATERISK (*) in it, i want to hightlight the the parent, which is the tr element. i know it sounds complicated when i explain it :) so imagine i have a dynamic html table where i want to enable a f...

What's the best way to reference an element via ID in jQuery?

Should I be using $("#myElement") or $(myElement)? Both appear to work. ...

How to identify if a key is down on hover ?

I would like to show one div only when another div is hovered and the Space Bar is down. I tried to use keyCode and which properties of the event, but none of them worked. Though, I could create an example for CTRL key pressed rather than the Space Bar, as you can see also here. How should I change the code so it will work with Space Ba...

How can I improve my first user script?

I wrote my first Greasemonkey user script to find logo requests on the college-football subreddit. One wrinkle is having to search for the appropriate stylesheet, and then once found, I look through the selectorText attributes of documents.styleSheets[i].cssRules for known usernames. At first, I used the following code to search for us...

Plupload and error generation

I am working on an application that uses the plupload library for file uploading. I can't seem to get the file uploading working because there is some kind of error but I can't get this error to alert or log. Has anyone been able to do this? Here is my current code: uploader.bind('Error', function(error){ console.l...

Can I use javascript to dynamically change a video's source?

How can I change a video's source using JS? <video id="myVideoTag" width="670" height="377" autoplay="true" controls="controls"> <source src="http://www.test.com/test.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> </video> ...