Simple customizable slide panel (without jQuery)

Overview

toolslide.js

Minimalistic customizable slide panel (without jQuery)

Table of contents

Quick start

Several quick start options are available:

Download the latest build

Development
Production

Install From Bower

bower install toolslide.js --save

Install From Npm

npm install toolslide.js --save

Done!

Usage

Including files:

<link rel="stylesheet" href="/path/to/toolslide.css">
<script src="/path/to/toolslide.js"></script>

Required HTML structure

<div id="toolslide">
	<div class="ts-container">
        <div class="ts-nav-container">
			<div class="ts-nav-item" ts-target="first">
			</div>
			<!-- Add more navigation buttons here -->
		</div>
		<div class="ts-content-container">
			<div id="first" class="ts-content-item">
				<div class="example-panel">
					<span>First panel content goes here</span>
				</div>
			</div>
			<!-- Add more content panels here -->
		</div>
	</div>
</div>
Attributes

toolslide.js makes use of html attributes to bind navigation elements to respective content.

Attribute Description
ts-target Specifies id of a target panel triggered with this navigation item

Initialization

All you need to do is invoke toolslide on an element:

var myToolslide = toolslide("#elementId", options);

You can also initialize with css selector string:

var myToolslide = toolslide("#elementId", options);

Examples

There are some example usages that you can look at to get started. They can be found in the examples folder.

Options

toolslide.js can accept an options object to alter the way it looks and behaves. If no options object is passed default values are used. The structure of an options object is as follows:

