πŸ”” 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