I have a jquery extended function that works perfectly but when i pass it through the setTimout it does not wait the the specified period and runs straight away.
jQuery(document).ready(function($) {
setTimeout($.mainmenuslider({
trigger:'close'
}),6000);
});
Any Ideas???
You need to pass an anonymous method to do what you want, like this:
jQuery(function($) {
setTimeout(function() {
$.mainmenuslider({
trigger:'close'
});
}, 6000);
});
Otherwise you're trying to pass the result of the function (making it execute immediately, and run nothing later).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With