Hi,
I want do Fancybox work without a click. I want fancybox work as a alert in onload.
Hi,
I want do Fancybox work without a click. I want fancybox work as a alert in onload.
You can register it to run when the page loads using RegisterStartupScript()
, like this:
string myScript = "$('#myFancybox').fancybox();" //add options if needed
ClientScript.RegisterStartupScript(typeof(Page), "alert", script, true);
I do test and no works.
content .cs protected void Page_Load(object sender, EventArgs e) { Presenter.InitializeView(this);
string myScript = "$('#divMessageBox').fancybox();";
ClientScript.RegisterStartupScript(typeof(Page), "alert", myScript, true);
}
content .aspx
<div id="divMessageBox" style="width:400px;height:100px;overflow:auto;">
<asp:Label ID="lblMessage" runat="server" Text="testando Fancybox" />
</div>
Anyone have any suggestions?