Reputation: 11
b.delegate(".uipro_open_left", "click", function(){$.uiPro.open("left")});
b.delegate(".uipro_open_right", "click", function(){$.uiPro.open("right")});
I would like to call these two on page load. How could I do that? Thank you in advance for your reply. :)
Upvotes: 0
Views: 79
Reputation: 9380
There are 2 ways of doing it
$(document).ready(function(){
//your function
});
or simply
$(function(){
//your function
});
Read window.onload vs $(document).ready() to get a clear understanding of when you need to call you functions.
Correcting your grammar, your functions would be called when that element will be clicked on the page. Enclosing your function definition in the snippet I have mentioned will ensure that these are invoked only when your DOM is ready.
Sorry to say this but you have a steep learning curve ahead so get started ASAP.
Upvotes: 1
Reputation: 2496
You can use $( document ).ready() function.
$( document ).ready(function() {
console.log( "ready!" );
});
Upvotes: 0