Can we callback jquery function with selector in another jquery function ?
Like I have two jquery functions
// Function 1:
$("#slideUp").click(function(){
$("#testDiv").slideUp("slow",CALLBACK);
});
// Function 2:
$("#slideDown").click(function(){
// Do some stuff
});
How can I call Function 2 in Function 1’s callback ?
*EDIT: Adding correct terminologies *
Can we callback one jquery listener with selector in another jquery listener ?
Like I have two jquery listener
// Listener 1:
$("#slideUp").click(function(){
$("#testDiv").slideUp("slow",CALLBACK);
});
// Listener 2:
$("#slideDown").click(function(){
// Do some stuff
});
How can I call Listener 2 as Listener 1 callback ?
I want to execute click listener of slideDown once testDiv is silde up.
Thank you Spycho.
~Ajinkya.
If you mean you want to trigger a click on the element with ID
slideDownthen use$("#slideDown").click()in your callback function. That will trigger the event handler for that element.