纵向向无缝滚动
<!-- 纵向向无缝滚动-->
<div id="demo" style="overflow:hidden;height:152px;width:100%">
<div id="demo1">
{get sql="SELECT contentid,catid,typeid,title,style,keywords,description,userid,inputtime,updatetime,thumb FROM `phpcms_content` WHERE status=99 AND `thumb`!='' AND `catid` IN(165,286,287,288) ORDER BY contentid ASC" rows="30"}
<div class="logopic"><img src="{thumb($r[thumb], $width, $height)}" width="100" height="50" alt="{$r[title]}" border="0" class="biakuang"/></div>
{/get}
</div>
<div id="demo2">
</div>
</div>
<script>
var speed=40;
var demo2=document.getElementById("demo2");
var demo1=document.getElementById("demo1");
var demo=document.getElementById("demo");
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight;
else{
demo.scrollTop++;
}
}
var MyMar=setInterval(Marquee,speed);
demo.onmouseover=function()
{
clearInterval(MyMar)
}
demo.onmouseout=function()
{
MyMar=setInterval(Marquee,speed)
}
</script>