var adgallerySetting = { width: 600, // Width of the image, set to false and it will read the CSS width height: 400, // Height of the image, set to false and it will read the CSS height } var galleries = $('.ad-gallery').adGallery(adgallerySetting);
var adgallerySetting = { // All callbacks has the AdGallery objects as 'this' reference callbacks: { // This gets fired right before old_image is about to go away, and new_image // is about to come in beforeImageVisible: function(new_image, old_image) { // Do something wild! var thing = "this is it"; //Change the plugin enhanced page $(".ad-gallery .ad-image-wrapper .ad-image").removeAttr("style"); $(".ad-gallery .ad-image-wrapper .ad-image").css("width", "100%"); var width = $(".ad-gallery .ad-image-wrapper .ad-image img").attr("width"); $(".ad-gallery .ad-image-wrapper .ad-image img").attr("width", "100%"); $(".ad-gallery .ad-image-wrapper .ad-image .img").attr("width", 100%); $(".ad-gallery .ad-image-wrapper .ad-image").attr("height", 100%); } } };