Mercurial > hg > Members > kaito > slides
comparison before_s6/2014/2014_01_21/s6_trunk/js/jquery.slideshow.transition.js @ 5:ab2d529bb1d7
add slide
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 14 Oct 2014 19:17:35 +0900 |
parents | 2014/2014_01_21/s6_trunk/js/jquery.slideshow.transition.js@bcf1ede39faa |
children |
comparison
equal
deleted
inserted
replaced
4:10fb2b05e390 | 5:ab2d529bb1d7 |
---|---|
1 | |
2 function transition( $from, $to ) { | |
3 $from.hide(); | |
4 $to.show(); | |
5 } | |
6 | |
7 function transitionSlideUpSlideDown( $from, $to ) { | |
8 $from.slideUp( 500, function() { $to.slideDown( 1000 ); } ); | |
9 } | |
10 | |
11 function transitionFadeOutFadeIn( $from, $to ) { | |
12 $from.fadeOut( 500 ); | |
13 $to.fadeIn( 500 ); | |
14 } | |
15 | |
16 /*********************** | |
17 * sample custom transition using scrollUp effect | |
18 * inspired by Karl Swedberg's Scroll Up Headline Reader jQuery Tutorial[1] | |
19 * [1] http://docs.jquery.com/Tutorials:Scroll_Up_Headline_Reader | |
20 */ | |
21 | |
22 function transitionScrollUp( $from, $to ) { | |
23 var cheight = $from.outerHeight(); | |
24 | |
25 // hide scrollbar during animation | |
26 $( 'body' ).css( 'overflow-y', 'hidden' ); | |
27 | |
28 $to.css( 'top', cheight+'px' ); | |
29 $to.show(); | |
30 | |
31 $from.animate( {top: -cheight}, 'slow' ); | |
32 $to.animate( {top: 0}, 'slow', function() { | |
33 $from.hide().css( 'top', '0px'); | |
34 | |
35 // restore possible scrollbar | |
36 $( 'body' ).css( 'overflow-y', 'auto' ); | |
37 }); | |
38 } |