FAQ

February 2nd, 2011 |

Table of contents

Answers

Q: Looking for a “STOP” and “PLAY” button in ulSlide… how to code?

<ul id="slider">
    <li><img src="photos/image-1.jpg" alt="" /></li>
    <li><img src="photos/image-2.jpg" alt="" /></li>
</ul>

<a id="slider_stop" href="#">Stop</a> | 
<a id="slider_play" href="#">Play</a>
$(function() {						
    $('#slide').ulslide({
        width: 433,
        height: 290,
        duration: 400,
        effect: {
            type: 'slide',
            axis: 'x'
        },
        autoslide: 3000
    });
});

$('#slider_stop').click(function(){
    var slider = $('#slider')[0];
    slider.clearAutoslide(); 
});

$('#slider_play').click(function(){
    var slider = $('#slider')[0];
    slider.initAutoslide(); 
});

Q: How to switch to the custom frame?

Below you can see code, which sets third frame on the slider:

<a id="set_third_frame" href="#">Set third frame</a>
$('#set_third_frame').click(function(){
    var slider = $('#slide1')[0];
    slider.uslCurrent(2); // 0 - first, 1 - second...
    slider.uslRefresh();
});