我要提问奇虎首页 > 赏金社区 > 电脑网络 > 查看问题

已经解决 鼠标悬停,怎么解决?

悬赏: 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>

我来评论

回答于 2008-05-16 07:43:39   

将以下代码另存为一个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();

如果还不行,请输入你的问题到百度搜索一下吧,一般是可以找到满意答案的。

按回答时间 | 按评价高低网友回答(共7个回答)

回答于 2008-05-16 01:23:36 1楼

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();

回答于 2008-05-16 06:30:31 3楼

重启看一下,不行的话看一下是不是坏了

回答于 2008-05-16 08:31:59 5楼

是不是可以重启下?
嘿嘿 小菜鸟的回答

回答于 2008-05-16 11:34:39 7楼

看到很多朋友在论坛发帖子问关于鼠标悬停显示特效的解决办法,但似乎都没几个得到了具体的解决办法,那堂主今天就来做个详细点的讲解吧。首先看图,如果你问的是关于这个样子的特效,那就找对地方了,继续向下看吧!!
此主题相关图片如下:

很多朋友不知道这个特效上面的“[xsc.bnuep.com] 红色家园”处的字体应该怎么改,急啊,这个急啊,找遍了模板代码和CSS也没有,嘿嘿。都快急疯了。其实修改是很简单的。首先进入你还没改过来的那个页面,查看源文件,查找plus.js这个文件,记住它存放的文件夹路径,比如我的是src="/skin/red/plus.js",那我就去skin里的red这个文件中找到plus.js这个文件,之后用Macromedia Dreamweaver 8 打开它,找到第25行的 if(!re.test(Msg))pltsTitle="[xsc.bnuep.com]&Atilde;&Icirc;&raquo;&Atilde;&sup1;¤×÷&Ecirc;&Ograve;"; 这里的[xsc.bnuep.com]改成你自己的网站域名。&Atilde;&Icirc;&raquo;&Atilde;&sup1;¤×÷&Ecirc;&Ograve;这个代码改成你自己网站的汉字名字,保存再上传到空间相应目录下覆盖原文件就可以了!!

cai0cai

奇虎小灵通

[电脑网络]专家

发小纸条

回答于 2008-05-16 14:10:41 8楼

是鼠标的问题,你换一个

 1 

我的评论
 
登录 | 注册 (登录后发表评论,被支持会得到经验值和金币奖励哦 积分规则)

Copyright©2008 Qihoo.com All Rights Reserved 奇虎网
廊坊报警服务

&bnsp;