$(function() { var $test1 = $('#test1'), $test2 = $('#test2'), $test3 = $('#test3'), $test4 = $('#test4'), $caption = $('div.caption'), $pause = $('#pause'), $resume = $('#resume'), $freeze = $('#freeze'), $stop = $('#stop'), $restart = $('#restart'), STOP = 1, RUN = 2, PAUSE = 3; /* $test1.crossSlide({ sleep: 2, fade: 1 }, [ { src: '../imagenes/big/big1.JPG' }, { src: '../imagenes/big/big2.JPG' }, { src: '../imagenes/big/big3.JPG' }, { src: '../imagenes/big/big4.JPG' } ]); $test2.crossSlide({ speed: 45, fade: 1 }, [ { src: 'sand-castle.jpeg', dir: 'up' }, { src: 'sunflower.jpeg', dir: 'down' }, { src: 'flip-flops.jpeg', dir: 'up' }, { src: 'rubber-ring.jpeg', dir: 'down' } ]); */ $test3.crossSlide({ sleep: 2, fade: 1 }, [ { src: '../archivos/sliders/20120830-9470.jpg' }, { src: '../archivos/sliders/20120830-1413.jpg' }, { src: '../archivos/sliders/20120830-3230.jpg' }, { src: '../archivos/sliders/20120830-2937.jpg' } ], function(idx, img, idxOut, imgOut) { if (idxOut == undefined) { $caption.text(img.alt).animate({ opacity: .7 }) } else { $caption.animate({ opacity: 0 }) } }); $caption.show().css({ opacity: 0 }) function state(state) { $pause.attr('disabled', state != RUN); $resume.attr('disabled', state != PAUSE); $freeze.attr('disabled', state == STOP); $stop.attr('disabled', state == STOP); } state(RUN); $pause.click(function() { $test3.crossSlidePause(); state(PAUSE); }); $resume.click(function() { $test3.crossSlideResume(); state(RUN); }) $freeze.click(function() { $test3.crossSlideFreeze(); state(STOP); }); $stop.click(function() { $test3.crossSlideStop(); $caption.css({ opacity: 0 }) state(STOP); }); $restart.click(function() { $test3.crossSlideRestart(); state(RUN); }); /* $test4.crossSlide({ fade: 1, variant: true, easing: 'easeInOutQuad' }, [ { src: 'sand-castle.jpeg', from: '100% 80% 1x', to: '100% 0% 1.5x', time: 4 }, { src: 'sunflower.jpeg', from: 'top left', to: 'bottom right 1.5x', time: 4 }, { src: 'flip-flops.jpeg', from: '100% 80% 1.5x', to: '80% 0%', time: 4 }, { src: 'rubber-ring.jpeg', from: '100% 50%', to: '30% 50% 1.5x', time: 4 } ]); */ });