{
  position: left",
  height: "100%",
  width: "300px",
  startOpen: true,
  closeable: true,
  autoclose: false,
  autocloseDelay: 5000,
  clickOutsideToClose: true,
  animations: {
    replace: "crossfade 0.5s ease-in-out",
    toggle: "slide 0.5s ease",
  },
  listeners: {
    open: function(panel) {},
    close: function(panel) {},
    toggle: function(oldContent, newContent) {}
  }

Here is the explanation of options object:

Option Type Description Examples
position string Position of the panel on the screen "top", "bottom", "left", "right"
height string Panel height "200px", "20%"
width string Panel width "200px", "20%"
startOpen boolean Open panel after initialization true, false
closeable boolean Allow panel to be closed (by clicking active navigation element) true, false
autoclose boolean Allow panel to be auto closed (only when mouse cursor is outside) true, false
autocloseDelay int Auto close delay in miliseconds 5000
clickOutsideToClose boolean Allow panel to be closed when clicked outside true, false
animations.replace string Animation used when changing active panel "crossfade 0.5s ease-in-out", "slide 1s ease", "slidefade 2s ease-in-out"
animations.toggle string Animation used when panel is opened/closed "slide 0.5s ease"
listeners.beforeOpen function Callback fired before panel is opened function (panel) {...}
listeners.afterOpen function Callback fired after panel is opened function (panel) {...}
listeners.beforeClose function Callback fired before panel is closed function (panel) {...}
listeners.afterClose function Callback fired after panel is closed function (panel) {...}
listeners.beforeToggle function Callback fired before active content is changed function (old, new) {...}
listeners.afterToggle function Callback fired after active content is changed function (old, new) {...}

Methods

Methods are called on toolslide instances. You shoud save the instances to variable to have further access to it.

void open()

Show the slide panel.

toolslide.open();

void close()

Hide the slide panel.

toolslide.close();

bool isOpen()

Check if panel is opened.

toolslide.isOpen();

bool isActive(target)

Check if target content element is active. Accepts DOM element as well as just the id.

toolslide.isOpen("elementId");

void setActiveById(elementId)

Sets element with specified id as new active item.

toolslide.setActiveById("elementId");

void setActiveByIndex(index)

Sets element at specified index as active item.

toolslide.setActiveByIndex(0);

Events

toolslide.js provides custom events for some of it's actions. Appropriate callbacks can be specified in options.

Event Description Arguments
beforeOpen Fires before panel is opened. panelElement
afterOpen Fires after panel is opened. panelElement
beforeClose Fires before panel is closed. panelElement
afterClose Fires after panel is closed. panelElement
beforeToggle Fires before active content is changed. oldContentElement, newContentElement
afterToggle Fires after active content is changed. oldContentElement, newContentElement

Copyright and license

Licensed under MIT license.

^ back to top

You might also like...

Data Manipulation Form panel plugin for @grafana.

Data Manipulation Form panel plugin for @grafana.

Data Manipulation Form panel plugin for Grafana Introduction The Data Manipulation Form Panel is a plugin for Grafana that can be used to insert, upda

Dec 28, 2022

Apache ECharts Panel plugin for Grafana

Apache ECharts Panel plugin for Grafana

Apache ECharts Panel plugin for Grafana Introduction The ECharts Panel is a plugin for Grafana that allows to visualize Apache ECharts on your Grafana

Dec 23, 2022

A frontend framework containing of tools for fast development of dashboard, panel, etc.

Khaos-Admin A frontend framework containing of tools for fast development of dashboard, panel, etc. Tools We Provide Fast Development: We handle data

Nov 27, 2022

RWP stands for Roblox web panel, it's a code snippet that you can run via developer console or the provided Google Chrome extension to try out early

RWP stands for Roblox web panel, it's a code snippet that you can run via developer console or the provided Google Chrome extension to try out early

RWP stands for Roblox web panel, it's a code snippet that you can run via developer console or the provided Google Chrome extension to try out early Roblox site features before they're officially out without any programming experience.

Nov 28, 2022

NX workspace for running medusa backend, storefront and admin panel with marketplace functionalities

Medusa Marketplace Project status Assigned store_id to Order, Product to make them store specific Create and process payment for an order with multipl

Nov 13, 2022

Your Ethereum control panel. Interact with smart contracts on Ethereum.

etherfunk Your Ethereum control panel. Interact with smart contracts on Ethereum. 👉 https://etherfunk.io 👈 Devleopment First, run the development se

Sep 24, 2022

A control panel for Earthstar keypairs, shares, and replica servers.

Control panel applet This is an applet to help manage Earthstar keypairs, shares, and replica servers. It's written in React. These configurations can

Dec 9, 2022

This is admin panel for @MultiEmail

This is admin panel for @MultiEmail

Technologies Used React Tailwind Features Admin dashboard User settings and or user dashboard send emails recive emails Connections through other part

Dec 24, 2022

Adds a panel area where you can inspect your dumps.

Adds a panel area where you can inspect your dumps.

Kirby3 Toilet Dump without stopping your thread or template rendering. Instead your dumps will go straight to the new Toilet panel area. There you can

Dec 14, 2022
Comments
  • Another dead link in README.md

    Another dead link in README.md

    I just openened a PR (#1) where i fixed 4 dead links in your README. While doing that, i noticed that your table of contents contains a link to #Browser-Support, a section that doesnt exist. Since i didnt know whether you wanted to keep that link i did not modify it.

    opened by Wuelle 0
Owner
null
Gatsby-Formik-contact-form-with-backend-panel - Full working contact form with backend GUI panel.

Gatsby minimal starter ?? Quick start Create a Gatsby site. Use the Gatsby CLI to create a new site, specifying the minimal starter. # create a new Ga

Bart 1 Jan 2, 2022
A modern client panel for the Pterodactyl® panel, made by Wrible Development.

Dashboardsy A modern client panel for the Pterodactyl® panel, made by Wrible Development. Support Discord: https://discord.gg/zVcDkSZNu7 Screenshots S

Wrible Development 23 Jan 1, 2023
Make the content slide prettily across the screen with variable sizes of scrolling items, in any of four directions, pausing while the mouse is over the marquee, and all with vanilla JavaScript.

TEG Marquee Make the content slide prettily across the screen with variable sizes of scrolling items, in any of four directions, pausing while the mou

Paul B. Joiner 0 Dec 30, 2021
A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more

Glide.js is a dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more What can co

null 6.7k Jan 3, 2023
A full screen slide show for images and videos

Vanilla JS Slide full screen slide show for videos and images Why? This is a scratch-your-own-itch project as I wanted a way to see images and videos

Christian Heilmann 24 Oct 26, 2022
A markdown based tool for slide deck creation.

Decker A markdown based tool for slide deck creation. Installation from source Install stack and Node.js (for npm) Clone this repo. cd decker git subm

Decker 8 Nov 7, 2022
Slide everything into this vanilla javascript slider: just 20kb all-inclusive, no dependencies!

Lightweight vanilla javascript media and contents slider, by LCweb Just 20KB to have: Top features list: single file, no dependencies, 100% pure javas

Luca 4 May 12, 2021
A simple element template chooser for properties-panel >= 1

A simple element template chooser for properties-panel >= 1

bpmn.io 9 May 30, 2022
A simple Node.js code to get unlimited instagram public pictures by every user without api, without credentials.

Instagram Without APIs Instagram Scraping in August 2022, no credentials required This is a Node.js library, are you looking for the same in PHP? go t

Francesco Orsi 28 Dec 29, 2022
A web panel to manage TP-Link/Kasa smart home devices.

TP-Link Web Panel A web panel to manage TP-Link/Kasa smart home devices. Prerequisites Node.js v16.13.1 or higher Yarn Installation Run git clone http

Milan M 3 Apr 1, 2022