I have a youtube iframe embedded in a page with a transparent div placed exactly on top of it.
I have links in the div on which I use CSS :hover to make visible only while the mouse is over the video.
Is it possible to allow the user to click through the div to play the video without turning off the hover effect on the div? I cannot make the div smaller.
I'm looking for something similar to pointer-events:none but which maintains the hover event for the div element. Is there a javascript solution perhaps?
Code demo:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Video test</title>
<style>
#storymenu{position:absolute; width:515px; height:386px;}
#storymenu a{display:none; margin-left:10px; margin-top:20px; padding:5px; background:#FFF;}
#storymenu:hover a{display:inline-block}
</style>
</head>
<body>
<div id="storymenu">
<a href="#" onclick="alert('next');return(false);"><span>Next Story</span> ></a>
<a href="#" onclick="alert('prev');return(false);">< <span>Prev Story</span></a>
</div>
<iframe width="515" height="386" src="http://www.youtube-nocookie.com/embed/5It4y8834Zd" frameborder="0" allowfullscreen></iframe>
</body>
</html>
pointer-events:noneon the div will allow clicks through it but will also disable the hover effect. Is there any middle ground here? I want to disable the click but enable the hover.divwhich is visible while hovering? But you want to click through thediv(with the links) and interact with the video? ...why is thedivthere?