jquery-events

Event handler triggered twice instead of once

Hi all, I am sorry that I have asked two questions in a few minutes. In a html file, I got three child DIV tags in a parent DIV tag: <div id="container"> <div id="frag-123">123</div> <div id="frag-124">124</div> <div id="frag-125">125</div> </div> Now when I click either the three child DIV tags, I will see two alert boxes ...

Jquery - intercept links clicked inside an iframe

Hi, I am trying to intercept links clicked on a page including those inside an iframe. This is the code that I have but it is not working. Any ideas what I need to do? $("#container").delegate('a', 'click', function(e){ //do stuff } Container is the id of the div just inside the iframe. Thanks in advance for any advice ...

Events still not showing up despite the many tries...sigh

I have tried the recommendation from this forum and through the many google searches...but i still can't get the events to show up on my calendar via jsp....i tried with php and it worked...sigh...i wonder where is the error....sigh.... The processRequest method is fine but when it dispatches to the JSP page...nothing appears from the b...

why does calling methods on a div fire the live click event

i have this jquery code: $(this).parent('.copyFoodInstance').attr("myset", "0"); $(this).parent('.copyFoodInstance').html("<img BORDER=0 src='../../images/copy1.png' />"); it seems that when i call this code, this event fires: $(document).ready(function() { $('div.copyFoodInstance').live('click', function() { does anyone kno...

Why is the event object different coming from jquery bind vs. addEventListener

Why is it when I use the jQuery bind the event object I get back is different from the event object I get back using addEventListener? The event object resulting from this jQuery bind does not have the targetTouches array (among other things) but the event from the addEventListener does. Is it me or is something not right here? $(docu...

jQuery: Apply css to image on click event

I want basically the same as http://stackoverflow.com/questions/530701/jquery-select-image a row of images that you can select one of. But I'm trying to style the one I select, and store it. var selectedicon = ""; function selecticon(){ $('#iconselect').children().click(function(){ $(".selectedicon").removeclass("selectedico...

HTML 5 Video OnEnded Event not Firing

I'm trying to react to the HTML 5 onended event for the video tag without success. In the code snippet below I added the mouseleave event to be sure the jQuery code is correct and that event does activate the alert() box. The video plays just fine but onended does not cause my alert() to fire off. Testing in Chrome, updated today to ve...

add event to top of event stack using jquery

I'm using jquery to add a blur event to a text box. I would like my event to fire before any other existing events. Is this possible to do? ...

jQuery event handler queue

Overview of the problem In jQuery, the order in which you bind a handler is the order in which they will be executed if you are binding to the same element. For example: $('#div1').bind('click',function(){ // code runs first }); $('#div1').bind('click',function(){ // code runs second }); But what if I want the 2nd bound code to ru...

jQuery li:has(ul) selector issue

I was creating a tree using UL LI list and jQuery. I used a jQuery Selector jQuery(li:has(ul)) to find all the list nodes having childs and then added a click event to it. jQuery(li:has(ul)).click(function(event) { jQuery(this).children.toggle(); jQuery(this).css("cursor","hand"); }); This works for me except i dont unders...

How to trigger an event ONLY if both dropdowns are selected?

I have a dropdown select list on my page of class="TypeFilter". I have a jQuery event that fires when a value in that list is selected. $(".TypeFilter").change(function() { // Extract value from TypeFilter and update page accordingly )); I now have to add another list to the page, and I want to implement functionality which will...

Is it possible to do live events in YUI, similar to jQuery's live events?

It doesn't currently seem as though there is a way to do live events in YUI similar to jQuery: http://api.jquery.com/live/ It sure would be nice if something like: function handleClick(e) { // click! } YUI().use('node-base', function(Y) { Y.on("click", handleClick, ".foo"); }); caused handleClick to be fired when a node with...

jQuery: How to stop propagation of a bound function not the entire event?

I have a click function bound to many elements. It is possible that sometimes these elements may sit within one another. So, the click event is bound to a child and also bound to its parent. The method is specific to the element clicked. Naturally, because of event bubbling, the child's event is fired first, and then the parents. I ca...

jquery question

I am using the Jquery library to copy the text enter in one textfield to another textfield using a check box when clicked.. which is as follows <html> <head> <script src="js/jquery.js" ></script> </head> <body> <form> <input type="text" name="startdate" id="startdate" value=""/> <input type="text" name="enddate" ...

jquery question for events

I have to copy the text from one text box to another using checkbox through jquery I have applied jquery event in my code, it works partially correct.. code is as follows: <html> <head> <script src="js/jquery.js" ></script> </head> <body> <form> <input type="text" name="startdate" id="startdate" value=""/> <input...

jQuery capture all changes to named input on a form

I'm trying to determine when any of a set of named input/select/radio/checked/hidden fields in a form change. In particular, I'd like to capture when any changes are made to fields matching jQuery's selector $("form :input"), and where that input is has a name attribute. However, the form isn't static i.e. some of the fields are dynami...

calling a method from an event handler

I have this code i am working on but every time i call init method I keep getting an error this.addElement is not a function is it because i can't call methods from event handlers ? function editor () { this.init = function () { $("#area").bind('click' , this.click_event ); } this.addElement = function () ...

jQuery global events and performance?

I was in search of a way to show a status indicator using jQuery and I found a solution in the jQuery Cookbook, it showed this solution (function($) { $(document).ready(function() { $('#ajaxStatus') .ajaxStart(function() { $(this).show(); }) .ajaxStop(function() { $(this).hide...

Struggling to solve this jQuery div collapse/expand problem

I'm using this example as a basis http://simon.tpdserver2.co.uk/jquery/divgrowdemo.htm, I'm trying to modify it so that instead the jQuery plugin generating an html a-href that allows the user to toggle the expand/collapse (in this case it's in the form of "+ Show More" and "- Show Less" links), that I can use a link that's within the ac...

Do I need to detach events in jQuery when I remove elements

I have a UI using dynamic tabs, so content can be loaded into a tab and then the tab can be closed and the content removed from the page. When I load content into a tab I attach a lot of events to elements using jQuery. What happens when I remove these elements from the page? Does jQuery need to know? Also, does it matter if I attach ...