/*! * slideViewerPro 1.5 * Examples and documentation at: * http://www.gcmingati.net/wordpress/wp-content/lab/jquery/svwt/ * 2009-2011 Gian Carlo Mingati * Version: 1.5.0 (02-AUG-2011) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * Requires: * jQuery v1.6 or later * Option: * jQuery Timers plugin | plugins.jquery.com/project/timers (for autoslide mode) * */ jQuery.extend( jQuery.easing, // from the jquery.easing plugin { easeInOutExpo: function (x, t, b, c, d) { if (t==0) return b; if (t==d) return b+c; if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; } }); jQuery(function(){ //jQuery("div.svwp").prepend("loading..."); //change with YOUR loader image path }); var j = 0; jQuery.fn.slideViewerPro = function(settings) { settings = jQuery.extend({ galBorderWidth: 6, thumbsTopMargin: 3, thumbsRightMargin: 3, thumbsBorderWidth: 3, buttonsWidth: 20, galBorderColor: "#004261", thumbsBorderColor: "#d8d8d8", thumbsActiveBorderColor: "#004261", buttonsTextColor: "#004261", thumbsBorderOpacity: 1.0, // could be 0, 0.1 up to 1.0 thumbsActiveBorderOpacity: 1.0, // could be 0, 0.1 up to 1.0 easeTime: 750, asTimer: 4000, thumbs: 6, thumbsPercentReduction: 12, thumbsVis: true, easeFunc: "easeInOutExpo", leftButtonInner: "«", //could be an image "" or an escaped char as "&larr"; rightButtonInner: "»", //could be an image or an escaped char as "&rarr"; autoslide: false, typo: false, typoFullOpacity: 0.9, shuffle: false }, settings); return this.each(function(){ function shuffle(a) { var i = a.size(); while (--i) { var j = Math.floor(Math.random() * (i)); var tmp = a.slice(i, i+1); a.slice(j, j+1).insertAfter(tmp); } } var container = jQuery(this); (!settings.shuffle) ? null : shuffle(container.find("li")); container.find("img.ldrgif").remove(); container.removeClass("svwp").addClass("slideViewer"); container.attr("id", "svwp"+j); /** var pictWidth = container.find("img").width(); Reads the width of the first (and only) IMG height. That's why all images in the gal must have the same width/height */ var pictWidth = container.find("img").width(); var pictHeight = container.find("img").height(); var pictEls = container.find("li").size(); (pictEls >= settings.thumbs) ? null : settings.thumbs = pictEls; var slideViewerWidth = pictWidth*pictEls; var thumbsWidth = Math.round(pictWidth*settings.thumbsPercentReduction/100); var thumbsHeight = Math.round(pictHeight*settings.thumbsPercentReduction/100); var pos = 0; var r_enabled = true; var l_enabled = true; container.find("ul").css("width" , slideViewerWidth) .wrap(jQuery("
")); container.css("width" , pictWidth); container.css("height" , pictHeight); container.each(function(i) { if(settings.typo) { jQuery(this).find("img").each(function(z) { jQuery(this).after(""+jQuery(this).attr("alt")+"<\/span>"); }); } jQuery(this).after("