Skip to content

Javascript image slider

Considering the example below:

<html>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />

<div id="slider">
<img src='/templates/v4/img/car.jpeg'>
<img src='/templates/v4/img/car2.jpeg'>
<img src='/templates/v4/img/car3.jpeg'>
</div>

<script type='text/loader'>
var slider = jSuites.slider(document.getElementById('slider'), {
    grid: true
});
</script>
</html>
MethodDescription
open();Open the slider
close();Close the slider
show(imgElement);Open the slider if it is closed, and show the image passed as argument
next();Go to the next image
prev();Go to the previous image
reset();Remove all images
MethodDescription
onopenTrigger a method when the component is opened.
oncloseTrigger a method when the component is closed.
PropertyDescription
height: stringThe picker height.
width: stringThe picker width.
grid: booleanThe picker layout option.