2012-03-19 5 views
1

자바 스크립트 코드YUI 회전 목마 지정 탐색

YAHOO.util.Event.onDOMReady(function (ev) { 
    var carousel = new YAHOO.widget.Carousel("container", {isCircular: true, numVisible:1}); 
    console.log(carousel.set('navigation', {prev: document.getElementById('prev'), next: document.getElementById('next')})); 
    carousel.render(); 
    carousel.show(); 
}); 

HTML

<div id='container'> 
    <a href='#' ><span id='prev'> Prev </span></a> 
    <a href='#' ><span id='next'> Next </span></a> 
    <ol> 
     <li><img src='history_base_files/200.jpeg' height="300" width="300" /></li> 
     <li><img src='history_base_files/280.jpg' height="300" width="300" /></li> 
     <li><img src='history_base_files/350.jpg' height="300" width="300" /></li> 
     <li><img src='history_base_files/370.jpg' height="300" width="300" /></li> 
    </ol> 
</div> 

콘솔 출력 회전 목마의 탐색 속성을 설정하는 방법에 대한 false. 온라인에서 좋은 참조를 찾을 수 없습니다.

앵커 또는 스팬과 같은 사용자 지정 탐색을 사용하여 yui 회전식 메뉴를 만드는 방법은 무엇입니까? 이 솔루션은 나를 위해 일을보고 내 자신의 질문에 대답

답변

0

HTML :

<div id='container'> 
     <a id='prev' href="#" class="yui-carousel-button yui-carousel-prev" role="button"><span><strong>Prev</strong></span></a> 
     <a id='next' href="#" class="yui-carousel-button yui-carousel-next" role="button"><span><strong>Next</strong></span></a> 
     <ol> 
      <li><a href='#'><img src='history_base_files/200.jpeg' height="300" width="300" /></a></li> 
      <li><img src='history_base_files/280.jpg' height="300" width="300" /></li> 
      <li><img src='history_base_files/350.jpg' height="300" width="300" /></li> 
      <li><img src='history_base_files/370.jpg' height="300" width="300" /></li> 
     </ol> 
    </div> 

사용자 정의 버튼 클래스 유이 회전 목마 버튼, 유이 회전 목마 이전이 & 유이 회전 목마 옆에 추가 요소가 문제를 해결했습니다.