jQuery

【jQuery】軽量でタッチフレンドリーなギャラリースライダーRV Gallery Slider

June 8, 2018
RV gallery-slider

RV Gallery SliderはjQueryに基づいた軽量でタッチフレンドリーなギャラリースライダー。

Gallery init

HTML

<div class="gallery">
    <img class="gallery-item" src="images/1.jpg">
    <img class="gallery-item" src="images/2.jpg">
    <img class="gallery-item" src="images/3.jpg">
    <img class="gallery-item" src="images/4.jpg">
    <img class="gallery-item" src="images/5.jpg">
</div>

Javascript

$(selection).initGallery({options});

All options and default values in one place

nav: ["<span> < </span>", "<span> > </span>"],
close: "<span>X</span>",
showNav: true,
showNavIfOneItem: false,
aspectRatio: "auto",
showDots: false,
showDotsIfOneItem: false,
arrows: false,
fullScreen: true,
loop: true,
autoplay: false,
autoplayDelay: 2000,
transition: "fade",
transitionTime: 500,