Log in

View Full Version : Video on a new window.



remp
06-05-2007, 12:01 AM
How can i put some sort of a drop down menu that has options and when i click on each one of them, it will open a video on a different window with the same dimentions as the video?

djr33
06-05-2007, 02:12 AM
You can use window.open(), a javascript function.

<select onChange="window.open(this.value,null,'height=240,width=320);">
<option value="page1.htm">video1</option>
<option value="page2.htm">video2</option>
<option value="page3.htm">video3</option>
</select>

remp
06-05-2007, 02:30 AM
do i have to put a script on the head? because it doesn't work when i do it...

djr33
06-05-2007, 02:34 AM
Hmm... I'm not sure why it isn't working.
This has nothing to do with where the script is placed, but I'm not sure how to fix it anyway.
I think someone else will know.
I likely just have something simple wrong that I'm missing.
I'm no Javascript expert.

thetestingsite
06-05-2007, 03:36 AM
I think it is supposed to be like this:



<select onChange="window.open(this.options[this.selectedIndex].value,null,'height=240,width=320);">
<option value="page1.htm">video1</option>
<option value="page2.htm">video2</option>
<option value="page3.htm">video3</option>
</select>


Hope this helps.

remp
06-05-2007, 05:33 PM
i put the code but nothing happens when i change the option... does anyone know if i have to put a script in order for this to work?

djr33
06-05-2007, 05:47 PM
Are you by chance getting a popup blocker message?

remp
06-05-2007, 06:06 PM
it works now but i want to change it a little, instead of opening in a different window i want it to play the video right on top of the switcher, on the same page. how can i do this.

djr33
06-05-2007, 06:08 PM
Ah. That's different, then. You said popup window, which is what that is.

Take a look at the 'window widget' or other similar scripts in the dynamic drive library to see if one of those will fit what you need.