Powered by

PgwSlideshow - Responsive slideshow / gallery / carousel for jQuery / Zepto


Current version: 2.0
To download or fork this project, please visit our GitHub repository
And of course, you will need Jquery or Zepto to use this responsive carousel plugin.
jquery zepto.js


You can test our slideshow plugin, by resizing your browser and/or configuring some options, and see the result below:
 Slideshow style:
 Transition effect:
 Display options:
To see all available gallery options, click here.
  • San Francisco, USA
  • Rio de Janeiro, Brazil
  • Monaco
<ul class="pgwSlideshow">
    <li><img src="san-francisco.jpg" alt="San Francisco, USA" data-description="Golden Gate Bridge"></li>
    <li><img src="rio.jpg" alt="Rio de Janeiro, Brazil"></li>
    <li><img src="london_mini.jpg" alt="" data-large-src="london.jpg"></li>
    <li><img src="new-york.jpg" alt=""></li>
    <li><img src="new-delhi.jpg" alt=""></li>
    <li><img src="paris.jpg" alt=""></li>
    <li><img src="sydney.jpg" alt=""></li>
    <li><img src="tokyo.jpg" alt=""></li>
    <li><img src="honk-kong.jpg" alt=""></li>
    <li><img src="dakar.jpg" alt=""></li>
    <li><img src="toronto.jpg" alt=""></li>
        <a href="" target="_blank">
            <img src="monaco.jpg" alt="Monaco">
$(document).ready(function() {


Gallery components

The statement of the carousel elements is defined via a HTML tag "<ul>" (see the example above).
You can add one or more slideshows on a same page.
Each element must be placed in a <li> tag. By default, the image will be used in the list and to display the current element.
alt - This parameter defines the image title, it is used to display a caption on the image when it is selected. (See the first image in our example)
data-description - This parameter adds a new text line in the caption of the selected element. (See the first element in the example)
data-large-src - If you want to load a small image in the list, and a bigger when this image will be selected, you can add a "data-large-src" parameter to your <image> tag. (See the third image in the example)
If you wish, you can create a link on your image by wrapping the <img> tag with a <a> tag (with or without "target" parameter). This link only appears on the container of the selected image, not in the list. (See the last image in the previous example)

Carousel plugin options

These options can be added during the initialization of the slider to customize it.
Option name Type Default Description
mainClassName String
This option overrides the default CSS class of the slideshow.
transitionEffect String
2 transition effects are available: "sliding" or "fading".
autoSlide Boolean
Enable or disable the automatic transition between the gallery images.
beforeSlide Function
This option may contain a function that will be called before each new slide. For example:
"function(id) { console.log('Before sliding - The current slide is ' + id); }"
afterSlide Function
In the same way as beforeSlide, the function afterSlide can be called after each slide. For example:
"function(id) { console.log('After sliding - The current slide is ' + id); }"
displayList Boolean
This option displays or not the list of the carousel elements.
displayControls Boolean
On the main container, this parameter sets a button on each side to display the previous or next image.
touchControls Boolean
If this option is activated, the main container binds the touch movements and displays the previous or next slide. (Only the mobile devices send these events)
maxHeight Integer
If you want to set a maximum height to your slideshow, you can set this option with a number in pixels (without the suffix "px").
adaptiveDuration Integer
This duration is the period in milliseconds, during the adjustment of the previous option runs (if it is activated).
transitionDuration Integer
Period of animation in milliseconds between 2 images.
intervalDuration Integer
Interval in milliseconds before displaying of the next image. This option requires "autoSlide" option activated.

Slideshow API

To use these gallery API functions, you must assign the initialization to a variable.
var pgwSlideshow = $('.pgwSlideshow').pgwSlideshow();
startSlide - Enables the automatic sliding function.
stopSlide - Disables the automatic sliding function.
getCurrentSlide - Returns the current image number.
getSlideCount - Returns the total number of the gallery elements.
displaySlide - Displays the image selected by its number.
nextSlide - Displays the next image.
previousSlide - Displays the previous image.
destroy - Destroys the carousel. If a parameter "true" is passed, the container will be only hidden for a possible reloading.
reload - Reloads the slideshow with new options of configuration. For example:
    transitionEffect : 'fading',
    adaptiveDuration : 4000
jquery / zepto responsive slider - jquery / zepto responsive menu - jquery / zepto responsive modal / dialog - jquery / zepto cookie plugin