This Library supplies 2 Class:
NOTE the demo page can't show the AJAX because of the static nature of GH-Pages. but you can see it using the downloadable demo
The class is very strict about its class. To make sure you use it correctly, i suggest you use the CSS files that come with the library. In case you want to write up your own class, these are the must have classes:
The class can work in 2 different scenarios:
If you use the image list, it needs to be structured like this:
HTML
<ul> <li class='thumb'> <a href='#'> <img src='some-image.png' height:'10px' width:'10px' /></a> </li> </ul>
The 'IMG' tag must have a width and a height applied.
The JSON object should be an Array and structured like this:
{ { //a thumbnail: source : '', //a source for the anchor description : '', //a title for the anchor src : '', //thumbnail source width: 0, //thumbnail width - optional height: 0, //thumbnail height - optional alt: '' //an alt for the image } }
To generagte the carousel from a list call it like this:
var slides = new ThumbsSlides($('image-list'),{/* options */});
To generate from JSON use:
var slides = new ThumbsSlides({/* JSON object */},{/* options */});
There is also now an option to use an AJAX loader for this class like this:
var slides = new AJAXThumbs({/* JSON object */},{ thumbSize:64, useItemClass:true, movement : 7, url:'get_thumbs.php', start:14, //how many thumbs are already loaded loadNumber : 7, requestEvents : { 'request' : function(){console.log('started fetching');}, 'success' : function(){console.log('images fetched');} } });
The class will stop loading when recieving an empty object/array from the response.
ThumbsSlides:
AJAXThumbs:
The class comes with a base CSS file that you should always use - thumbs-base.css, and additional ones that set some basic dimensions for various thumbs sizes. The basic style comes with a default buttons style, but you can overwrite it. Also, you can look at the demo css to see some further styling.
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus