Skip to content Skip to sidebar Skip to footer

Execute Default Event Before Custom Click Function

I'm trying to execute the default event of a button before executing my custom function my code: $('#Button').click( function (){ sideMenuCheck(); }); I wan't this to be execu

Solution 1:

You can wrap up your code in a setTimeout with a timeout of 0 - this will cause it to move your code to the bottom of the execution queue, and allow everything else to run first:

$('#Button').click( function (){
    window.setTimeout(function() {
        sideMenuCheck();
    }, 0);
}); 

Post a Comment for "Execute Default Event Before Custom Click Function"