超クールなスクロールアニメーションを実現してくれるjQueryプラグイン「Scrollorama」を紹介します。
jQueryプラグイン「Scrollorama」
ページをスクロールすると指定したオプションに応じて、テキストにアニメーションを付加するプラグインです。
アニメーションが多彩で、テキストが横から流れてきたり、くるくるまわったり、文字が大きくなったり……といった「It's Cool!」なプラグインです。
まずは、デモをご覧ください。デモページを下にスクロールするとテキストが映画の予告並みに動きます。まるで、jQueryプラグイン界暴れん坊ですね。特設サイトなどにおすすめかも。
「Scrollorama」のデモ
デモのソース(HTML + jQuery)
< meta name = "description" content = "scrollorama のデモでーす。" > |
< title >scrollorama - jQuery Plugin Demo</ title > |
< link rel = "stylesheet" href = "css/normalize.css" type = "text/css" > |
< link rel = "stylesheet" href = "css/style.css" type = "text/css" > |
< script src = "js/jquery-1.7.1.min.js" ></ script > |
< script src = "js/jquery.lettering-0.6.1.min.js" ></ script > |
< script src = "js/jquery.scrollorama.js" ></ script > |
$(document).ready(function() { |
var scrollorama = $.scrollorama({ blocks:'.scrollblock' }); |
scrollorama.onBlockChange(function() { |
$('.char9').css('padding-left','6px'); |
scrollorama.animate('#title',{ duration: 300, property:'zoom', end: 8 }); |
scrollorama.animate('#author',{ duration: 10, property:'z-index', end: 0 }); |
$('#title span').each(function() { |
scrollorama.animate($(this),{ duration: 400, property:'top', end: Math.random()*120-180 }); |
scrollorama.animate($(this),{ duration: 300, property:'rotate', start:0, end:Math.random()*720-360 }); |
scrollorama.animate('#fade-in',{ delay: 400, duration: 300, property:'opacity', start:0 }); |
scrollorama.animate('#fly-in',{ delay: 400, duration: 300, property:'left', start:-1400, end:0 }); |
scrollorama.animate('#rotate-in',{ duration: 800, property:'rotate', start:720 }); |
scrollorama.animate('#zoom-in',{ delay: 200, duration: 600, property:'zoom', start:8 }); |
< p >< a href = "https://webkaru.net/jquery-plugin/scrollorama/" >「jQueryプラグインまとめ」に戻る</ a ></ p > |
< div style = "height:2000px;" > |
< div class = "scrollblock" id = "intro" > |
< h1 id = "title" >scrolloramaのデモでーす。</ h1 > |
< p id = "author" >下にスクロールすると……。</ p > |
< div class = "scrollblock" id = "examples-transition" > |
< h3 id = "fade-in" >ふぇいどい~ん!</ h3 > |
< h3 id = "fly-in" >飛んで 飛んで 飛んで♪</ h3 > |
< h3 id = "rotate-in" >廻って 廻って 廻る~♪</ h3 > |
< h3 id = "zoom-in" >でっかくなっちゃた!</ h3 > |
その他オプションや詳細はこちらからどうぞ。