﻿var Marquee = function(){
    try{document.execCommand("BackgroundImageCache", false, true);}catch(e){};
    var container = document.getElementById("OrderList"),
    original = container.getElementsByTagName("ul")[0],
    speed = arguments[1] || 50,
    clone = original.cloneNode(true);
    container.appendChild(clone);
    var rolling = function(){
      if(container.scrollTop >= clone.offsetTop){
        container.scrollTop = 0;
      }else{
        container.scrollTop++;
      }
    }
    var timer = setInterval(rolling,speed)//设置定时器
    container.onmouseover=function() {clearInterval(timer)}//鼠标移到marquee上时，清除定时器，停止滚动
    container.onmouseout=function() {timer=setInterval(rolling,speed)}//鼠标移开时重设定时器
}
if(document.all){
    window.attachEvent("onload", Marquee)
} else {
    window.addEventListener("load", Marquee, false)
}
