Javascript Code
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>
Console outputs false on setting navigation property of carousel. Couldn’t find any good reference online.
How to create yui carousel with custom navigation like anchor or span?
Answering my own question to report the solution worked for me
HTML:
Adding classes yui-carousel-button, yui-carousel-prev & yui-carousel-next to custom button element solved the issue.