新手求指导
[size=13px]<script language="javascript">
function showtip2(current,e,text)
{
if (document.readyState == "complete")
{
document.all..innerHTML ='<marquee style="border:1px solid blue">' + text + '</marquee>';
document.all.tooltip2.style.pixelLeft = event.clientX + document.body.scrollLeft + 10;
document.all.tooltip2.style.pixelLeft = event.clientY + document.body.scrollLeft + 10;
document.all.tooltip2.style.visibility = "visible";
}
}
function hidetip2() {
document.all
document.all.tooltip2.visibility = "hidden";
}
</script>
<a href="http://www.hao123.com/" onmouseout="hidetip2()" onmouseover="showtip2(this,event,'javascript中文网')" target="_blank"><p>www.hao123.com</a></p>
我想要设置带滚动提示的链接
但是老是提示出错
请帮我看下是哪里错了,还是缺少什么
[解决办法]
<a href="http://www.hao123.com/" onmouseout="showtip(0,'')" onmouseover="showtip(event,'javascript中文网')" onmousemove="showtip(1,event)" target="_blank">www.hao123.com</a>
<div id="info" style="position: absolute;width:200px;background-color: #fff"></div>
<script type="text/javascript">
function showtip(e,text){
var id=document.getElementById("info");
if(e==0){
id.style.display="none";
}else if(e==1){
id.style.left =text.clientX + 10+"px";
id.style.top = text.clientY + 10+"px";
}else{
id.innerHTML ='<marquee style="border:1px solid blue">' + text + '</marquee>';
id.style.left =e.clientX + 10+"px";
id.style.top = e.clientY + 10+"px";
id.style.display = "block";
}
}
</script>
[解决办法]
<script language="javascript">
function showtip2(current,e,text) {
var tooltip2 = document.getElementById('tooltip2');
if (document.readyState == "complete")
{
tooltip2.innerHTML = '<marquee style="border:1px solid blue">' + text + '</marquee>';
tooltip2.style.left = e.clientX + document.body.scrollLeft + 10 + 'px';
tooltip2.style.top = e.clientY + document.body.scrollLeft + 10 + 'px';
tooltip2.style.display = 'block';
}
}
function hidetip2() {
document.getElementById('tooltip2').style.display='none';
}
</script>
<div id="tooltip2" style="display:none;position:absolute"></div>
<a href="http://www.hao123.com/" onmouseout="hidetip2()" onmouseover="showtip2(this,event,'javascript中文网')" target="_blank"><p>www.hao123.com</a></p>