hi, ive tried several times to do this but failed. on the page unitedkarategreatbritain.com/Videos.html when you mouseover the iframe links that say "click here to show/hide video" you get the text highlighter not the regular hand pointer which you get on mouseover of a link.
heres the code im using:
Code:
<script type="text/javascript">
var stat;
var delay=2000; //delay in milliseconds
function show(id){
var oIfr = document.getElementById(id);
oIfr.style.display=(oIfr.style.display=='block')?'none':'block';
}
function hide(id){
stat = setTimeout('show("'+id+'")',delay)
}
function getId(obj){
var allIfr = document.getElementsByTagName('iframe');
for(var i=0;i<allIfr.length;i++){
var dIfr = allIfr[i].contentWindow.document.documentElement;
if(obj==dIfr){hide(allIfr[i].id);break}
}
}
onload=function(){
var allIfr = document.getElementsByTagName('iframe');
for(var i=0;i<allIfr.length;i++){
var dIfr = allIfr[i].contentWindow.document.documentElement;
dIfr.onmouseover = function(){parent.clearTimeout(parent.stat)}
dIfr.onmouseout = function(){parent.getId(this)}
}
}
</script>
Code:
<span onclick="show('ifr0')" onclick="hide('ifr0')">click here to show/hide video | </span>
<br />
<iframe src="http://www.youtube.com/embed/dZOEa9sbshI?rel=0" id="ifr0" style="display:none" width=640" height="385" frameborder="0" scrolling="no"></iframe>
help appriciated, regards
Last edited by chrishirst; 12-26-2010 at 09:25 AM..
|