Socket
Socket
Sign inDemoInstall

guinguette

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    guinguette

The accordion plugin that smells good the french baguette


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Install size
87.2 kB
Created
Weekly downloads
 

Readme

Source

Guinguette.js

The accordion plugin that smells good the french baguette

Introduction

Guinguette.js is a lightweight accordion plugin written in ES6

  • No dependencies required
  • No extra files to download
  • Simple API
  • Keyboard navigation ready

Documentation

Install

MethodProcedure
NPMnpm i guinguette
DownloadDownload zip

Then guinguette have some css you will have to add (feel free to custom it for a better integration in your UI):

<link rel="stylesheet" href="dist/guinguette.css">

Finally just link the guinguette's code at the end of your document:

<script src="dist/guinguette.js"></script>

Use

Instanciate new accordion
var guinguette = new Guinguette(document.querySelector('[data-guinguette="container"]'))

First parameter is for your content's container. Then you'll have to add data-guinguette-title and data-guinguette-content attributes to each section you want to become an accordion. Like that for example:

<div data-guinguette="container">
    <h2 data-guinguette-title>Wow Guinguette.JS is so usefull</h2>
    <div data-guinguette-content>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    </div>
    <h2 data-guinguette-title>Why Guinguette.JS is so easy to setup</h2>
    <div data-guinguette-content>
        Sed ut elit facilisis, egestas quam a, ultrices lectus. Ut dictum sit amet lectus vel eleifend.
    </div>
</div>
Options
OptionDefault valueDescription
autoCollapsefalseOpen only one accordion at a time
anchorOpentrueIf a title's id match with a the URL's anchor, it'll be open by default

You can use it like that:

var guinguette = new Guinguette(document.querySelector('[data-guinguette="container"]'), {
    autoCollapse: true
})
API
NameDescription
expand(int)Open an accordion
collapse(int)Close an accordion
expandAll()Open all accordions
collapseAll()Close all accordions

Hack guinguette.js

  1. Install dependencies with npm: npm install
  2. Generate assets with gulp
  3. Launch a local server that monitor changes with gulp watch

Keywords

FAQs

Last updated on 16 Jan 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc