JS让浏览器实现复读机的功能(2)

2008-02-23 07:57:33来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


}
}
function toolTip(msg, fg, bg)
{
if(toolTip.arguments.length < 1) // hide
{
if(ns4) toolTipSTYLE.visibility = "hidden";
else toolTipSTYLE.display = "none";
}
else // show
{
if(!fg) fg = "#0000ff";
if(!bg) bg = "#FFFFFF";
var content =
'<table border="0" cellspacing="0" cellpadding="1" bgcolor="' fg '"><td>'
'<table border="0" cellspacing="0" cellpadding="1" bgcolor="' bg
'"><td align="center"><font face="sans-serif" color="' fg
'" size="-1">&nbsp\;' msg
'&nbsp\;</font></td></table></td></table>';
if(ns4)
{
toolTipSTYLE.document.write(content);
toolTipSTYLE.document.close();
toolTipSTYLE.visibility = "visible";
}
if(ns6)
{
document.getElementById("toolTipLayer").innerHTML = content;
toolTipSTYLE.display='block'
}
if(ie4)
{
document.all("toolTipLayer").innerHTML=content;
toolTipSTYLE.display='block'
}
}
}
function moveToMouseLoc(e)
{
if(ns4||ns6)
{
x = e.pageX;
y = e.pageY;
}
else
{
x = event.x document.body.scrollLeft;
y = event.y document.body.scrollTop;
}
toolTipSTYLE.left = x offsetX;
toolTipSTYLE.top = y offsetY;
return true;
}

</script>

如上的代码在Dreamweaver的代码片断上能找到。

D.文字亮显代码:

function check(){
C_T=MP.currentPosition;
for(var n=0;n<l;n ){
{if((C_T>=t_array[n])&& (C_T<t_array[n 1]))
{eval("e_" n).style.color="red";
eval("h" n).style.color="red";}

else {eval("e_" n).style.color="black"
eval("h" n).style.color="black";
}}}
}
setInterval("check()",500)

分析:随时检测播放器的当前位置(时间)。如果播放器的当前位置在某一时间内,就将相应的文字显示为红色,否则该文字为黑色。当然,还有其他的效果,你去思考吧。

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:常用JavaScript网页广告代码

下一篇:跟随滚动条漂浮的JS特效