Har detta som kod just nu;
Ett stycke html-kod:
<a href="videos/FILM1.mp4"><video id="film" width="100" height="100" loop>
<source src="videos/hover/förkortad version av FILM1.mp4" type="video/mp4"></source>
</video></a>
<a href="videos/FILM2.mp4"><video id="film" width="100" height="100" loop>
<source src="videos/hover/förkortad version av FILM2.mp4" type="video/mp4"></source>
</video></a>
<script src="js.js"></script>
Ett stycke javascript-kod:
document.addEventListener('mouseover',hoverVideo,false);
var vid = document.getElementById('film');
function hoverVideo(e)
{
if(e.target == vid)
{
vid.play();
this.addEventListener('mouseout',hideVideo,false);
}
}
function hideVideo(e)
{
if(e.target == vid)
{
vid.pause();
}
}
Det funkar på första videoklippet men på det andra videoklippet händer ingenting då jag för musen över det.
Help :S?!
Ingen status