PJBlog友情链接实现“无缝且居中(居左)滚动”

pop:注意一个bug,还有就是最开始的几个DIV里面的align="left"等,这个是控制居中、居左等的

注意:$Link_Code$里面只会显示顶置的链接

步骤:
界面与插件--设置模块,找到Link,选择“编辑HTML”,将下面的的代码直接覆盖即可

<div id="demo" style="OVERFLOW: hidden; HEIGHT: 280px" align="center">
<div id="demo1" align="left">$Link_Code$</div>
<div id="demo2" align="left"></div>
</div>
<script language="javascript" type="text/javascript">
<!--
var demo = document.getElementById("demo");
var demo1 = document.getElementById("demo1");
var demo2 = document.getElementById("demo2");
var speed=25;      //滚动速度值,值越大速度越慢
demo2.innerHTML = demo1.innerHTML      //克隆demo2为demo1
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)      //当滚动至demo1与demo2交界时
demo.scrollTop-=demo1.offsetHeight      //demo跳到最顶端
else{
demo.scrollTop++
}
}
var MyMar = setInterval(Marquee,speed);            //设置定时器
demo.onmouseover = function(){clearInterval(MyMar)}      //鼠标经过时清除定时器达到滚动停止的目的
demo.onmouseout = function(){MyMar = setInterval(Marquee,speed)}      //鼠标移开时重设定时器
-->
</script>
<br /><div align="right"><a href="bloglink.asp">申请|查看更多链接… </a></div>

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *