当前页面: 开发资料首页 → Javascript 专题 → 怎样编写IE和NN6通用的闪烁(blank)效果
摘要: 怎样编写IE和NN6通用的闪烁(blank)效果
根据Nascape 6的开发者称:在以后的版本里,将废除
<head>
<script>
function blink (elId) {
var html = '';
if (document.all)
html += 'var el = document.all.' + elId + ';';
else if (document.getElementById)
html += 'var el = document.getElementById("' + elId + '");';
html +=
'el.style.visibility = ' +
'el.style.visibility == "hidden" ? "visible" : "hidden"';
if (document.all || document.getElementById)
setInterval(html, 500)
}
function init () {
blink('aText');
blink('a2ndText');
}
</script>
</head>
<body ONLOAD="init();">
这行文字闪烁!!!