| 123456789101112131415161718192021222324252627 |
- function StartScorll(box,btn,count){
- var scrollMax = btn.length;
- var scrollTimer = setInterval(function(){
- count++;
- if(count >= scrollMax){
- count = 0;
- }
- boxScorll(box, count);
- btnScorll(btn, count);
- },3000);
- btn.mouseover(function(){
- clearInterval(scrollTimer);
- count = $(this).index()
- btnMouseOver(box,btn,count);
- StartScorll(box,btn,count);
- })
- }
- function boxScorll(obj, index){
- obj.eq(index).addClass('active').siblings().removeClass('active');
- }
- function btnScorll(obj, index){
- obj.eq(index).addClass('active').siblings().removeClass('active');
- }
- function btnMouseOver(box,btn,btnIndex){
- btnScorll(btn, btnIndex);
- boxScorll(box, btnIndex);
- }
|