Pushbar.js ☕️ Buy Me A Cofee
Pushbar.js is a tiny javascript plugin for creating sliding drawers in web apps
It is fully customizable and dependency free.You can use it as sidebar menus or option drawers.
Get it

						New! [ IMPORTANT: USES HAS SLIGNT CHANGE, SEE BELOW ]
						

  1. It's now even smaller and more effitient.
  2. Code is now beautified.
  3. Added to NPM.
  4. Added to CDN.

						Installation
						

  1. Add the pushbar.css file to the head of your html. [CDN: https://cdn.jsdelivr.net/npm/pushbar.js@1.0.0/src/pushbar.min.css]
  2. Add the pushbar.js file to the head of your html or right before the closing body tag. [CDN: https://cdn.jsdelivr.net/npm/pushbar.js@1.0.0/src/pushbar.min.js]
  3. Add this code after the pushbar.js script tag to initialize the plugin.

						Example html
						


						Direction attributes [NEW]
						

You can use 4 directional attributes in pushbar elements
  1. data-pushbar-direction="left" So that the pushbar opens from left
  2. data-pushbar-direction="right" So that the pushbar opens from right
  3. data-pushbar-direction="top" So that the pushbar opens from top
  4. data-pushbar-direction="bottom" So that the pushbar opens from bottom

						Options
						

  1. blur : set it to true for blur effect on the main content (Default:false)
  2. overlay : set it to true for dark overlay effect on the main content (Default:true)

						API
						

Open and close pushbar with api

						Events
						

'pushbar_opening': when a pushbar is opening, it will emit 'pushbar_opening' event with an object { element, id }, Where element will be the current pushbar element and the id is the current pushbar id.

'pushbar_closing': when a pushbar is closing, it will emit 'pushbar_closing' event with an object { element, id }, Where element will be the current pushbar element and the id is the current pushbar id.

oncebot.com