[jQuery] passing this reference to setTimeout()

2008-12-15 Thread ekallevig
I'm using jQuery.hover for a dropdown menu and I want to add a slight delay to mouseOut functions but I can't figure out how to pass the jQuery(this) reference into the setTimeout() function... can this be done? ex. jQuery('li.drop').hover( function(){ jQuery(this).addCla

[jQuery] passing 'this' into getjson callback

2008-12-05 Thread pramodx
Hi, On click of a button I am placing a json call in the following manner jQuery( '#myButton' ).bind( 'click', myProject.callJson ); The callJson function calls the json parameters: jQuery.getJSON( url, null, function( json ) { myProject.handleResult ( json ) } ); The handleResult function fu

[jQuery] Passing this to a function

2008-05-09 Thread mac.gill
Can i pass 'this' to a custom function from an event handler eg. $('p').('click',function() { myCustomEvent(this); }); myCustomEvent(ref) { //ref Object or JQuery object ? $.get("path_to_cgi",{name = ref.text()},function(data) { alert("Data : " + data}); }

[jQuery] passing this

2007-10-27 Thread Jean-Sébastien
Hello, i want to call a function $('#selection').parent.child() with the following code : jQuery.fn.extend({ parent: { child: function(o){ doSomethingWith(selectedElement) } } }); but i dont know how to pass the selected element through parent (#selection) to child function. regards.