mithril-parallax
Move target inside a zone on window scroll.
Usage
var Styles = heading: position: 'relative' target: bottom: 0 left: 0 position: 'absolute' right: 0 width: '100%' zone: height: '50vh' overflow: 'hidden' position: 'relative' ; { return elemchildren0;} { return pCtrlwindowHeight * 2;} ;
See index.html and index.js for another example.
Notes
-
power
can be negative, try it withtop: 0
instead ofbottom: 0
inStyles.target
-
offset
defaults to0
-
style
is optional, you can write CSS for.mpx-zone
instead -
target
defaults to first child
License
MIT