Im really new to all this, i have tried:
document.getElementById('video2')
document.getElementByClass('video2')
Duplicated scripts etc and i can't get each of the video to play on mouse over. Can anyone help?
This is the tut i followed to get this far:
http://developer.pra...-and-Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Horizontal_Slider</title>
<link href="css/style.css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Asap' rel='stylesheet'
type='text/css'>
<script type="text/javascript">
Shadowbox.init();
</script>
</head>
<body>
<div id="header"></div><!--end header-->
<a href="video/speechlrg.mp4">
<video id="video1" loop>
<source src="video/speech.mp4" type="video/mp4"></source>
</video> </a>
<a href="video/identlrg.mp4">
<video id="video2" loop>
<source src="video/ident.mp4" type="video/mp4"></source>
</video> </a>
<script src="js/js.js"></script>
<script>
document.addEventListener('mouseover',hoverVideo,false);
var vid = document.getElementById('video2')
function hoverVideo(e)
{
if(e.target == vid)
{
vid.play();
this.addEventListener('mouseout',hideVideo,false);
}
}
function hideVideo(e)
{
if(e.target == vid)
{
vid.pause();
}
}
</script>
</body>
</html>
Thanks

New Topic/Question
Reply


MultiQuote






|