Minimal Code
Highly Customizable
Awesome Support
npm install @kunalnagarco/jquery-peek-a-bar --save
The simplest way to create a peek-a-bar!
var bar = new $.peekABar();
bar.show();
bar.hide();
You can use custom HTML in the bar. Click the Show Bar button to see the new HTML.
var bar = new $.peekABar();
bar.show({
html: 'Override all, puny humans!'
});
Setting autohide: true
will automatically hide the
bar after 3 seconds (default).
var bar = new $.peekABar({
autohide: true
});
bar.show();
Set a custom bar padding.
var bar = new $.peekABar({
padding: '2em'
});
bar.show();
Set a custom bar background color (green).
var bar = new $.peekABar({
backgroundColor: 'green'
});
bar.show();
Make the bar reveal itself using a slide/fade animation with a custom render duration.
var bar = new $.peekABar({
animation: {
type: 'fade',
duration: 1000
}
});
bar.show();
Apply a custom CSS class to the bar. Please note that this will override all styles set in the options.
var bar = new $.peekABar({
cssClass: 'custom-class'
});
bar.show();
Change the opacity of the bar to get a translucent/transparent effect.
var bar = new $.peekABar({
opacity: 0.7
});
bar.show();
Where would you like the bar to show? Top or bottom?
var bar = new $.peekABar({
position: 'bottom'
});
bar.show();
Want something to happen after the bar is shown/hidden? Use the onShow/onHide events.
var bar = new $.peekABar({
onShow: function() {
// Do something after bar is shown.
},
onHide: function() {
// Do something after bar is hidden.
}
});
bar.show();
For any issues/feedback, please create a Github Issue.