-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathscrollreveal.javascript.txt
33 lines (30 loc) · 2.26 KB
/
scrollreveal.javascript.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
┏━━━━━━━━━━━━━━━━━━┓
┃ SCROLLREVEAL ┃
┗━━━━━━━━━━━━━━━━━━┛
new scrollReveal([OBJ]) #Makes HTML tags with attribute data-sr appear|disappear on scroll.
#Returns SCROLLREVEAL
#Version 2.1.0
#OBJ:
# - enter, move, scale.direction|power, wait, over, easing, reset: see below.
# Def: bottom, 8px, up|5%, 0s, 0.6s, ease, false
# - opacity DOUBLE (def: 0): starting opacity
# - mobile BOOL (def: false): mobile-friendly. Can be buggy
# - viewport ELEM (def: document): container
# - delay "always|once|onload": when to do "wait" (def: "once")
# - vFactor NUM (def: 0.6): how much percentage of the element in the viewport to be
# considered "in"
# - complete(ELEM)
#See also angular-ui scrollfix, which adds class according to scrolling of a parent element.
data-sr="FUNC[ VAL...] #Specifies custom animation.
[ ...]" #FUNC VAL... can be:
# - enter left|right|top|bottom: direction
# - move LENP: move element
# - scale up|down LENP: change size
# - wait NUMs
# - over NUMs: duration
# - ease[-in][-out]|hustle LENP: easing
# - no reset: do only once
FOX-ANGULAR-SCROLLREVEAL ==> #Angular directive (version 1.0.0)
#DIRECTIVE: data-sr-container[="OBJ_EXPR"] (calls scrollReveal([OBJ]))
#Children must have data-sr (like without Angular)
#Emits events scrollReveal.init|created