I'm currently facing an issue with my website that includes a YouTube video. Whenever I try to open a popup window using JavaScript, it appears behind the YouTube video instead of on top. I have attempted to adjust the z-index in my JavaScript function by adding element.style.zIndex="1"
or object.style.zIndex="1"
, and also set z-index:-1;
in my YouTube CSS, but unfortunately, it hasn't resolved the problem. Can anyone suggest what steps I should take next?
YouTube CSS:
position: absolute;
height: 259px;
width: 683px;
left: 235px;
float: left;
text-align: right;
z-index: -1;
YouTube code:
<div id="youtube_video" style="float: right">
<object width="580" height="259" float="right"><param name="movie" value="http://www.youtube.com/v/7mKpzQOlyKE?fs=1&hl=iw_IL"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7mKpzQOlyKE?fs=1&hl=iw_IL" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="580" height="259"></embed></object>