I need to make a pop up window, pop up, right on top side of my website. I need a description with a link in it, pointing within the website somewhere. How can I do it?
Put this code in your site that opens the popup:
(this example opens the popup with "onload" in the body, but you can also make a link to open it)
<head>
<script language="javascript">
//this makes the popup in the center of the screen
var h = '250';
var w = '274';
var winl=(screen.width - w) / 2;
var wint=(screen.height - h) / 2;
</script>
</head>
<body onLoad="window.open('popuppage.html', 'popupname', 'height='+h+',width='+w+',top='+wint+',left='+winl+'');" ....here the other body attributes.....>
Put this code in "popuppage.html":
<body ....here the other body attributes.....>
<script language="javascript">
function openLocation(url)
{
window.opener.location=url;
window.close();
}
</script>
<center>
<a href="javascriptpenLocation('thepageyouwant.html');">click here to few my page</a>
<br><br>
<a href="javascript:window.close();">or don't do it and close this window</a>
</center>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.