JS:
<script type="text-javascript" language="javascript">
var marquees;
var marqueesHeight;
var marqueesWidth;
var stopscroll = false;
document.write('<div id="templayer" style="position:absolute;z-index:2000; top:0;left:0 ;visibility:hidden;"></div>');
function init(){
stopscroll=false;
marqueesHeight=120;
marqueesWidth=168;
marquees = document.getElementById('query');
with(marquees){
style.height=marqueesHeight;
style.width=marqueesWidt;
style.overflowX="visible";
style.overflowY="hidden"; onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
preTop=0; currentTop=0;
templayer1.innerHTML="";
while(templayer.offsetHeight<marqueesHeight){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollUp()",40);
}
function scrollUp(){
if(stopscroll==true) return;
preTop=marquees.scrollTop;
marquees1.scrollTop+=1;
if(preTop==marquees.scrollTop){
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
marquees.scrollTop+=1;
}
}
</script>
<script language="javascript" event="onload" for="window">
init();
</script>
<div id="query">滚动的部分</div>