2009-06-01 10 views
0

HTML 페이지에 세 개의 div가 있습니다. 이javascript slide slick_accessible_slideshow

HTML 페이지와 같은 페이지보기 :

leftArrow(>) div rightArrow(<) 

은 내가 오른쪽에서 왼쪽으로 왼쪽에서 오른쪽으로 사업부를 이동해야합니다. javascript 및 DHTMl 사용

또는 JQuery.

그 방향으로 이동할 수 있습니까?

답변

1

예, 가능합니다. 과거에는 jQuery를 사용하지 않고도 그랬습니다. 이드 중 하나 scrollDivLeft 또는 scrollDivRight 함수로 'HorThumbs'를 전달

<div id="HorThumbs" style="overflow:hidden;width:500px"> 
    <div id="HorScroller" style="width:1000px"> 
    //Data to be shown 
    </div> 
</div> 

var scrollStep=1; 
var timerLeft,timerRight=""; 
function scrollDivLeft(id){ 
    clearTimeout(timerRight); 
    document.getElementById(id).scrollLeft-=scrollStep; 
    timerRight=setTimeout("scrollDivLeft('"+id+"')",1); 
} 

function scrollRight(id){ 
    clearTimeout(timerLeft); 
    document.getElementById(id).scrollLeft+=scrollStep; 
    timerLeft=setTimeout("scrollRight('"+id+"')",1); 
} 

그런 다음 왼쪽 및 오른쪽 화살표에 마우스 오버 이벤트를 추가 :

는 나는 다음과 같은 마크 업을 가지고있다.

0

jQuery cycle plugin을 살펴보십시오. 왼쪽/오른쪽으로 스크롤하고 이전/다음 버튼을 허용합니다.