I have the following function in Javascript:
$find('mainWindow').repaint();
I need to run that inside this jQuery function:
$("#tools").click(function() {
if(get_cookie('visible')== null) {
set_cookie('visible','no',2020,1,1,'/','.domain');
$("#WinMain").animate({top: "25px"}, 200);
**<!--INSERT FIND-->**
} else {
delete_cookie('visible','/','.domain');
$("#WinMain").animate({top: "89px"}, 200);
**<!--INSERT FIND-->**
}
A
clickhandler is just that, an event handler…no one said you can have only one 🙂 If multiple are attached, they’ll run in the order they were bound…so if you can’t modify that function, just attach your own.click()handler after the current one, like this:I’m not really sure what
$find('mainWindow')stood for, so I’m doing a bit of guessing in the handler above, grabbing it by ID. If you can modify the original handler, just stick the code you want to run in where you have placeholder comments now now.