|
|
Line 11: |
Line 11: |
| padding: 0; | | padding: 0; |
| background: #fff; | | background: #fff; |
- | }a | + | } |
| .slideViewer ul { /*your list of images*/ | | .slideViewer ul { /*your list of images*/ |
| position: relative; | | position: relative; |
Line 86: |
Line 86: |
| } | | } |
| a:focus {outline:none;} | | a:focus {outline:none;} |
- | </style><script> | + | </style><div class="content_box_wrapper"> |
- | /*
| + | |
- | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
| + | |
- | *
| + | |
- | * Uses the built in easing capabilities added In jQuery 1.1
| + | |
- | * to offer multiple easing options
| + | |
- | *
| + | |
- | * TERMS OF USE - jQuery Easing
| + | |
- | *
| + | |
- | * Open source under the BSD License.
| + | |
- | *
| + | |
- | * Copyright © 2008 George McGinley Smith
| + | |
- | * All rights reserved.
| + | |
- | *
| + | |
- | * Redistribution and use in source and binary forms, with or without modification,
| + | |
- | * are permitted provided that the following conditions are met:
| + | |
- | *
| + | |
- | * Redistributions of source code must retain the above copyright notice, this list of
| + | |
- | * conditions and the following disclaimer.
| + | |
- | * Redistributions in binary form must reproduce the above copyright notice, this list
| + | |
- | * of conditions and the following disclaimer in the documentation and/or other materials
| + | |
- | * provided with the distribution.
| + | |
- | *
| + | |
- | * Neither the name of the author nor the names of contributors may be used to endorse
| + | |
- | * or promote products derived from this software without specific prior written permission.
| + | |
- | *
| + | |
- | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
| + | |
- | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
| + | |
- | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
| + | |
- | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
| + | |
- | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
| + | |
- | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
| + | |
- | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
| + | |
- | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
| + | |
- | * OF THE POSSIBILITY OF SUCH DAMAGE.
| + | |
- | *
| + | |
- | */
| + | |
- | | + | |
- | // t: current time, b: begInnIng value, c: change In value, d: duration
| + | |
- | jQuery.easing['jswing'] = jQuery.easing['swing'];
| + | |
- | | + | |
- | jQuery.extend( jQuery.easing,
| + | |
- | {
| + | |
- | def: 'easeOutQuad',
| + | |
- | swing: function (x, t, b, c, d) {
| + | |
- | //alert(jQuery.easing.default);
| + | |
- | return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
| + | |
- | },
| + | |
- | easeInQuad: function (x, t, b, c, d) {
| + | |
- | return c*(t/=d)*t + b;
| + | |
- | },
| + | |
- | easeOutQuad: function (x, t, b, c, d) {
| + | |
- | return -c *(t/=d)*(t-2) + b;
| + | |
- | },
| + | |
- | easeInOutQuad: function (x, t, b, c, d) {
| + | |
- | if ((t/=d/2) < 1) return c/2*t*t + b;
| + | |
- | return -c/2 * ((--t)*(t-2) - 1) + b;
| + | |
- | },
| + | |
- | easeInCubic: function (x, t, b, c, d) {
| + | |
- | return c*(t/=d)*t*t + b;
| + | |
- | },
| + | |
- | easeOutCubic: function (x, t, b, c, d) {
| + | |
- | return c*((t=t/d-1)*t*t + 1) + b;
| + | |
- | },
| + | |
- | easeInOutCubic: function (x, t, b, c, d) {
| + | |
- | if ((t/=d/2) < 1) return c/2*t*t*t + b;
| + | |
- | return c/2*((t-=2)*t*t + 2) + b;
| + | |
- | },
| + | |
- | easeInQuart: function (x, t, b, c, d) {
| + | |
- | return c*(t/=d)*t*t*t + b;
| + | |
- | },
| + | |
- | easeOutQuart: function (x, t, b, c, d) {
| + | |
- | return -c * ((t=t/d-1)*t*t*t - 1) + b;
| + | |
- | },
| + | |
- | easeInOutQuart: function (x, t, b, c, d) {
| + | |
- | if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
| + | |
- | return -c/2 * ((t-=2)*t*t*t - 2) + b;
| + | |
- | },
| + | |
- | easeInQuint: function (x, t, b, c, d) {
| + | |
- | return c*(t/=d)*t*t*t*t + b;
| + | |
- | },
| + | |
- | easeOutQuint: function (x, t, b, c, d) {
| + | |
- | return c*((t=t/d-1)*t*t*t*t + 1) + b;
| + | |
- | },
| + | |
- | easeInOutQuint: function (x, t, b, c, d) {
| + | |
- | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
| + | |
- | return c/2*((t-=2)*t*t*t*t + 2) + b;
| + | |
- | },
| + | |
- | easeInSine: function (x, t, b, c, d) {
| + | |
- | return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
| + | |
- | },
| + | |
- | easeOutSine: function (x, t, b, c, d) {
| + | |
- | return c * Math.sin(t/d * (Math.PI/2)) + b;
| + | |
- | },
| + | |
- | easeInOutSine: function (x, t, b, c, d) {
| + | |
- | return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
| + | |
- | },
| + | |
- | easeInExpo: function (x, t, b, c, d) {
| + | |
- | return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
| + | |
- | },
| + | |
- | easeOutExpo: function (x, t, b, c, d) {
| + | |
- | return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
| + | |
- | },
| + | |
- | 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;
| + | |
- | },
| + | |
- | easeInCirc: function (x, t, b, c, d) {
| + | |
- | return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
| + | |
- | },
| + | |
- | easeOutCirc: function (x, t, b, c, d) {
| + | |
- | return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
| + | |
- | },
| + | |
- | easeInOutCirc: function (x, t, b, c, d) {
| + | |
- | if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
| + | |
- | return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
| + | |
- | },
| + | |
- | easeInElastic: function (x, t, b, c, d) {
| + | |
- | var s=1.70158;var p=0;var a=c;
| + | |
- | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
| + | |
- | if (a < Math.abs(c)) { a=c; var s=p/4; }
| + | |
- | else var s = p/(2*Math.PI) * Math.asin (c/a);
| + | |
- | return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
| + | |
- | },
| + | |
- | easeOutElastic: function (x, t, b, c, d) {
| + | |
- | var s=1.70158;var p=0;var a=c;
| + | |
- | if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
| + | |
- | if (a < Math.abs(c)) { a=c; var s=p/4; }
| + | |
- | else var s = p/(2*Math.PI) * Math.asin (c/a);
| + | |
- | return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
| + | |
- | },
| + | |
- | easeInOutElastic: function (x, t, b, c, d) {
| + | |
- | var s=1.70158;var p=0;var a=c;
| + | |
- | if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
| + | |
- | if (a < Math.abs(c)) { a=c; var s=p/4; }
| + | |
- | else var s = p/(2*Math.PI) * Math.asin (c/a);
| + | |
- | if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
| + | |
- | return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
| + | |
- | },
| + | |
- | easeInBack: function (x, t, b, c, d, s) {
| + | |
- | if (s == undefined) s = 1.70158;
| + | |
- | return c*(t/=d)*t*((s+1)*t - s) + b;
| + | |
- | },
| + | |
- | easeOutBack: function (x, t, b, c, d, s) {
| + | |
- | if (s == undefined) s = 1.70158;
| + | |
- | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
| + | |
- | },
| + | |
- | easeInOutBack: function (x, t, b, c, d, s) {
| + | |
- | if (s == undefined) s = 1.70158;
| + | |
- | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
| + | |
- | return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
| + | |
- | },
| + | |
- | easeInBounce: function (x, t, b, c, d) {
| + | |
- | return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
| + | |
- | },
| + | |
- | easeOutBounce: function (x, t, b, c, d) {
| + | |
- | if ((t/=d) < (1/2.75)) {
| + | |
- | return c*(7.5625*t*t) + b;
| + | |
- | } else if (t < (2/2.75)) {
| + | |
- | return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
| + | |
- | } else if (t < (2.5/2.75)) {
| + | |
- | return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
| + | |
- | } else {
| + | |
- | return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
| + | |
- | }
| + | |
- | },
| + | |
- | easeInOutBounce: function (x, t, b, c, d) {
| + | |
- | if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
| + | |
- | return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
| + | |
- | }
| + | |
- | });
| + | |
- | | + | |
- | /*
| + | |
- | *
| + | |
- | * TERMS OF USE - EASING EQUATIONS
| + | |
- | *
| + | |
- | * Open source under the BSD License.
| + | |
- | *
| + | |
- | * Copyright © 2001 Robert Penner
| + | |
- | * All rights reserved.
| + | |
- | *
| + | |
- | * Redistribution and use in source and binary forms, with or without modification,
| + | |
- | * are permitted provided that the following conditions are met:
| + | |
- | *
| + | |
- | * Redistributions of source code must retain the above copyright notice, this list of
| + | |
- | * conditions and the following disclaimer.
| + | |
- | * Redistributions in binary form must reproduce the above copyright notice, this list
| + | |
- | * of conditions and the following disclaimer in the documentation and/or other materials
| + | |
- | * provided with the distribution.
| + | |
- | *
| + | |
- | * Neither the name of the author nor the names of contributors may be used to endorse
| + | |
- | * or promote products derived from this software without specific prior written permission.
| + | |
- | *
| + | |
- | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
| + | |
- | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
| + | |
- | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
| + | |
- | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
| + | |
- | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
| + | |
- | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
| + | |
- | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
| + | |
- | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
| + | |
- | * OF THE POSSIBILITY OF SUCH DAMAGE.
| + | |
- | *
| + | |
- | */
| + | |
- | /*!
| + | |
- | * slideViewerPro 1.0
| + | |
- | * Examples and documentation at:
| + | |
- | * http://www.gcmingati.net/wordpress/wp-content/lab/jquery/svwt/
| + | |
- | * 2009 Gian Carlo Mingati
| + | |
- | * Version: 1.0.4 (12-AUGUST-2009)
| + | |
- | * 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.3.2 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("<img src='images/svwloader.gif' class='ldrgif' alt='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: "#ff0000",
| + | |
- | thumbsBorderColor: "#d8d8d8",
| + | |
- | thumbsActiveBorderColor: "#ff0000",
| + | |
- | buttonsTextColor: "#ff0000",
| + | |
- | 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: 5,
| + | |
- | thumbsPercentReduction: 12,
| + | |
- | thumbsVis: true,
| + | |
- | easeFunc: "easeInOutExpo",
| + | |
- | leftButtonInner: "-", //could be an image "<img src='images/larw.gif' />" 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").attr("width");
| + | |
- | var pictHeight = container.find("img").attr("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("<div style='width:"+ pictWidth +"px; overflow: hidden; position: relative; top: 0; left: 0'>"));
| + | |
- | 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("<span class='typo' style='position: absolute; width:"+(pictWidth-12)+"px; margin: 0 0 0 -"+pictWidth+"px'>"+jQuery(this).attr("alt")+"<\/span>");
| + | |
- | });
| + | |
- | }
| + | |
- | jQuery(this).after("<div class='thumbSlider' id='thumbSlider" + j + "'><ul><\/ul><\/div>");
| + | |
- | jQuery(this).next().after("<a href='#' class='left' id='left" + j + "'><span>"+settings.leftButtonInner+"</span><\/a><a href='#' class='right' id='right" + j + "'><span>"+settings.rightButtonInner+"<\/span><\/a>");
| + | |
- |
| + | |
- | jQuery(this).find("li").each(function(n) {
| + | |
- | jQuery("div#thumbSlider" + j + " ul").append("<li><a title='" + jQuery(this).find("img").attr("alt") + "' href='#'><img width='"+ thumbsWidth +"' height='"+ thumbsHeight +"' src='" + jQuery(this).find("img").attr("src") + "' /><p class='tmbrdr'> <\/p><\/a><\/li>");
| + | |
- | });
| + | |
- |
| + | |
- | jQuery("div#thumbSlider" + j + " a").each(function(z) {
| + | |
- | jQuery(this).bind("click", function(){
| + | |
- | jQuery(this).find("p.tmbrdr").css({borderColor: settings.thumbsActiveBorderColor, opacity: settings.thumbsActiveBorderOpacity});
| + | |
- | jQuery(this).parent().parent().find("p.tmbrdr").not(jQuery(this).find("p.tmbrdr")).css({borderColor: settings.thumbsBorderColor, opacity: settings.thumbsBorderOpacity});
| + | |
- | var cnt = -(pictWidth*z);
| + | |
- | (cnt != container.find("ul").css("left").replace(/px/, "")) ? container.find("span.typo").animate({"opacity": 0}, 250) : null ;
| + | |
- | container.find("ul").animate({ left: cnt}, settings.easeTime, settings.easeFunc, function(){container.find("span.typo").animate({"opacity": settings.typoFullOpacity}, 250)});
| + | |
- | return false;
| + | |
- | });
| + | |
- | });
| + | |
- | // shortcuts to +/- buttons
| + | |
- | var jQuerybtl = jQuery("a#left" + j);
| + | |
- | var jQuerybtr = jQuery("a#right" + j);
| + | |
- |
| + | |
- | // right/left
| + | |
- | jQuerybtr.bind("click", function(){
| + | |
- | if (r_enabled) (pictEls-pos > settings.thumbs*2 || pictEls%settings.thumbs == 0)? pos += settings.thumbs : pos += pictEls % settings.thumbs;
| + | |
- | r_enabled = false;
| + | |
- | jQuery(this).prev().prev().find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();});
| + | |
- | return false;
| + | |
- | });
| + | |
- | jQuerybtl.bind("click", function(){
| + | |
- | if (l_enabled && pos!=0) (pictEls-pos > settings.thumbs || pictEls%settings.thumbs == 0)? pos -= settings.thumbs : pos -= pictEls % settings.thumbs;
| + | |
- | l_enabled = false;
| + | |
- | jQuery(this).prev().find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();});
| + | |
- | return false;
| + | |
- | });
| + | |
- |
| + | |
- | function authorityMixing()
| + | |
- | {
| + | |
- |
| + | |
- | //right btt
| + | |
- | (pos == pictEls-settings.thumbs) ? jQuerybtr.addClass("r_dis") : jQuerybtr.removeClass("r_dis");
| + | |
- | (pos == pictEls-settings.thumbs) ? r_enabled = false : r_enabled = true;
| + | |
- | //left btt
| + | |
- | (pos == 0) ? jQuerybtl.addClass("l_dis") : jQuerybtl.removeClass("l_dis");
| + | |
- | (pos == 0) ? l_enabled = false : l_enabled = true;
| + | |
- | }
| + | |
- |
| + | |
- | //CSS defs @ runtime
| + | |
- | var tBorder = settings.thumbsBorderWidth;
| + | |
- | var contBorder = settings.galBorderWidth
| + | |
- |
| + | |
- | jQuery(".slideViewer a img").css({border: "0"});
| + | |
- | if(settings.typo)
| + | |
- | {
| + | |
- | jQuery(this).find("span.typo").each(function(z) {
| + | |
- | jQuery(this).css({marginTop: (pictHeight-jQuery(this).innerHeight()), opacity: settings.typoFullOpacity});
| + | |
- | });
| + | |
- | }
| + | |
- | jQuery("div#svwp"+ j).css({border: settings.galBorderWidth +"px solid "+settings.galBorderColor});
| + | |
- |
| + | |
- | jQuery("div#thumbSlider" + j).css({position: "relative", left: contBorder, top: settings.thumbsTopMargin+"px", width: settings.thumbs*thumbsWidth+((settings.thumbsRightMargin*settings.thumbs)-settings.thumbsRightMargin), height: thumbsHeight, textAlign: "center", overflow: "hidden", margin: "0 auto"});
| + | |
- | jQuery("div#thumbSlider" + j + " ul").css({width: (thumbsWidth*pictEls)+settings.thumbsRightMargin*pictEls, position: "relative", left: "0", top: "0"});
| + | |
- | jQuery("div#thumbSlider" + j + " ul li").css({marginRight: settings.thumbsRightMargin});
| + | |
- |
| + | |
- | jQuery("div#thumbSlider" + j).find("p.tmbrdr").css({width: (thumbsWidth-tBorder*2)+"px", height: (thumbsHeight-tBorder*2) +"px", top: -(thumbsHeight) +"px", border: settings.thumbsBorderWidth +"px solid "+settings.thumbsBorderColor, opacity: settings.thumbsBorderOpacity});
| + | |
- | jQuery("div#thumbSlider" + j + " a:first p.tmbrdr").css({borderColor: settings.thumbsActiveBorderColor, opacity: settings.thumbsActiveBorderOpacity});
| + | |
- |
| + | |
- | var rbttLeftMargin = (pictWidth/2) + (jQuery("div#thumbSlider" + j).width()/2) + settings.thumbsRightMargin + contBorder;
| + | |
- | var lbttLeftMargin = (pictWidth/2) - (jQuery("div#thumbSlider" + j).width()/2) - (settings.buttonsWidth + settings.thumbsRightMargin) + contBorder;
| + | |
- | var innerImgH = jQuery("a#right" + j + " span img").attr("height");
| + | |
- |
| + | |
- | jQuery("a#left" + j).css({display: "block", textAlign: "center", width: settings.buttonsWidth + "px" , height: thumbsHeight+"px", margin: -(thumbsHeight-settings.thumbsTopMargin) +"px 0 0 "+lbttLeftMargin+"px", textDecoration: "none", lineHeight: thumbsHeight+"px", color: settings.buttonsTextColor});
| + | |
- | jQuery("a#right" + j).css({display: "block", textAlign: "center", width: settings.buttonsWidth + "px", height: thumbsHeight+"px" , margin: -(thumbsHeight) +"px 0 0 "+rbttLeftMargin+"px", textDecoration: "none", lineHeight: thumbsHeight+"px", color: settings.buttonsTextColor});
| + | |
- | jQuery("a#left" + j + " span img").css({margin: Math.round((thumbsHeight/2)-(innerImgH/2))+"px 0 0 0"});
| + | |
- | jQuery("a#right" + j + " span img").css({margin: Math.round((thumbsHeight/2)-(innerImgH/2))+"px 0 0 0"});
| + | |
- |
| + | |
- | authorityMixing();
| + | |
- |
| + | |
- | if(settings.autoslide){
| + | |
- |
| + | |
- | var i = 1;
| + | |
- |
| + | |
- | jQuery("div#thumbSlider" + j).everyTime(settings.asTimer, "asld", function() {
| + | |
- | jQuery(this).find("a").eq(i).trigger("click");
| + | |
- | if(i == 0)
| + | |
- | {
| + | |
- | pos = 0;
| + | |
- | l_enabled = false;
| + | |
- | jQuery("div#thumbSlider" + j).find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();});
| + | |
- | }
| + | |
- | else l_enabled = true;
| + | |
- |
| + | |
- | (i%settings.thumbs == 0)? jQuery(this).next().next().trigger("click") : null;
| + | |
- | (i < pictEls-1)? i++ : i=0;
| + | |
- | });
| + | |
- |
| + | |
- | //stops autoslidemode
| + | |
- | jQuery("a#right" + j).bind("mouseup", function(){
| + | |
- | jQuery(this).prev().prev().stopTime("asld");
| + | |
- | });
| + | |
- | jQuery("a#left" + j).bind("mouseup", function(){
| + | |
- | jQuery(this).prev().stopTime("asld");
| + | |
- | });
| + | |
- | jQuery("div#thumbSlider" + j + " a").bind("mouseup", function(){
| + | |
- | jQuery(this).parent().parent().parent().stopTime("asld");
| + | |
- | });
| + | |
- | }
| + | |
- | var uiDisplay = (settings.thumbsVis)? "block":"none";
| + | |
- | jQuery("div#thumbSlider" + j + ", a#left" + j + ", a#right" + j).wrapAll("<div style='width:"+ pictWidth +"px; display: "+uiDisplay+"' id='ui"+j+"'><\/div>");
| + | |
- | jQuery("div#svwp"+ j + ", div#ui" + j).wrapAll("<div style='width:"+ pictWidth +"px'><\/div>");
| + | |
- | });
| + | |
- | (jQuery("div#thumbSlider" + j).width()+(settings.buttonsWidth*2) >= pictWidth)? alert("ALERT: THE THUMBNAILS SLIDER IS TOO WIDE! \nthumbsPercentReduction and/or buttonsWidth needs to be scaled down!") : null;
| + | |
- | j++;
| + | |
- | });
| + | |
- | };
| + | |
- | jQuery.fn.extend({
| + | |
- | everyTime: function(interval, label, fn, times, belay) {
| + | |
- | return this.each(function() {
| + | |
- | jQuery.timer.add(this, interval, label, fn, times, belay);
| + | |
- | });
| + | |
- | },
| + | |
- | oneTime: function(interval, label, fn) {
| + | |
- | return this.each(function() {
| + | |
- | jQuery.timer.add(this, interval, label, fn, 1);
| + | |
- | });
| + | |
- | },
| + | |
- | stopTime: function(label, fn) {
| + | |
- | return this.each(function() {
| + | |
- | jQuery.timer.remove(this, label, fn);
| + | |
- | });
| + | |
- | }
| + | |
- | });
| + | |
- |
| + | |
- | jQuery.extend({
| + | |
- | timer: {
| + | |
- | guid: 1,
| + | |
- | global: {},
| + | |
- | regex: /^([0-9]+)\s*(.*s)?$/,
| + | |
- | powers: {
| + | |
- | // Yeah this is major overkill...
| + | |
- | 'ms': 1,
| + | |
- | 'cs': 10,
| + | |
- | 'ds': 100,
| + | |
- | 's': 1000,
| + | |
- | 'das': 10000,
| + | |
- | 'hs': 100000,
| + | |
- | 'ks': 1000000
| + | |
- | },
| + | |
- | timeParse: function(value) {
| + | |
- | if (value == undefined || value == null)
| + | |
- | return null;
| + | |
- | var result = this.regex.exec(jQuery.trim(value.toString()));
| + | |
- | if (result[2]) {
| + | |
- | var num = parseInt(result[1], 10);
| + | |
- | var mult = this.powers[result[2]] || 1;
| + | |
- | return num * mult;
| + | |
- | } else {
| + | |
- | return value;
| + | |
- | }
| + | |
- | },
| + | |
- | add: function(element, interval, label, fn, times, belay) {
| + | |
- | var counter = 0;
| + | |
- |
| + | |
- | if (jQuery.isFunction(label)) {
| + | |
- | if (!times)
| + | |
- | times = fn;
| + | |
- | fn = label;
| + | |
- | label = interval;
| + | |
- | }
| + | |
- |
| + | |
- | interval = jQuery.timer.timeParse(interval);
| + | |
- |
| + | |
- | if (typeof interval != 'number' || isNaN(interval) || interval <= 0)
| + | |
- | return;
| + | |
- |
| + | |
- | if (times && times.constructor != Number) {
| + | |
- | belay = !!times;
| + | |
- | times = 0;
| + | |
- | }
| + | |
- |
| + | |
- | times = times || 0;
| + | |
- | belay = belay || false;
| + | |
- |
| + | |
- | if (!element.$timers)
| + | |
- | element.$timers = {};
| + | |
- |
| + | |
- | if (!element.$timers[label])
| + | |
- | element.$timers[label] = {};
| + | |
- |
| + | |
- | fn.$timerID = fn.$timerID || this.guid++;
| + | |
- |
| + | |
- | var handler = function() {
| + | |
- | if (belay && this.inProgress)
| + | |
- | return;
| + | |
- | this.inProgress = true;
| + | |
- | if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
| + | |
- | jQuery.timer.remove(element, label, fn);
| + | |
- | this.inProgress = false;
| + | |
- | };
| + | |
- |
| + | |
- | handler.$timerID = fn.$timerID;
| + | |
- |
| + | |
- | if (!element.$timers[label][fn.$timerID])
| + | |
- | element.$timers[label][fn.$timerID] = window.setInterval(handler,interval);
| + | |
- |
| + | |
- | if ( !this.global[label] )
| + | |
- | this.global[label] = [];
| + | |
- | this.global[label].push( element );
| + | |
- |
| + | |
- | },
| + | |
- | remove: function(element, label, fn) {
| + | |
- | var timers = element.$timers, ret;
| + | |
- |
| + | |
- | if ( timers ) {
| + | |
- |
| + | |
- | if (!label) {
| + | |
- | for ( label in timers )
| + | |
- | this.remove(element, label, fn);
| + | |
- | } else if ( timers[label] ) {
| + | |
- | if ( fn ) {
| + | |
- | if ( fn.$timerID ) {
| + | |
- | window.clearInterval(timers[label][fn.$timerID]);
| + | |
- | delete timers[label][fn.$timerID];
| + | |
- | }
| + | |
- | } else {
| + | |
- | for ( var fn in timers[label] ) {
| + | |
- | window.clearInterval(timers[label][fn]);
| + | |
- | delete timers[label][fn];
| + | |
- | }
| + | |
- | }
| + | |
- |
| + | |
- | for ( ret in timers[label] ) break;
| + | |
- | if ( !ret ) {
| + | |
- | ret = null;
| + | |
- | delete timers[label];
| + | |
- | }
| + | |
- | }
| + | |
- |
| + | |
- | for ( ret in timers ) break;
| + | |
- | if ( !ret )
| + | |
- | element.$timers = null;
| + | |
- | }
| + | |
- | }
| + | |
- | }
| + | |
- | });
| + | |
- |
| + | |
- | if (jQuery.browser.msie)
| + | |
- | jQuery(window).one("unload", function() {
| + | |
- | var global = jQuery.timer.global;
| + | |
- | for ( var label in global ) {
| + | |
- | var els = global[label], i = els.length;
| + | |
- | while ( --i )
| + | |
- | jQuery.timer.remove(els[i], label);
| + | |
- | }
| + | |
- | });
| + | |
- |
| + | |
- |
| + | |
- | /**
| + | |
- | * Name: piroBox v.1.2.1
| + | |
- | * Date: November 2009
| + | |
- | * Autor: Diego Valobra (http://www.pirolab.it),(http://www.diegovalobra.com)
| + | |
- | * Version: 1.2.1
| + | |
- | * Licence: CC-BY-SA http://creativecommons.org/licenses/by-sa/2.5/it/
| + | |
- | **/
| + | |
- | (function(a){a.fn.piroBox=function(b){b=jQuery.extend({my_speed:null,close_speed:300,bg_alpha:0.5,scrollImage:null,pirobox_next:"piro_next_out",pirobox_prev:"piro_prev_out",radius:4,close_all:".piro_close,.piro_overlay",slideShow:null,slideSpeed:null},b);function c(){var s='<tr><td colspan="3" class="pirobox_up"></td></tr><tr><td class="t_l"></td><td class="t_c"></td><td class="t_r"></td></tr><tr><td class="c_l"></td><td class="c_c"><span><span></span></span><div></div></td><td class="c_r"></td></tr><tr><td class="b_l"></td><td class="b_c"></td><td class="b_r"></td></tr><tr><td colspan="3" class="pirobox_down"></td></tr>';var q=a(window).height();var p=a(jQuery('<div class="piro_overlay"></div>').hide().css({opacity:+b.bg_alpha,height:q+"px"}));var l=a(jQuery('<table class="pirobox_content" cellpadding="0" cellspacing="0"></table>'));var w=a(jQuery('<div class="caption"></div>').css({opacity:"0.8","-moz-border-radius":b.radius+"px","-khtml-border-radius":b.radius+"px","-webkit-border-radius":b.radius+"px","border-radius":b.radius+"px"}));var f=a(jQuery('<div class="piro_nav"></div>'));var t=a(jQuery('<div class="piro_close"></div>'));var r=a(jQuery('<a href="#play" class="play"></a>'));var n=a(jQuery('<a href="#stop" class="stop"></a>'));var j=a(jQuery('<a href="#prev" class="'+b.pirobox_prev+'"></a>'));var k=a(jQuery('<a href="#next" class="'+b.pirobox_next+'"></a>'));a("body").append(p).append(l);l.append(s);a(".pirobox_up").append(t);a(".pirobox_down").append(f);a(".c_c").append(r);r.hide();f.append(j).append(k).append(w);if(j.is(".piro_prev_out")||k.is(".piro_next_out")){a("body").append(j).append(k);j.add(k).hide()}else{f.append(j).append(k)}var e=j.width();l.hide();var x=a("a[class^='pirobox_gall']");var y=new Object();for(var v=0;v<x.length;v++){var h=a(x[v]);y["a."+h.attr("class")]=0}var o=new Array();for(var B in y){o.push(B);if(a(B).length===1){alert("For single image is recommended to use class pirobox");a(B).css("border","2px dotted red")}}for(var v=0;v<o.length;v++){a(o[v]).each(function(i){this.rel=i+1+" of "+a(o[v]).length});var d=a(o[v]+":first").addClass("first");var u=a(o[v]+":last").addClass("last")}a(x).each(function(i){this.rev=i+0});var m=a(x);var z=a("a.pirobox");a.fn.fixPNG=function(){return this.each(function(){var i=a(this).css("backgroundImage");if(i.match(/^url\(["']?(.*\.png)["']?\)$/i)){i=RegExp.$1;a(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod="+(a(this).css("backgroundRepeat")=="no-repeat"?"crop":"scale")+", src='"+i+"')"}).each(function(){var C=a(this).css("position");if(C!="absolute"&&C!="relative"){a(this).css("position","relative")}})}})};a(window).resize(function(){var i=a(window).height();p.css({visibility:"visible",height:+i+"px"})});j.add(k).bind("click",function(D){D.preventDefault();var i=parseInt(a(m).filter(".item").attr("rev"));var C=a(this).is(".piro_prev_out,.piro_prev")?a(m).eq(i-1):a(m).eq(i+1);C.click();t.add(w).add(k).add(j).css("visibility","hidden")});z.each(function(C){var i=a(this);i.bind("click",function(F){F.preventDefault();g(i.attr("href"));var D=i.attr("href");var E=i.attr("title");if(E==""){w.html("<p>"+D+"<a href="+D+' class="link_to" target="_blank" title="Open Image in a new window"></a></p>')}else{w.html("<p>"+E+"<a href="+D+' class="link_to" target="_blank" title="Open Image in a new window"></a></p>')}a(".c_c").addClass("unique");k.add(j).add(t).add(w).hide();a(".play").remove()})});a(m).each(function(C){var i=a(this);i.bind("click",function(G){G.preventDefault();g(i.attr("href"));var D=i.attr("href");var F=i.attr("title");var E=i.attr("rel");if(F==""){w.html("<p>"+D+'<em class="number">'+E+"</em><a href="+D+' class="link_to" target="_blank" title="Open Image in a new window"></a></p>')}else{w.html("<p>"+F+'<em class="number">'+E+"</em><a href="+D+' class="link_to" target="_blank" title="Open Image in a new window"></a></p>')}if(i.is(".last")){a(".number").css("text-decoration","underline")}else{a(".number").css("text-decoration","none")}if(i.is(".first")){j.hide();k.show()}else{k.add(j).show()}if(i.is(".last")){j.show();k.hide()}if(i.is(".last")&&i.is(".first")){j.add(k).hide();a(".number").hide();r.remove()}a(m).filter(".item").removeClass("item");i.addClass("item");a(".c_c").removeClass("unique")})});var g=function(i){r.add(n).hide();t.add(w).add(k).add(j).css("visibility","hidden");if(l.is(":visible")){a(".c_c div").children().fadeOut(300,function(){a(".c_c div").children().remove();A(i)})}else{a(".c_c div").children().remove();l.show();p.fadeIn(300,function(){A(i)})}};var A=function(H){if(l.is(".loading")){return}l.addClass("loading");var C=new Image();C.onerror=function(){var J=a(l).height();l.css({marginTop:parseInt(a(document).scrollTop())-(J/1.9)});a(".c_c div").append('<p class="err_mess">There seems to be an Error: <a href="#close" class="close_pirobox">Close Pirobox</a></p>');a(".close_pirobox").bind("click",function(){a(".err_mess").remove();l.add(p).fadeOut(b.close_speed);l.removeClass("loading");a(".c_c").append(r);return false})};C.onload=function(){var M=C.height;var O=C.width;var L=a(l).height();var Q=a(window).height();var K=a(window).width();if(M+100>Q||O+100>K){var J=O;var P=M;var R=(O+250)/K;var N=(M+250)/Q;if(N>R){J=Math.round(O*(1/N));P=Math.round(M*(1/N))}else{J=Math.round(O*(1/R));P=Math.round(M*(1/R))}M+=P;O+=J;a(C).height(P).width(J).hide();a(".c_c div").animate({height:P+"px",width:J+"px"},b.my_speed);l.animate({height:(P+20)+"px",width:(J+20)+"px",marginLeft:"-"+((J)/2+10)+"px",marginTop:parseInt(a(document).scrollTop())-(P/1.9)-20},b.my_speed,function(){a(".piro_nav,.caption").css({width:(J)+"px"});a(".piro_nav").css("margin-left","-"+(J+5)/2+"px");var S=w.height();w.css({bottom:"-"+(S+5)+"px"});a(".c_c div").append(C);t.css("display","block");k.add(j).add(t).css("visibility","visible");w.css({visibility:"visible",display:"block"});a(C).show().fadeIn(300);l.removeClass("loading");if(b.slideShow=="slideshow"){r.add(n).show()}else{r.add(n).hide()}})}else{a(C).height(M).width(O).hide();a(".c_c div").animate({height:M+"px",width:O+"px"},b.my_speed);l.animate({height:(M+20)+"px",width:(O+20)+"px",marginLeft:"-"+((O)/2+10)+"px",marginTop:parseInt(a(document).scrollTop())-(M/1.9)-20},b.my_speed,function(){a(".piro_nav,.caption").css({width:(O)+"px"});a(".piro_nav").css("margin-left","-"+(O+5)/2+"px");var S=w.height();w.css({bottom:"-"+(S+5)+"px"});a(".c_c div").append(C);t.css("display","block");k.add(j).add(t).css("visibility","visible");w.css({visibility:"visible",display:"block"});a(C).fadeIn(300);l.removeClass("loading");if(b.slideShow=="slideshow"){r.add(n).show()}else{r.add(n).hide()}})}};C.src=H;var i=a(window).height();var F=a(".piro_prev_out").height();a(".piro_prev_out").add(".piro_next_out").css({marginTop:parseInt(a(document).scrollTop())+(i/F-125)});a(".caption p").css({"-moz-border-radius":b.radius+"px","-khtml-border-radius":b.radius+"px","-webkit-border-radius":b.radius+"px","border-radius":b.radius+"px"});n.bind("click",function(J){J.preventDefault();clearTimeout(I);a(m).children().removeAttr("class");a(".stop").remove();a(".c_c").append(r);k.add(j).css("width",e+"px")});r.bind("click",function(J){J.preventDefault();clearTimeout(I);if(a(C).is(":visible")){a(m).children().addClass(b.slideShow);a(".play").remove();a(".c_c").append(n)}k.add(j).css({width:"0px"});return E()});a(b.close_all).bind("click",function(J){clearTimeout(I);if(a(C).is(":visible")){J.preventDefault();t.add(p).add(l).add(w).add(k).add(j).fadeOut(b.close_speed);l.removeClass("loading");a(m).children().removeAttr("class");k.add(j).css("width",e+"px").hide();a(".stop").remove();a(".c_c").append(r);r.hide()}});function E(){clearTimeout(I);if(a(m).filter(".item").is(".last")){a(m).children().removeAttr("class");k.add(j).css("width",e+"px");a(".stop").remove();a(".c_c").append(r);r.hide()}else{if(a(m).children().is("."+b.slideShow)){k.click()}}}var I=setInterval(E,b.slideSpeed*1000);a().bind("keydown",function(J){if(J.keyCode===27){J.preventDefault();if(a(C).is(":visible")||a(".c_c>div>p>a").is(".close_pirobox")){t.add(p).add(l).add(w).add(k).add(j).fadeOut(b.close_speed);l.removeClass("loading");clearTimeout(I);a(m).children().removeAttr("class");a(".stop").remove();a(".c_c").append(r);k.add(j).css("width",e+"px");a(m).add(z).children().fadeTo(100,1)}}}).bind("keydown",function(J){if(a(".c_c").is(".unique")||a(".item").is(".first")){}else{if(a(".c_c").is(".c_c")&&(J.keyCode===37)){J.preventDefault();if(a(C).is(":visible")){clearTimeout(I);a(m).children().removeAttr("class");a(".stop").remove();a(".c_c").append(r);k.add(j).css("width",e+"px");j.click()}}}if(a(".c_c").is(".unique")||a(".item").is(".last")){}else{if(a(".c_c").is(".c_c")&&(J.keyCode===39)){J.preventDefault();if(a(C).is(":visible")){clearTimeout(I);a(m).children().removeAttr("class");a(".stop").remove();a(".c_c").append(r);k.add(j).css("width",e+"px");k.click()}}}});a.browser.msie6=(a.browser.msie&&/MSIE 6\.0/i.test(window.navigator.userAgent));if(a.browser.msie6&&!/MSIE 8\.0/i.test(window.navigator.userAgent)){a(".t_l,.t_c,.t_r,.c_l,.c_r,.b_l,.b_c,.b_r,a.piro_next, a.piro_prev,a.piro_prev_out,a.piro_next_out,.c_c,.piro_close,a.play,a.stop").fixPNG();var D=a(document).height();p.css("height",D+"px")}if(a.browser.msie){b.close_speed=0}function G(){if(a(l).is(":visible")){window.onscroll=function(){var L=a(l).height();l.css({marginTop:parseInt(a(this).scrollTop())-(L/1.9)-10});var J=a(window).height();var K=a(".piro_prev_out").height();a(".piro_prev_out").add(".piro_next_out").css({marginTop:parseInt(a(document).scrollTop())+(J/K-125)})}}}if(b.scrollImage==true){return G()}}}c()}})(jQuery);
| + | |
- |
| + | |
- |
| + | |
- | </script><div class="content_box_wrapper">
| + | |
| <div class="content_box"> | | <div class="content_box"> |
| | | |
Line 666: |
Line 104: |
| </ul> | | </ul> |
| </div> | | </div> |
| + | <script type="text/javascript"> |
| + | /*! |
| + | * slideViewerPro 1.0 |
| + | * Examples and documentation at: |
| + | * http://www.gcmingati.net/wordpress/wp-content/lab/jquery/svwt/ |
| + | * 2009 Gian Carlo Mingati |
| + | * Version: 1.0.4 (12-AUGUST-2009) |
| + | * 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.3.2 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("<img src='images/svwloader.gif' class='ldrgif' alt='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: "#ff0000", |
| + | thumbsBorderColor: "#d8d8d8", |
| + | thumbsActiveBorderColor: "#ff0000", |
| + | buttonsTextColor: "#ff0000", |
| + | 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: 5, |
| + | thumbsPercentReduction: 12, |
| + | thumbsVis: true, |
| + | easeFunc: "easeInOutExpo", |
| + | leftButtonInner: "-", //could be an image "<img src='images/larw.gif' />" 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").attr("width"); |
| + | var pictHeight = container.find("img").attr("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("<div style='width:"+ pictWidth +"px; overflow: hidden; position: relative; top: 0; left: 0'>")); |
| + | 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("<span class='typo' style='position: absolute; width:"+(pictWidth-12)+"px; margin: 0 0 0 -"+pictWidth+"px'>"+jQuery(this).attr("alt")+"<\/span>"); |
| + | }); |
| + | } |
| + | jQuery(this).after("<div class='thumbSlider' id='thumbSlider" + j + "'><ul><\/ul><\/div>"); |
| + | jQuery(this).next().after("<a href='#' class='left' id='left" + j + "'><span>"+settings.leftButtonInner+"</span><\/a><a href='#' class='right' id='right" + j + "'><span>"+settings.rightButtonInner+"<\/span><\/a>"); |
| + | |
| + | jQuery(this).find("li").each(function(n) { |
| + | jQuery("div#thumbSlider" + j + " ul").append("<li><a title='" + jQuery(this).find("img").attr("alt") + "' href='#'><img width='"+ thumbsWidth +"' height='"+ thumbsHeight +"' src='" + jQuery(this).find("img").attr("src") + "' /><p class='tmbrdr'> <\/p><\/a><\/li>"); |
| + | }); |
| + | |
| + | jQuery("div#thumbSlider" + j + " a").each(function(z) { |
| + | jQuery(this).bind("click", function(){ |
| + | jQuery(this).find("p.tmbrdr").css({borderColor: settings.thumbsActiveBorderColor, opacity: settings.thumbsActiveBorderOpacity}); |
| + | jQuery(this).parent().parent().find("p.tmbrdr").not(jQuery(this).find("p.tmbrdr")).css({borderColor: settings.thumbsBorderColor, opacity: settings.thumbsBorderOpacity}); |
| + | var cnt = -(pictWidth*z); |
| + | (cnt != container.find("ul").css("left").replace(/px/, "")) ? container.find("span.typo").animate({"opacity": 0}, 250) : null ; |
| + | container.find("ul").animate({ left: cnt}, settings.easeTime, settings.easeFunc, function(){container.find("span.typo").animate({"opacity": settings.typoFullOpacity}, 250)}); |
| + | return false; |
| + | }); |
| + | }); |
| + | // shortcuts to +/- buttons |
| + | var jQuerybtl = jQuery("a#left" + j); |
| + | var jQuerybtr = jQuery("a#right" + j); |
| + | |
| + | // right/left |
| + | jQuerybtr.bind("click", function(){ |
| + | if (r_enabled) (pictEls-pos > settings.thumbs*2 || pictEls%settings.thumbs == 0)? pos += settings.thumbs : pos += pictEls % settings.thumbs; |
| + | r_enabled = false; |
| + | jQuery(this).prev().prev().find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();}); |
| + | return false; |
| + | }); |
| + | jQuerybtl.bind("click", function(){ |
| + | if (l_enabled && pos!=0) (pictEls-pos > settings.thumbs || pictEls%settings.thumbs == 0)? pos -= settings.thumbs : pos -= pictEls % settings.thumbs; |
| + | l_enabled = false; |
| + | jQuery(this).prev().find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();}); |
| + | return false; |
| + | }); |
| + | |
| + | function authorityMixing() |
| + | { |
| + | |
| + | //right btt |
| + | (pos == pictEls-settings.thumbs) ? jQuerybtr.addClass("r_dis") : jQuerybtr.removeClass("r_dis"); |
| + | (pos == pictEls-settings.thumbs) ? r_enabled = false : r_enabled = true; |
| + | //left btt |
| + | (pos == 0) ? jQuerybtl.addClass("l_dis") : jQuerybtl.removeClass("l_dis"); |
| + | (pos == 0) ? l_enabled = false : l_enabled = true; |
| + | } |
| + | |
| + | //CSS defs @ runtime |
| + | var tBorder = settings.thumbsBorderWidth; |
| + | var contBorder = settings.galBorderWidth |
| + | |
| + | jQuery(".slideViewer a img").css({border: "0"}); |
| + | if(settings.typo) |
| + | { |
| + | jQuery(this).find("span.typo").each(function(z) { |
| + | jQuery(this).css({marginTop: (pictHeight-jQuery(this).innerHeight()), opacity: settings.typoFullOpacity}); |
| + | }); |
| + | } |
| + | jQuery("div#svwp"+ j).css({border: settings.galBorderWidth +"px solid "+settings.galBorderColor}); |
| + | |
| + | jQuery("div#thumbSlider" + j).css({position: "relative", left: contBorder, top: settings.thumbsTopMargin+"px", width: settings.thumbs*thumbsWidth+((settings.thumbsRightMargin*settings.thumbs)-settings.thumbsRightMargin), height: thumbsHeight, textAlign: "center", overflow: "hidden", margin: "0 auto"}); |
| + | jQuery("div#thumbSlider" + j + " ul").css({width: (thumbsWidth*pictEls)+settings.thumbsRightMargin*pictEls, position: "relative", left: "0", top: "0"}); |
| + | jQuery("div#thumbSlider" + j + " ul li").css({marginRight: settings.thumbsRightMargin}); |
| + | |
| + | jQuery("div#thumbSlider" + j).find("p.tmbrdr").css({width: (thumbsWidth-tBorder*2)+"px", height: (thumbsHeight-tBorder*2) +"px", top: -(thumbsHeight) +"px", border: settings.thumbsBorderWidth +"px solid "+settings.thumbsBorderColor, opacity: settings.thumbsBorderOpacity}); |
| + | jQuery("div#thumbSlider" + j + " a:first p.tmbrdr").css({borderColor: settings.thumbsActiveBorderColor, opacity: settings.thumbsActiveBorderOpacity}); |
| + | |
| + | var rbttLeftMargin = (pictWidth/2) + (jQuery("div#thumbSlider" + j).width()/2) + settings.thumbsRightMargin + contBorder; |
| + | var lbttLeftMargin = (pictWidth/2) - (jQuery("div#thumbSlider" + j).width()/2) - (settings.buttonsWidth + settings.thumbsRightMargin) + contBorder; |
| + | var innerImgH = jQuery("a#right" + j + " span img").attr("height"); |
| + | |
| + | jQuery("a#left" + j).css({display: "block", textAlign: "center", width: settings.buttonsWidth + "px" , height: thumbsHeight+"px", margin: -(thumbsHeight-settings.thumbsTopMargin) +"px 0 0 "+lbttLeftMargin+"px", textDecoration: "none", lineHeight: thumbsHeight+"px", color: settings.buttonsTextColor}); |
| + | jQuery("a#right" + j).css({display: "block", textAlign: "center", width: settings.buttonsWidth + "px", height: thumbsHeight+"px" , margin: -(thumbsHeight) +"px 0 0 "+rbttLeftMargin+"px", textDecoration: "none", lineHeight: thumbsHeight+"px", color: settings.buttonsTextColor}); |
| + | jQuery("a#left" + j + " span img").css({margin: Math.round((thumbsHeight/2)-(innerImgH/2))+"px 0 0 0"}); |
| + | jQuery("a#right" + j + " span img").css({margin: Math.round((thumbsHeight/2)-(innerImgH/2))+"px 0 0 0"}); |
| + | |
| + | authorityMixing(); |
| + | |
| + | if(settings.autoslide){ |
| + | |
| + | var i = 1; |
| + | |
| + | jQuery("div#thumbSlider" + j).everyTime(settings.asTimer, "asld", function() { |
| + | jQuery(this).find("a").eq(i).trigger("click"); |
| + | if(i == 0) |
| + | { |
| + | pos = 0; |
| + | l_enabled = false; |
| + | jQuery("div#thumbSlider" + j).find("ul:not(:animated)").animate({ left: -(thumbsWidth+settings.thumbsRightMargin)*pos}, 500, settings.easeFunc, function(){authorityMixing();}); |
| + | } |
| + | else l_enabled = true; |
| + | |
| + | (i%settings.thumbs == 0)? jQuery(this).next().next().trigger("click") : null; |
| + | (i < pictEls-1)? i++ : i=0; |
| + | }); |
| + | |
| + | //stops autoslidemode |
| + | jQuery("a#right" + j).bind("mouseup", function(){ |
| + | jQuery(this).prev().prev().stopTime("asld"); |
| + | }); |
| + | jQuery("a#left" + j).bind("mouseup", function(){ |
| + | jQuery(this).prev().stopTime("asld"); |
| + | }); |
| + | jQuery("div#thumbSlider" + j + " a").bind("mouseup", function(){ |
| + | jQuery(this).parent().parent().parent().stopTime("asld"); |
| + | }); |
| + | } |
| + | var uiDisplay = (settings.thumbsVis)? "block":"none"; |
| + | jQuery("div#thumbSlider" + j + ", a#left" + j + ", a#right" + j).wrapAll("<div style='width:"+ pictWidth +"px; display: "+uiDisplay+"' id='ui"+j+"'><\/div>"); |
| + | jQuery("div#svwp"+ j + ", div#ui" + j).wrapAll("<div style='width:"+ pictWidth +"px'><\/div>"); |
| + | }); |
| + | (jQuery("div#thumbSlider" + j).width()+(settings.buttonsWidth*2) >= pictWidth)? alert("ALERT: THE THUMBNAILS SLIDER IS TOO WIDE! \nthumbsPercentReduction and/or buttonsWidth needs to be scaled down!") : null; |
| + | j++; |
| + | }); |
| + | }; |
| + | jQuery.fn.extend({ |
| + | everyTime: function(interval, label, fn, times, belay) { |
| + | return this.each(function() { |
| + | jQuery.timer.add(this, interval, label, fn, times, belay); |
| + | }); |
| + | }, |
| + | oneTime: function(interval, label, fn) { |
| + | return this.each(function() { |
| + | jQuery.timer.add(this, interval, label, fn, 1); |
| + | }); |
| + | }, |
| + | stopTime: function(label, fn) { |
| + | return this.each(function() { |
| + | jQuery.timer.remove(this, label, fn); |
| + | }); |
| + | } |
| + | }); |
| + | |
| + | jQuery.extend({ |
| + | timer: { |
| + | guid: 1, |
| + | global: {}, |
| + | regex: /^([0-9]+)\s*(.*s)?$/, |
| + | powers: { |
| + | // Yeah this is major overkill... |
| + | 'ms': 1, |
| + | 'cs': 10, |
| + | 'ds': 100, |
| + | 's': 1000, |
| + | 'das': 10000, |
| + | 'hs': 100000, |
| + | 'ks': 1000000 |
| + | }, |
| + | timeParse: function(value) { |
| + | if (value == undefined || value == null) |
| + | return null; |
| + | var result = this.regex.exec(jQuery.trim(value.toString())); |
| + | if (result[2]) { |
| + | var num = parseInt(result[1], 10); |
| + | var mult = this.powers[result[2]] || 1; |
| + | return num * mult; |
| + | } else { |
| + | return value; |
| + | } |
| + | }, |
| + | add: function(element, interval, label, fn, times, belay) { |
| + | var counter = 0; |
| + | |
| + | if (jQuery.isFunction(label)) { |
| + | if (!times) |
| + | times = fn; |
| + | fn = label; |
| + | label = interval; |
| + | } |
| + | |
| + | interval = jQuery.timer.timeParse(interval); |
| + | |
| + | if (typeof interval != 'number' || isNaN(interval) || interval <= 0) |
| + | return; |
| + | |
| + | if (times && times.constructor != Number) { |
| + | belay = !!times; |
| + | times = 0; |
| + | } |
| + | |
| + | times = times || 0; |
| + | belay = belay || false; |
| + | |
| + | if (!element.$timers) |
| + | element.$timers = {}; |
| + | |
| + | if (!element.$timers[label]) |
| + | element.$timers[label] = {}; |
| + | |
| + | fn.$timerID = fn.$timerID || this.guid++; |
| + | |
| + | var handler = function() { |
| + | if (belay && this.inProgress) |
| + | return; |
| + | this.inProgress = true; |
| + | if ((++counter > times && times !== 0) || fn.call(element, counter) === false) |
| + | jQuery.timer.remove(element, label, fn); |
| + | this.inProgress = false; |
| + | }; |
| + | |
| + | handler.$timerID = fn.$timerID; |
| + | |
| + | if (!element.$timers[label][fn.$timerID]) |
| + | element.$timers[label][fn.$timerID] = window.setInterval(handler,interval); |
| + | |
| + | if ( !this.global[label] ) |
| + | this.global[label] = []; |
| + | this.global[label].push( element ); |
| + | |
| + | }, |
| + | remove: function(element, label, fn) { |
| + | var timers = element.$timers, ret; |
| + | |
| + | if ( timers ) { |
| + | |
| + | if (!label) { |
| + | for ( label in timers ) |
| + | this.remove(element, label, fn); |
| + | } else if ( timers[label] ) { |
| + | if ( fn ) { |
| + | if ( fn.$timerID ) { |
| + | window.clearInterval(timers[label][fn.$timerID]); |
| + | delete timers[label][fn.$timerID]; |
| + | } |
| + | } else { |
| + | for ( var fn in timers[label] ) { |
| + | window.clearInterval(timers[label][fn]); |
| + | delete timers[label][fn]; |
| + | } |
| + | } |
| + | |
| + | for ( ret in timers[label] ) break; |
| + | if ( !ret ) { |
| + | ret = null; |
| + | delete timers[label]; |
| + | } |
| + | } |
| + | |
| + | for ( ret in timers ) break; |
| + | if ( !ret ) |
| + | element.$timers = null; |
| + | } |
| + | } |
| + | } |
| + | }); |
| + | |
| + | if (jQuery.browser.msie) |
| + | jQuery(window).one("unload", function() { |
| + | var global = jQuery.timer.global; |
| + | for ( var label in global ) { |
| + | var els = global[label], i = els.length; |
| + | while ( --i ) |
| + | jQuery.timer.remove(els[i], label); |
| + | } |
| + | }); |
| + | |
| + | |
| + | |
| + | |
| + | </script> |
| <script type="text/javascript"> | | <script type="text/javascript"> |
| $("div#featuredslideshow").slideViewerPro({ | | $("div#featuredslideshow").slideViewerPro({ |