|
-
Oct 29th, 2003, 10:49 AM
#1
Thread Starter
Fanatic Member
displaying a movie..
Hi there,
Please help me with the following "script" in which I wanted to display
an AVI movie..on my html page.I want my "movie to be very next to the BUTTON..
but any time I click to watch it. it displays in another white page and my
button disappears..How can I have them both on the same page.?.(my button and my movie)
I dont want to use "frames" I just want to click and there goes my movie..hope you got my poor English..thanks
......................
<html>
<head>
</head>
<body bgcolor=silver>
<script language="javascript">
function start_to_watch()
{
document.write('<embed src="my.avi" width="250" height="250" autostart=true hidden="false" />')
}
</script>
<form>
<input type=button style=background:blue;color:yellow;font-size:24; value="watch it now" onClick="start_to_watch()">
</form>
</body>
</html>
-
Oct 29th, 2003, 11:35 AM
#2
Frenzied Member
hmmm
Try This:
Code:
<html>
<head>
</head>
<body bgcolor=silver>
<script language="javascript">
function start_to_watch()
{
var div;
div=document.getElementById('Moviediv');
div.innerHTML='<embed src="my.avi" width="250" height="250" autostart=true hidden="false" />';
}
</script>
<form>
<div width=250 height=250 name="Moviediv"></div>
<input type=button style=background:blue;color:yellow;font-size:24; value="watch it now" onClick="start_to_watch()">
</form>
</body>
</html>
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Oct 29th, 2003, 12:00 PM
#3
Frenzied Member
very small change in code required (at least for me)
change the DIVs "name" property to "id".
so NOT:
name="Moviediv"
but
id="Moviediv"
-
Oct 29th, 2003, 12:12 PM
#4
Frenzied Member
Whoops
I wrote it to fast - sorry, it's ofcourse ID (getElementById), My bad!
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Oct 30th, 2003, 03:09 PM
#5
And you'll probably want quotes around the style property value of the button - though most browsers will accept the wrong code too.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|