Pop-up show on page load
5 posters
Page 1 of 1
Pop-up show on page load
I have already worked on this pop-up:
https://defencedog.googlecode.com/svn/welcomebox/jquery_welcome_box.html
but I still considers a lightweight replacement so here it goes
https://defencedog.googlecode.com/svn/simplewelcome/my.html
as you can see the popup show at click event; I want it to load automatically when page loads & can't find the appropriate method:
Here my failed tries...
https://defencedog.googlecode.com/svn/welcomebox/jquery_welcome_box.html
but I still considers a lightweight replacement so here it goes
https://defencedog.googlecode.com/svn/simplewelcome/my.html
as you can see the popup show at click event; I want it to load automatically when page loads & can't find the appropriate method:
Here my failed tries...
- Code:
$(document).ready(function () {
//id is the ID for the DIV you want to display it as modal window
launchWindow(dialog);
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set heigth and width to mask to fill up the whole screen
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect
$('#mask').fadeIn(1000);
$('#mask').fadeTo("slow",0.8);
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(dialog).css('top', winH/2-$(dialog).height()/2);
$(dialog).css('left', winW/2-$(dialog).width()/2);
//transition effect
$(dialog).fadeIn(2000);
//if close button is clicked
$('.window .close').click(function (e) {
//Cancel the link behavior
e.preventDefault();
$('#mask').hide();
$('.window').hide();
});
//if mask is clicked
$('#mask').click(function () {
$(this).hide();
$('.window').hide();
});
});
Re: Pop-up show on page load
You can add an onload event to the body tag.
<body onload="your function here">
<body onload="your function here">
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: Pop-up show on page load
how to add this code??
^_lilmhack_^- New Member
- Posts : 16
Reputation : 1
Language : Pinoy
Re: Pop-up show on page load
Got it cleared via:
- Code:
$('a[href=#welcome]').click(); // for multi-popups initiation
$('a[name=modal]').click(); // for name initiation will initiate all popups included
Re: Pop-up show on page load
^_lilmhack_^ wrote:how to add this code??
Hi,
Please do not use boldface text. That is strictly reserved for forumotion staff only.
Regards,
Bayat
Bayat- New Member
- Posts : 17
Reputation : 1
Language : English, French
Re: Pop-up show on page load
Bayat, Please don't moderate other members, as this is reserved for staff only
Since you being on a one strike rule, you are being banned.
Since you being on a one strike rule, you are being banned.
Sanket- ForumGuru
- Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai
Similar topics
» How do you load the login page instead of the index.html page automatically
» the page won't load.
» every page load
» I cant Load my page
» Load page
» the page won't load.
» every page load
» I cant Load my page
» Load page
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum