鼠标悬停,怎么解决?
悬赏: 10 金币
提问于2008-05-16 01:15:03 解决时间:2008-05-21 02:12:38
下面是我的一个滚动显示的链接,怎么样才能在鼠标悬停在表格时停止滚动?
<style type="text/css">
#infozone{font-size:12px;color:#aa6;overflow:hidden;width:750px;height:140px;}
#infozone div{height:20px;line-height:20px;white-space:nowrap;overflow:hidden;}
</style>
<script type="text/javascript">
window.onload=function()
{
var o=document.getElementById('infozone');
window.setInterval(function(){scrollup(o,20,0);},2000);
}
function scrollup(o,d,c)
{
if(d==c){
var t=o.firstChild.cloneNode(true);
o.removeChild(o.firstChild);
o.appendChild(t);
t.style.marginTop=o.firstChild.style.marginTop='0px';
}
else{
var s=3,c=c+s,l=(c>=d?c-d:0);
o.firstChild.style.marginTop=-c+l+'px';
window.setTimeout(function(){scrollup(o,d,c-l)},100);
}
}
</script>
<div id="infozone">
<div><td with=100><A herf="http://www.qihoo.com">怎么解决呢?</a></td></div>
将以下代码另存为一个JS文件,然后在页面里调用就行,效果请看http://www.dogooo.cn
var pltsPop=null;
var pltsoffsetX = 10; // 弹出窗口位于鼠标左侧或者右侧的距离;3-12 合适
var pltsoffsetY = 15; // 弹出窗口位于鼠标下方的距离;3-12 合适
var pltsPopbg="#EE530D"; //背景色
var pltsPopfg="#ffffff"; //前景色
var pltsTitle="";
document.write('');
function pltsinits()
{
document.onmouseover = plts;
document.onmousemove = moveToMouseLoc;
}
function plts()
{ var o=event.srcElement;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
pltsPop=o.dypop;
if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
{
pltsTipLayer.style.left=-1000;
pltsTipLayer.style.display='';
var Msg=pltsPop.replace(/\n/g,"
");
Msg=Msg.replace(/\0x13/g,"
");
var re=/\{(.[^\{]*)\}/ig;
if(!re.test(Msg))pltsTitle="多狗在线提示";
else{
re=/\{(.[^\{]*)\}(.*)/ig;
pltsTitle=Msg.replace(re,"$1")+" ";
re=/\{(.[^\{]*)\}/ig;
Msg=Msg.replace(re,"");
Msg=Msg.replace("
","");}
var attr=(document.location.toString().toLowerCase().indexOf("list.asp")>0?"nowrap":"");
var content =
''+
'↖'+pltsTitle+''+pltsTitle+'↗'+
''+Msg+''+
'↙'+pltsTitle+''+pltsTitle+'↘'+
'';
pltsTipLayer.innerHTML=content;
toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2);
moveToMouseLoc();
return true;
}
else
{
pltsTipLayer.innerHTML='';
pltsTipLayer.style.display='none';
return true;
}
}
function moveToMouseLoc()
{
if(pltsTipLayer.innerHTML=='')return true;
var MouseX=event.x;
var MouseY=event.y;
//window.status=event.y;
var popHeight=pltsTipLayer.clientHeight;
var popWidth=pltsTipLayer.clientWidth;
if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
{
popTopAdjust=-popHeight-pltsoffsetY*1.5;
pltsPoptop.style.display="none";
pltsPopbot.style.display="";
}
else
{
popTopAdjust=0;
pltsPoptop.style.display="";
pltsPopbot.style.display="none";
}
if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
{
popLeftAdjust=-popWidth-pltsoffsetX*2;
topleft.style.display="none";
botleft.style.display="none";
topright.style.display="";
botright.style.display="";
}
else
{
popLeftAdjust=0;
topleft.style.display="";
botleft.style.display="";
topright.style.display="none";
botright.style.display="none";
}
pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
return true;
}
pltsinits();
如果还不行,请输入你的问题到百度搜索一下吧,一般是可以找到满意答案的。
|




(金币)












此主题相关图片如下:


