Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery-slideoutpanel

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-slideoutpanel

jQuery SlideOutPanel is a jQuery Plugin to add a sliding out panel.

  • 1.0.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by23.08%
Maintainers
1
Weekly downloads
 
Created
Source

#jQuery SlideOutPanel

Simple jQuery Plugin to add a sliding out panel.

Installation


npm install --save-dev jquery-slideoutpanel

Demo

Basic


Usage

HTML

The html must be set up with the proper id and internal elements.

Allowed tags: <header> <section> <footer>

Optional tags: <header> <footer>

Required tag: <section>

<div id="slide-out-panel" class="slide-out-panel">
    <header>Panel Title</header>
    <section>Panel content section</section>
    <footer>Panel footer</footer>
</div>

Options


NameTypeDefaultOptionsDescription
bodyPushbooleanfalsetrue
false
Enables pushing the body when the tab opens (works with slideFrom right and left
closeBtnhtml&#10005;
Add a custom close button instead of the default
closeBtnSizeString12pxAdjust the close button size
enableEscapeKeyBooleanfalsetrue
false
Enables the esc key to close all panels
offsetTopString0Offset the top of the panel
screenCloseBooleantruetrue
false
Enables closing of panels by clicking on the background screen.
screenOpacityString0.5Set the background screen's opacity
screenZindexString9998Set the background screen's z-index
showScreenBooleantruetrue
false
Enable/Disable showing the background screen
slideFromStringrighttop
right
bottom
left
Set to choose where the panel should slide out from
transitionStringeaseSet the transition-timing-function. Accepts the standard values used with CSS.
transitionDurationString0.35sSet the duration of the transitions. Adding "s" is optional.
widthString350pxSet the panels width

$('#slide-out-panel').SlideOutPanel({
    bodyPush: false,
    closeBtn: '<i class="fas fa-times"></i>',
    closeBtnSize: '',
    enableEscapeKey: true,
    offsetTop: '50px',
    screenClose: false,
    screenOpacity: '1',
    screenZindex:  '9998',
    showScreen: false,
    slideFrom: 'right',
    transition: 'ease',
    transitionDuration: '0.35s',
    width: '350px',
});

Events


NameDescription
renderedFired after the panel is finished building
beforeOpenFired before panel opens
afterOpenFired after panel has opened
beforeClosedFired before panel is closed
afterClosedFired after the panel is closed

$('#slide-out-panel').SlideOutPanel({
    rendered() {
      // Some code...
    },
    beforeOpen() {
      // Some code...
    },
    afterOpen() {
      // Some code...
    },
    beforeClosed() {
      // Some code...
    },
    afterClosed() {
      // Some code...
    },
});

Methods


NameDescription
openOpen's the panel
closeCloses the panel
toggleToggles the panel open/close
destroyRemoves the panel from the DOM

const slideOutPanel = $('#slide-out-panel').SlideOutPanel();

slideOutPanel.open();

slideOutPanel.close();

slideOutPanel.toggle();

slideOutPanel.destroy();

Sass Variables


VariableTypeDefaultDescription
$pieces-paddingstring15pxPadding for the panel pieces (header, section, footer)
$so-screen-sm768pxResponsive breakpoint
$so-close-btn-color#000Color of the close button
$so-close-font-size12pxFont size of the close button
$so-container-background#fffThe panel background color
$so-container-box-shadow-3px 3px 9px rgba(0, 0, 0, .3)The panel box shadow
$so-container-transitiontop ease, right ease, bottom ease, left ease
$so-container-z-index9999The panel z-index
$so-content-no-header-padding-top$pieces-padding * 2The top padding of the <section> when there is no header
$so-header-background-color#fffThe header background color
$so-header-border-color#e5e5e5The header bottom border color
$so-header-border-width1pxThe header border width
$so-content-background-color#fffThe <section> background color
$so-footer-background-color#fffThe <footer> background color

Examples

Initialize plugin:

$('#slide-out-panel').SlideOutPanel();

Changing the direction the panel slides out from:

$('#slide-out-panel').SlideOutPanel({
    slideFrom: 'top',
});

$('#slide-out-panel').SlideOutPanel({
    slideFrom: 'right',
});

$('#slide-out-panel').SlideOutPanel({
    slideFrom: 'bottom',
});

$('#slide-out-panel').SlideOutPanel({
    slideFrom: 'left',
});

Close button customization:

$('#slide-out-panel').SlideOutPanel({
    closeBtn: '<i class="fas fa-times"></i>',
    closeBtnSize: '18px',
});

Background screen customization:

$('#slide-out-panel').SlideOutPanel({
    screenClose: true,
    screenOpacity: '0.5',
    screenZindex: '9998',
    showScreen: true,
});

Dependencies

jQuery


License

Copyright (c) 2020 WebDevNerdStuff
Licensed under the MIT license.

@WebDevNerdStuff

Keywords

FAQs

Package last updated on 01 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc