Skip to content

scottshane/brightspot-js-utils

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Using Bower:

bower install bsp-utils

Manually:

Usage

onDomInsert

bsp_utils.onDomInsert(String selector, Object callbacks)

Triggers the given callbacks when an element matching the given selector is inserted into the DOM. The callbacks argument can contain:

  • Function(Array or HTMLElement items) beforeInsert
  • Function(HTMLElement item) insert
  • Function(Array or HTMLElement items) afterInsert

This method is most often used to implement a plugin that works like a Web Component (demo).

plugin

See the separate plugin documentation.

throttle

bsp_utils.throttle(Number interval, Function throttledFunction)

Throttles the given throttledFunction so that it executes at most given interval (in milliseconds). This method is most often used to rate-limit noisy events like scroll (demo).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published