How can I show Colorbox on page load without event binding? In a more simple term I would like the Colorbox to load immediately on page load.
this is the Colorbox which I am currently using http://colorpowered.com/colorbox/
How can I show Colorbox on page load without event binding? In a more simple term I would like the Colorbox to load immediately on page load.
this is the Colorbox which I am currently using http://colorpowered.com/colorbox/
You should use the load event of the page, because at some moment the js file with color box wouldn't be loaded to the client, and this will cause the js error, and after this your code will be broken.
You need to pass the open:true
key/value set to the constructor if you want it to open without user interaction:
$("selector").colorbox({ other_key:other_value, open: true});
However, it still binds to events if you were to close the box and try to reopen it.
Have you tried:
$(document).ready(function(){
$.fn.colorbox();
}
That is, if you make it:
$(document).ready(function(){
alert('page loaded');
}
Then the alert will popup when the page has finished loading. So it's a matter of just replacing with the call that pops up the colorbox, which seems the one above (haven't tried though).