﻿// JScript 文件



//上下滚动
                function marqueeUpDown(one,two,three)
                {
                    
                    var speed=40; //数字越大速度越慢 
var tab=document.getElementById(one); 
var tab1=document.getElementById(two); 
var tab2=document.getElementById(three); 
                    tab2.innerHTML=tab1.innerHTML;          //克隆demo1为demo2 
function Marquee(){ 
                    if(tab2.offsetTop-tab.scrollTop<=0)//当滚动至demo1与demo2交界时 
tab.scrollTop-=tab1.offsetHeight  //demo跳到最顶端 
else{ 
tab.scrollTop++ 
} 
} 
var MyMar=setInterval(Marquee,speed); 
tab.onmouseover=function() {clearInterval(MyMar)};//鼠标移上时清除定时器达到滚动停止的目的 
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};//鼠标移开时重设定时器 
                }
                
                
                
                //左右滚动
                
                
                                function marqueeLeftRight(one,two,three)
                {
                    
                    var speed2=30; //数字越大速度越慢 
                    var tab3=document.getElementById(one); 
                    var tab4=document.getElementById(two); 
                    var tab5=document.getElementById(three); 
                    tab5.innerHTML=tab4.innerHTML; 
                    function Marquee2(){ 
                    if(tab5.offsetWidth-tab3.scrollLeft<=0) 
                    tab3.scrollLeft-=tab4.offsetWidth 
                    else{ 
                    tab3.scrollLeft++; 
                    } 
                    } 
                    var MyMar2=setInterval(Marquee2,speed2); 
                    tab3.onmouseover=function() {clearInterval(MyMar2)}; 
                    tab3.onmouseout=function() {MyMar2=setInterval(Marquee2,speed2)}; 
                }
                
                
                
                      //单行滚动          
function AutoScroll(obj){
$(obj).find("ul:first").animate({
marginTop:"-45px"
},500,function(){
$(this).css({marginTop:"0px"}).find("li:first").appendTo(this);
});
}
$(document).ready(function() {
	if ($("#scrollDiv li").length > 1) {
		setInterval('AutoScroll("#scrollDiv")', 3000)
	}
});
