jQuery Thumbnail Image Slider - CSS, JavaScript With Examples

The Thumbnail Photo Slider Implementation( Codes )

If you have understood the layout of Pagination Controls in our previous tutorials, it’s quite easy to understand how we convert the same pagination with Thumbnail view of the Images.

Instead of creating the Pagination dynamically in ‘thumbnailSliderScript.js’ file, we’ll add a list of image items in our HTML code and from JS file, we’ll assign a ‘data’ attribute named ‘pgno’ to each such image item, dynamically.

Also in our ‘thumbnailSliderScript.js’ file, we’re using two methods named removeClass(), and toggleClass(), for dynamically changing the CSS property of the current pagination image and rest other thumbnails.

The ThumbnailSlider.html file has structural elements along with scripts related to creation of the object for our slider. Observe how each of the slide content is enlisted as the unordered list elements. Two files thumbnailStyle.css and thumbnailSliderScript.js contain styles and methods for controlling the slider motion, direction and also for styling the Pagination thumbnail. You would also need reference to JQuery Library i.e. https://code.jquery.com/jquery-2.1.0.js which you can download and save in the folder ‘scripts’.

Codes for all these files are as shown below.

ThumbnailSlider.html

thumbnailStyle.css

thumbnailSliderScript.js

The source codes have comments wherever it is needed. In case of specific doubt you can ask me directly by commenting.

By admin

Leave a Reply

%d bloggers like this: