kam_685 kam_685 - 2 months ago 8x
Ajax Question

open pop-up box when open page

i have code bu ajax like this :

$("document").ready(function (){

$(".open_popup").colorbox({width:"580px", inline:true, href:"#subscribe_popup"});


this is pop up box, i need when open page open this pop up, to open this pop up i use this code

<a href="#" class="open_popup">Click here to open the popup</a>

how can open pop-up onload tag on body.


If you are trying to load inline content (#subscribe_popup), you should use html property, not href.

From Colorbox documentation:


As the other answer suggests, use it inside $(window).load()