PDA

View Full Version : Pop up window


Jittor
10-16-2006, 03:09 PM
Hey Everyone,


Okay, this is whats going on in my part of the world. My Boss wants a window to come up when a viewer goes to a certian page. Within this pop up he wants a video to play and when it is finished playing he wants the window to disapear. I told him that pop up windows are usually not a good idea because browsers don't like them and some block them. Does he care...no. He's one of those learn it the hard way kind of guys. Anyway, do you guys have any other suggestions or advice on other options. If not, I have never created a pop up window - any suggestions?

domedia
10-16-2006, 04:32 PM
General directions to make a pop-up window is here:
http://www.domedia.org/oveklykken/javascript-pop-up.php

You want to make sure there's a javscript that starts when the page loads. I think this would work, but can't try it now:
<body onload="window.open('pop.html','popup','height=250,width=3 50,scrollbars=no')">
The only video format that can 'talk' to the page (to close the popup once the video is played), is Flash through it's actionscript. For this to work you need a javascript function in your pop-up page that will close the page, and the a actionscript snippet in your last frame of the flash movie to call the javascript function. Tricky stuff, unless you know actionscript and javascript you might want to look for another solution.

You might want to look into the ThickBox technique:
http://codylindley.com/Javascript/257/thickbox-one-box-to-rule-them-all
It's pretty easy to implement, but you would still need to show a 'close' link, which most users are fine with.

Jittor
10-16-2006, 04:58 PM
Well, I thought about using it like a Flash intro instead of a pop up because I hate pop ups. The intro would be the video playing, and a view would have the option to "Skip Intro" which would use action script to direct to the main page. If they do watch the short video when it's finished it will not close but redirect to the URL. I have worked with Flash quite a bit but never with actual video in it. Can I make an action that when the video is done it goes to the URL within the same window?

I did show my boss what it would be like if we did have an actual pop up window. I used this code:

<script language="javascript">
timer=setTimeout("window.open('popup.html','','width=200,height=200' )",5000)
</script>

I liked the use of the delay. It worked for what I wanted.

I was smart and showed my boss the new page on his computer and guess what........his browser blocked it - SCORE! He was like..."well, that wont work wil?" and I was like..."I told you so!" I think he gets it now.

As for the ThickBox I am not really fimular with it or the Lightbox technique. But from the examples I really like it. I think I remember someone posting here that used ThickBox in their site and I liked it there as well. But, with ThickBox don't you have to click on the link to activate the ThickBox pop-up?