1.0.0 • Published 8 years ago
scale-on-scroll v1.0.0
#scaleOnScroll()
Smoothly scale an element as a function of window scroll position.
Installation
npm install scale-on-scrollUsage
const scaleOnScroll = require('scale-on-scroll')
scaleOnScroll('.box',{ startOffsetElement: '.box' })
// => optionsAPI
element
Accepts selector in the form of a string. It will be used with
document.querySelector. 
options
Accepts an object. Optional.
multiplierdefaults to0.25, scroll position is multiplied by this number, use it to control the rate of scale change based on scrollstartOffsetdefaults to0, offsets when to start scaling based on scrollstartOffsetElementdefaults tonull, pass a selector fordocument.querySelector, scaling will start upon reaching that elementscaleMaxdefaults to1, set a maximum scalescaleMindefaults to0.25, set a minimum scalethrottleTimeoutdefaults to0, if greater than 0, throttling will be used
destroy()
#scaleOnScroll() returns the options object. There is a destroy method on the
options object.
options.destroy()1.0.0
8 years ago