循环向左滚动 JS CSS

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

// JavaScript Document


//滚动
function GetGundong(demoStr,demoStr1,demoStr2,speed)
{
  var demo=document.getElementById(demoStr);
  var demo1=document.getElementById(demoStr1);
  var demo2=document.getElementById(demoStr2);
  demo2.innerHTML=demo1.innerHTML
  function Marquee(){
  if(demo2.offsetWidth-demo.scrollLeft<=0)
  demo.scrollLeft-=demo1.offsetWidth
  else{
  demo.scrollLeft++
  }
  }
  var MyMar=setInterval(Marquee,speed)
  demo.onmouseover=function() {clearInterval(MyMar)}
  demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
 }
 
//滚动
function GetSxGundong(demoStr,demoStr1,demoStr2,speed)
{
  var demo=document.getElementById(demoStr);
  var demo1=document.getElementById(demoStr1);
  var demo2=document.getElementById(demoStr2);
  
  demo2.innerHTML=demo1.innerHTML
  function Marquee2(){
  if(demo2.offsetTop-demo.scrollTop<=0)
  demo.scrollTop-=demo1.offsetHeight;
  else{
  demo.scrollTop++;
  }
  }
  var MyMar=setInterval(Marquee2,speed);
  demo.onmouseover=function() {clearInterval(MyMar)}
  demo.onmouseout=function() {MyMar=setInterval(Marquee2,speed)}
}


function resize(o) {
	if (o.width>580) {
	o.style.width='580px';
	o.style.height='auto';
	}
}