Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- // Define new scrolling function
- $.fn.cycle.transitions.scrollHorzRev = function($cont, $slides, opts) {
- $cont.css('overflow','hidden').width();
- opts.before.push(function(curr, next, opts, fwd) {
- if (opts.rev)
- fwd = !fwd;
- $.fn.cycle.commonReset(curr,next,opts);
- opts.cssBefore.left = fwd ? (1-next.cycleW) : (next.cycleW-1);
- opts.animOut.left = fwd ? curr.cycleW : -curr.cycleW;
- });
- var w = $cont.width();
- opts.cssFirst.left = 0;
- opts.cssBefore.top = 0;
- opts.animIn.left = 0;
- opts.animOut.top = 0
- };
- // Initiate sliders
- $('.slideHeadlines .slides').cycle({
- fx: 'scrollHorzRev',
- prev: '.sliderPrev',
- next: '.sliderNext',
- timeout: 0,
- pause: true
- });
- $('.slideCaptions .slides, .slideImages .slides').cycle({
- fx: 'scrollHorz',
- prev: '.sliderPrev',
- next: '.sliderNext',
- timeout: 0,
- pause: true
- });
- var slideInterval = 5000;
- function nextHeroSlide() { $('.slides').cycle('next') };
- var heroSlideInterval = setInterval(nextHeroSlide,slideInterval);
- // Fade slider nav
- $('.hero').hover(function() {
- $('.sliderNav a').fadeIn();
- clearInterval(heroSlideInterval);
- },
- function() {
- $('.sliderNav a').fadeOut();
- var heroSlideInterval = setInterval(nextHeroSlide,slideInterval)
- }
- )
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement