API Documentation
Event Functions
-
scroll( params = {} ): {object}
- description: The scroll event fires when the document view or an element has been scrolled.
- Parameters:
- params:
- name: params
- Description: The parameters
- type: object
- optional: true
- default: {object}
-
Example:
event.scroll({ indicator: '90%', duration: '60%', debug: false }).fromTo({ color: '#FFF' }, { color: '#999' })
- params:
-
mousemove(): {object}
- description: The mousemove function occurs when the mouse move over the selected element.
- Parameters:
-
Example:
event.mousemove().fromTo({ color: '#FFF' }, { color: '#999' })
-
Example:
-
click(): {object}
- description: Execute a JavaScript when moving the mouse pointer onto an image:
- Parameters:
-
Example:
event.click().fromTo({ color: '#FFF' }, { color: '#999' })
-
Example:
-
hover(): {object}
- description: The hover function occurs when the mouse pointer is over the selected element.
- Parameters:
-
Example:
event.hover().fromTo({ color: '#FFF' }, { color: '#999' })
-
Example:
Action Functions
-
call( {function} callback, {boolean} instance ): {object}
- description: call function
- Parameters:
- callback:
- type: object
- name: callback
- optional: true
- default: {function}
- Description: callback function. you can pass three parameters to the callback function (progress from 0 to 1, event source, events target)
- instance:
- type: boolean
- name: instance
- optional: true
- default: {boolean}
- Description: set instance to true if you want to return current instance
-
Example:
event.call(p => document.querySelector('.class').style.top(`${p}px`))
- callback:
-
fromTo( scrollEventFrom = {}, scrollEventTo = {} ): {object}
- description: (From/To) function description
- Parameters:
- param:
- type: object
- name: params
- optional: true
- default: {object}
- Description: The parameters
-
Example:
event.fromTo({ color: '#FFF' }, { color: '#999' })
- param:
Easing (Optional)
-
easing( params = {} ): {object}
- description: easing function description
- Parameters:
- params:
- type: object
- name: params
- optional: true
- default: {object}
- Description: The parameters
-
Example:
event.click().fromTo({ color: '#FFF' }, { color: '#999' }).easing({ timing: 'linear', duration: 0.5, delay: 0, cubicBezier: false})
- params: