THEMETRIAL

jQuery slideToggle slideUp slideDown Replacement – SimpleSlideToggle.js

Author:maekoya
Views Total:0 views
Official Page:Go to website
Last Update:June 8, 2021
License:MIT

Preview:

jQuery slideToggle slideUp slideDown Replacement – SimpleSlideToggle.js

Description:

A vanilla JavaScript implementation of slideUp & slideDown animations. Use it to reveal & hide given elements with a smooth slide effect without jQuery dependency.

See Also:

How to use it:

1. Install & Download.

# NPM
$ npm i simple-slide-toggle

2. Import the simpleSlideToggle.js JavaScript library.

import { slideUp, slideDown, slideToggle } from 'simple-slide-toggle'
<script src="https://www.cssscript.com/./dist/simpleSlideToggle.js"></script>

3. Toggle the visibility of an element.

<div
  id="example"
  aria-hidden="true"
  aria-expanded="false">
  Show/Hide Me
</div>
const $target = document.getElementById('example')
slideToggle($target);

4. Specify the animation speed.

slideToggle($target, 500);


Source link

Add comment

NOTE :

All visitors can share my site’s content on their blogs, sites, and social networks to enrich the content

Only share the source www.themetrial.com

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.