๐Ÿ”” Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

anisview.js is a viewport checker jQuery plugin which makes use of CSS3 animations to animate any elements into view when scrolling down or up the webpage.

animatecss scroll-animation

Documentation

jquery.anisview.js

Animate.css + Viewport Checker

Animate.css ๊ธฐ๋ฐ˜์œผ๋กœ ๋ทฐํฌํŠธ์— ์—˜๋ฆฌ๋จผํŠธ๊ฐ€ ๋‚˜ํƒ€๋‚˜๋ฉด ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ๊ตฌํ˜„๋˜๋„๋ก ๋„์™€์ฃผ๋Š” ์ œ์ด์ฟผ๋ฆฌ ํ”Œ๋Ÿฌ๊ทธ์ธ์ž…๋‹ˆ๋‹ค.

Installation

Step 1: Jquery Library์™€ jquery.anisview, ๊ทธ๋ฆฌ๊ณ  Animate.css๋ฅผ ์ฒจ๋ถ€ํ•˜์„ธ์š”.

<!-- jQuery Library --> <script src="jquery.js"></script> <!-- jquery.anisview --> <script src="jquery.anisview.js"></script> <!-- Animate.css (https://github.com/daneden/animate.css) --> <link rel="stylesheet" href="animate.css">

Step 2: ํƒ€๊ฒŸ ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ์ค€๋น„ํ•˜์„ธ์š”.

<div class="target">Animation 1</div> <div class="target">Animation 2</div> <div class="target">Animation 3</div> ...

Step 3: anisview๋ฅผ ๋ถˆ๋Ÿฌ์˜ค์„ธ์š”.

Load, Scroll, Resize ์‹œ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ตฌํ˜„ํ•˜๊ณ  ์‹ถ์„ ๋•Œ

$(function() { 	$(window).on('load scroll resize', function() { 		$('.target').anisview(); 	}); });

'slideInLeft' ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ตฌํ˜„ํ•˜๊ณ  ์‹ถ์„ ๋•Œ

$(function() { 	$(window).on('load scroll resize', function() { 		$('.target').anisview({ 			animation: 'slideInLeft' 		}); 	}); });

์Šคํฌ๋กค์„ ์˜ฌ๋ฆฌ๊ณ  ๋‚ด๋ฆด ๋•Œ๋งˆ๋‹ค ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ตฌํ˜„ํ•˜๊ณ  ์‹ถ์„ ๋•Œ

$(function() { 	$(window).on('load scroll resize', function() { 		$('.target').anisview({ 			direction: 'both' 		}); 	}); }); 

์Šคํฌ๋กค ์‹œ ํ•œ ๋ฒˆ๋งŒ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ตฌํ˜„ํ•˜๊ณ  ์‹ถ์„ ๋•Œ

$(function() { 	$(window).on('load scroll resize', function() { 		$('.target').anisview({ 			repeat: false 		}); 	}); });

์Šคํฌ๋กค ์‹œ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ง€์—ฐ์‹œํ‚ค๊ณ  ์‹ถ์„ ๋•Œ

$(function() { 	$(window).on('load scroll resize', function() { 		$('.target').anisview({ 			delay: 'delay-2s' 		}); 	}); });

์Šคํฌ๋กค ์‹œ ์• ๋‹ˆ๋ฉ”์ด์…˜์˜ ์Šคํ”ผ๋“œ๋ฅผ ๋” ๋น ๋ฅด๊ฒŒ ํ•˜๊ณ  ์‹ถ์„ ๋•Œ

$(function() { 	$(window).on('load scroll resize', function() { 		$('.target').anisview({ 			speed: 'faster' 		}); 	}); });

์—ฌ๋Ÿฌ ๊ฐœ์˜ ํƒ€๊ฒŸ์— ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ตฌํ˜„ํ•˜๊ณ  ์‹ถ์„ ๋•Œ

$(function() { 	$(window).on('load scroll resize', function() { 		$('.target1').anisview({animation:'slideInLeft'}); 		$('.target2').anisview({animation:'bounce'}); 		$('.target3').anisview({animation:'zoomInLeft'}); 	}); });

Options

animation

Animate.css https://github.com/daneden/animate.css ๋ชจ๋“  ํด๋ž˜์Šค๋ช… ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉ

DEFAULT: 'fadeInLeft' OPTIONS: 'fadeInLeft', 'slideInUp', 'flipInX', 'jello', ... 

direction

์Šคํฌ๋กค์„ ๋‚ด๋ฆด ๋•Œ๋งŒ, ์˜ฌ๋ฆด ๋•Œ๋งŒ, ์˜ฌ๋ฆฌ๊ณ  ๋‚ด๋ฆด ๋•Œ๋งŒ ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ์ผ์–ด๋‚˜๊ฒŒ ํ• ์ง€ ์„ ํƒ
('up' : ์Šคํฌ๋กค์ด ์›นํŽ˜์ด์ง€ ์ตœํ•˜๋‹จ์— ๋‹ฟ์•˜์„ ๋•Œ ๋ฐœ์ƒ)

DEFAULT: 'down' OPTIONS: 'down', 'up', 'both' 

repeat

์Šคํฌ๋กค์„ ๋‚ด๋ฆฌ๊ฑฐ๋‚˜ ์˜ฌ๋ฆด ๋•Œ๋งˆ๋‹ค ๋ฐ˜๋ณต์ ์œผ๋กœ ์• ๋‹ˆ๋ฉ”์ด์…˜์ด ์ผ์–ด๋‚˜๊ฒŒ ํ• ์ง€ ์„ ํƒ

DEFAULT: true OPTIONS: true, false 

delay

์• ๋‹ˆ๋ฉ”์ด์…˜ ์ง€์—ฐ ์‹œ๊ฐ„ ์„ ํƒ(Animate.css delay ์˜ต์…˜๊ณผ ๋™์ผํ•˜๊ฒŒ ์‚ฌ์šฉ)

DEFAULT: null OPTIONS: delay-2s, delay-3s, delay-4s, delay-5s 

speed

์• ๋‹ˆ๋ฉ”์ด์…˜ ์Šคํ”ผ๋“œ ์„ ํƒ(Animate.css speed ์˜ต์…˜๊ณผ ๋™์ผํ•˜๊ฒŒ ์‚ฌ์šฉ)

DEFAULT: null OPTIONS: slow, slower, fast, faster 

You May Also Like