/* * jQuery Infinite Carousel * @author admin@catchmyfame.com - http://www.catchmyfame.com * @version 3.0.2 * @date February 2, 2012 * @category jQuery plugin * @copyright (c) admin@catchmyfame.com (www.catchmyfame.com) * @license CC Attribution-Share Alike 3.0 - http://creativecommons.org/licenses/by-sa/3.0/ */ $(window).load(function(){ $("#carousel ul").infiniteCarousel({ imagePath: '/templates/buis_event/javascript/infinitecarousel/images/', transitionSpeed: 450, displayTime: 4000, internalThumbnails: false, thumbnailType: 'none', customClass: 'myCarousel', progressRingColorOpacity: '0,0,0,.5', progressRingBackgroundOn: false, easeLeft: 'easeOutExpo', easeRight:'easeOutQuad', inView: 1, advance: 1, autoPilot: true, prevNextInternal: true, autoHideCaptions: false }); checkMainPageHeight(); }); (function($){ $.fn.extend({ infiniteCarousel: function(options) { var defaults = { transitionSpeed: 800, displayTime: 6000, displayProgressRing: true, progressRingColorOpacity: '0,0,0,.5', progressRingBackgroundOn: true, progressRingBackgroundColorOpacity: '255,255,255,.5', thumbnailType: 'none', // buttons, images, numbers, count, or none easeLeft: 'linear', easeRight: 'linear', imagePath: '/js/infinitecarousel/images/', inView: 1, margin: 0, advance: 1, customClass: null, showControls: true, autoHideCaptions: false, autoPilot: false, prevNextInternal: true, internalThumbnails: false, enableKeyboardNav: true, onSlideStart: function(){}, onSlideEnd: function(){}, onPauseClick: function(){}, onPlayClick: function(){} }; var options = $.extend(defaults, options); return this.each(function() { var o=options; var obj = $(this); var randID = Math.round(Math.random()*100000000); var numItems = $('li', obj).length; // Number of items var captions=[]; // captions array var links=[]; // links array var itemSources=[]; // sources array var vidThumb=[]; // video thumbnails (supplied by the longdesc attribute in the iframe) var widthSource,heightSource; // width and height of each item var nextLeft,nextRight; // pointers to the next array index for moving left and right var clrTimerInterval; // interval handle variable for timer and autoPilot var u,elapsedTime=0; var canvasSupported = "HTMLCanvasElement" in window; $('li',obj).each(function(index){ // populate arrays captions.push( $('span',this).html().replace(/~/g,"
") ); links.push( $('a',this).attr('href') ); vidThumb.push( $(this).find('iframe').attr('longdesc') ); itemSources.push( $(this).find('img, iframe').attr('src') ); // finds images and youtube and vimeo iframe sources }); // Check for improper values in inview and advance if(o.inView > numItems) o.inView = numItems; // Prevent trying to view more images than given if(o.advance > o.inView) o.advance = o.inView; // Prevent advancing more than inView images at a time // Dimensions should be set explicitly on the items so that we don't have to defer loading code until the images are loaded widthSource = $(this).find('img, iframe').width(); heightSource = $(this).find('img, iframe').height(); // Build carousel container $(obj).replaceWith('
'); // Kick the list and its content to the curb and replace with a div obj=$('#ic_'+randID); // Reassign the new div as our obj $(obj).height(heightSource).width(widthSource*o.inView).css({'overflow':'hidden','position':'relative'}); // Build tray to hold items and populate with item container divs. Move tray one item width to the left. $(obj).append('
'); for(var i=0;i'); // Populate the individual tray divs with items. Add links and captions where available. $('.infiniteCarousel_item',obj).each(function(index){ if(itemSources[index].indexOf('youtube.com') > 0 || itemSources[index].indexOf('vimeo.com') > 0 || itemSources[index].indexOf('funnyordie.com') > 0) { var querystring = itemSources[index].split("?"); // Need to disassemble and reassemble any querystring parameters so that we can append wmode=opaque as first parameter (see http://stackoverflow.com/questions/3820325/overlay-opaque-div-over-youtube-iframe) $(this).append('