jquery-events

Jquery UI Accordion - Cancel Change

Hi All, I have been wrestling with this one for a while now. I want to have a confirm() before someone changes the accordion. I have tried: $(document).ready(function() { var edited = false; $(".accordion-me").accordion({ autoHeight: false, navigation: true, changestart: function(event, ui) { ...

Jquery change method and bulk class adding

Hello I have a table (with class name ".data") with it's thead holding a single checkbox for selecting / deselecting all checkboxes inside my tbody. Also each checkbox inside the tbody can be selected invidually and once a checkbox is selected, it adds a new class to the selected row(for making background some other color for highlighti...

Why $('a.current').parent('li').addClass('current'); is not working?

Why $('a.current').parent('li').addClass('current'); and $(this).hasClass('current').parent('li').addClass('current'); are not working? a click event must add li.current http://jsfiddle.net/laukstein/ytnw9/ Update: Dropbox is Down, so I updated http://jsfiddle.net/laukstein/ytnw9/1/ with full JS $(function(){ var list=$('#lis...

jQuery: How to catch keydown + mouse click event?

I have a div element. I need to catch a mouse click on this div while alt-key (keyCode = 17) is pressed. Here is what i've got to catch key press: // Html <div id="targetDiv">I want to put a ding in the universe.</div> // Java-script $(document).ready(function(){ $(window).bind('keydown', function(event){ if ( 17 == eve...

jQuery callback on image load (even when the image is cached)

I want to do: $("img").bind('load', function() { // do stuff }); But the load event doesn't fire when the image is loaded from cache. The jQuery docs suggest a plugin to fix this, but it doesn't work ...

Why doesn't this event unbind using jQuery?

I have seen similar questions but I can't figure out what I am doing wrong here. The dropdown is shown after an ajax call completes succesfully then I want to hide it when a user clicks anywhere. I would like to remove the event though because there is no need to hide it if it is already hidden. dropDown.slideDown('fast'); ...

The best way to bind event on a cell element

Hello, I've a webpage fullfilled by a JS script that creates a lot of HTML tables. Number of <table> created can vary between 1 and 1000 with 100 cells in each of it. My question is : how to bind efficiently the click on theses tables? Should I bind the click on each cell of the <table> or directly to the <table> itself and retrieve t...

Why $('a.current').removeClass('current'); is not working?

Why $('a.current').removeClass('current'); is not working for this jquery tabs? http://jsfiddle.net/laukstein/ytnw9/8/ //full JS in http://jsfiddle.net/laukstein/ytnw9/8/ $(function(){ var list=$('#list'), elementsPerRow=-1, loop=true, // find first image y-offset to find the number of images per row topOffset=lis...

jQuery kwicks update params or options

Hi. I'm using jquery kwicks for a projects and on document ready I provide the following functions. an initial function of what the kwicks should do on document ready function which is my whatToDo var whatToDo = 'mouseover'; $('.kwicks').kwicks({ min : 10, max : 480, duration: 800, easing: 'easeOutQuint', sticky...

Custom Event For Custom JQuery Plugin

I made this jQuery plugin called removable when you click the objects button it slides up and should trigger a custom event like onDone. Here's what I did (The codeing format is based on jQuery's http://docs.jquery.com/Plugins/Authoring): init: function(){ return this.each(function(){ $('a', this).click(function(){ ...

jQuery bind trigger function

Hey guys. I need some help with an item. Kwicks takes an initial argument, click or mouseover for its event parameter, by default its mouseover. in my index.php it looks like this $('.kwicks').kwicks({ min : 10, max : 480, duration: 800, easing: 'easeOutQuint', sticky : true, defaultKwick : 3, event : 'm...

Unbind widget events.

Hello, I'm writing my own widget and all works fine except the destroy method. It seems that all events aren't unbind properly... (function($) { var _super = $.Widget.prototype; // $.widget("my.cool", { _create: function() { var $self = this, $element = this.widget(); $element.mousedown($sel...

Is there a way to break out of event recursion in jQuery without using a global variable?

I have a form with 2 text inputs and 2 span controls. Normally, when textbox A is changed an event is fired to change span A, and when textbox B is changed, an event is fired to change span B. However, in one particualar case I would like a change either textbox A or textbox B to update both span A and B. I tried wiring the events up to...

Keeps Update All Text And Not the selected text in jQuery

I have the following code iam trying to make the text div under the image editable by using keyup and using .val() but iam having a problem when i click on another image and edit the textbox to update the new image text they all change. $('.HeaderGifs').live('click', function() { var img_class = $(this).attr("class"); var img_src = t...

How to find some certain event handlers with jQuery?

As many browsers do not show tooltips on disabled form elements (as Opera does), I decided to emulate disabled button with jQuery. When disabling I just set control's class to disabled and for buttons/submit controls I add an event handler click(function(){return false;}) and I can unbind it later when reenabling the control. Now the ...

jquery - e refer as Event

Hi , In my jquery snippet, am using the function(e) and also in some places i used function(event) How system really understand the e is the event object, is any where they declared by default , ...

What is difference between $(".anything").click() and $(".anything").bind(click)

What is difference between $(".anything").click() and $(".anything").bind(click) $(".anything").click(function() { }); $(".anything").bind('click', function() { }); ...

Drawbacks to always using live() instead of bind() for unique dom elements ?

When writing jQuery binding events, I typically use the bind() aliases (click(), submit(), etc). But, the more I use dynamically generated content, the more I find its ambiguous as to when bind() won't work, and end up debugging for a half hour until I try live() and it works. Within the parameters of ID-selectors (like '#foo', not ....

Jquery selectable only with shortcut

I want to let the user select when the shift key is held. $("#div").selectable({ start: function(st) { $(window).keydown(function(e){ if(!e.shiftKey){ st.stopPropagation(); } }); }); no? ...

Error when trigger click event in IE6/IE7 (jquery)

Hi, I have this code: $("#boxId ul li a:eq(0)").click(); Works ok in IE8 and FF, but I'm getting error in IE6 and IE7. "Object doesn't support this property or method" Someone knows why? Obs: $("#boxFoto ul li a:eq(0)").size(); // returns '1' ...