'); var controls = { navPrev: $el.find('span.ca-nav-prev830'), navNext: $el.find('span.ca-nav-next830'), auto: $el.find('a.ca-auto830') }; // hide the items except the first 3 $wrapper.css( 'overflow', 'hidden' ); // the items will have position absolute // calculate the left of each item $items.each(function(i) { $(this).css({ position: 'absolute', left: i * cache.itemW + 'px' }); }); // navigate left controls.navPrev.bind(evt_ns.click, function( event ) { if(cache.isAnimating)return; var tmpSpeed = settings.sliderSpeed; settings.sliderSpeed = 200; if ( !aux.stopAuto( cache ) ) { if (event.ctrlKey) aux.startAuto( -1, $el, $wrapper, settings, cache ); else aux.navigate( -1, $el, $wrapper, settings, cache ); } if(settings.autoStart){ aux.startAuto(-1, $el, $wrapper, settings, cache); } settings.sliderSpeed = tmpSpeed; return false; }); // navigate right controls.navNext.bind(evt_ns.click, function( event ) { if(cache.isAnimating)return; var tmpSpeed = settings.sliderSpeed; settings.sliderSpeed = 200; if ( !aux.stopAuto( cache ) ) { if (event.ctrlKey) aux.startAuto( 1, $el, $wrapper, settings, cache ); else aux.navigate( 1, $el, $wrapper, settings, cache ); } if(settings.autoStart){ aux.startAuto(1, $el, $wrapper, settings, cache); } settings.sliderSpeed = tmpSpeed; return false; }); // add event handler to the mousewheel $el.bind(evt_ns.mousewheel, function( event, delta ) { if(cache.isAnimating)return; if (!aux.stopAuto( cache )) { aux.navigate( (delta > 0) ? -1 : 1, $el, $wrapper, settings, cache); } if(settings.autoStart){ aux.startAuto((delta > 0) ? -1 : 1, $el, $wrapper, settings, cache); } return false; }); // add event handler to an optional "auto" button controls.auto.bind(evt_ns.click, function( event ) { aux.startAuto(1, $el, $wrapper, settings, cache); return false; }); // autoStart if(settings.autoStart) { $(window).bind('load', function() { setTimeout(function() { aux.startAuto(-1, $el, $wrapper, settings, cache); }, 1000); }); } }); } } }; $.fn[pluginName] = function(method) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.' + pluginName ); } }; })(jQuery);