Giter Club home page Giter Club logo

pushbar.js's Introduction

Pushbar.js

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.

Demo

Pushbar. animated

Installation

  1. Add the pushbar.css file to the head of your html.
  2. Add the pushbar.js file to the head of your html or right before the closing body tag.
  3. Add this code after the pushbar.js script tag to initialize the plugin.
<script type="text/javascript">
  var pushbar = new Pushbar({
        blur:true,
        overlay:true,
      });
</script>
	

Example HTML

  <div data-pushbar-id="mypushbar1" class="pushbar from_left">
      Push bar content 1

      <button data-pushbar-close>Close</button>
  </div>

  <div data-pushbar-id="mypushbar2" class="pushbar from_bottom">
      Push bar content 2

      <button data-pushbar-close>Close</button>
  </div>

  <div class="pushbar_main_content">
      Main content of the page

      <button data-pushbar-target="mypushbar1">
      Open my pushbar 1
      </button>

      <button data-pushbar-target="mypushbar2">
      Open my pushbar 2
      </button>
  </div>

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

<script type="text/javascript">
  var pushbar =   new Pushbar({
        blur:true,
        overlay:true,
      });

  //open a pushbar
  pushbar.open('mypushbar1');	
  //close all pushbars
  pushbar.close();	
</script>

Emitted events

  • 'pushbar_opening': when a pushbar is opening, that pushbar element will emit this event.
  • 'pushbar_closing': when a pushbar is closing, that pushbar element will emit this event.

Oncebot

pushbar.js's People

Contributors

oncebot avatar jamsch avatar jayakrishnancn avatar

Watchers

James Cloos avatar Mohammad Nomaan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.