Log in

View Full Version : pop up window in index.php



crf121359
06-23-2010, 04:53 PM
Hi guys,

I am trying to make a pop-up window for my site's homepage.

I am not sure what to do to be honest.

I tried puting this code:
onload="win('http://www.beholdhecomes.net','','750','500','0','0','1','width=750,height=500')">
<script type="text/javascript">
<!--//
function win(u,n,w,h,l,t,c,f) {
var x=((screen.width-w)/2);if(c==1){l=x;t=(screen.height-h)/2;}if(c==2){l=x}
f+=',top='+t+',left='+l;LvlWin=window.open(u,n,f);LvlWin.focus();
}
//-->
</script>


in the index.php file of my site but nothing happened!!!:confused:

I have attached the index.php codes to this message as well so you can view it if needed.


Could someone please tell me what I am doing wrong or where I should place the pop-up code ?


Thank you.
Kind Regards

Beverleyh
06-23-2010, 05:34 PM
Try this: http://www.javascriptkit.com/popwin/index.shtml

crf121359
06-23-2010, 05:58 PM
Try this: http://www.javascriptkit.com/popwin/index.shtml

Thank you for the info. unfortunately I can't use that for a couple of reasons!

1- I can't make the window to pop-up in the middle of the screen.
2- Some browsers will block that pop-up window.

I am sure I saw something before that make an image to pop up right in the middle of the screen and no browser will block it!!

any idea how to do that?

Cheers

Beverleyh
06-23-2010, 06:30 PM
Check the script library here on DD. There's one called something like "Fade-In Sticky" that pops a div up center screen and disolves into view then disappears after a customisable time limit - you can put any HTML in it, like your image, and you can set it to appear on every page load, once per session or once every X page loads.

Sorry I can't give the direct link but I'm on my phone now :(
Should be easy enough to find though - possibly in the dynamic content category?