Jquery Plugin to Hide and Show HTML Elements with a Line of Code | parte.js

parte is a jQuery based plugin, when used in page settings an icon will be added to the page and from it, you can hide/show sections of the page.

It is fully responsive, you only need to include Jquery and Bootstrap.

hide and show div using javascript with example, onclick show div and hide other div, javascript showhide div onclick toggle, javascript showhide div on click, js hide element

How to make use of it:

1. Load jQuery parte.js plugin files and other resources into the document.

<!-- Required -->
<link rel="stylesheet" href="/path/to/src/css/parte.css" />
<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/src/js/parte.js"></script>

<!-- Font Awesome Icons -->
<link rel="stylesheet" href="/path/to/cdn/font-awesome/all.min.css" />

2. Add a CSS class part to the target elements and specify the taxonomy name using the data-partename attribute.

<div class="parte" data-partename="User Name">
  <label for="myUsername">Username</label>
  <input type="text" id="myUsername" placeholder="Username">
</div>

<div class="parte" data-partename="User Password">
  <label for="myPassword">Password</label>
  <input type="password" id="myPassword" placeholder="Password">
</div>

<div class="parte" data-partename="User Email">
  <label for="myEmail">Email</label>
  <input type="email" id="myEmail" placeholder="Email" value="[email protected]">
</div>

...

3. Initialize parte.js plugin.

jQuery(function ($) {
  $(".parte").parte({
    // options here ...
  });
});

4. Adjust the space between the floating panel and the top of the page.

jQuery(function ($) {
  $(".parte").parte({
    top: '50px',
  });
});

5. Customize the switch.

jQuery(function ($) {
  $(".parte").parte({
    htmlicon: '<i class="fa fa-cog"></i>'
  });
});

6. Run a function every time an item is hidden or shown.

jQuery(function ($) {
  $(".parte").parte({
    onChange: function (element, checked) {
      if(checked)
      {
        $(element).find('input').each(function () { this.value=""});
      }
    },
  });
});

Hide & Show Specific Elements Using jQuery, parte Plugin/Github, css showhide div on click, hide and show in javascript, show hide div jquery


See Demo And Download

Official Website(laythm): Click Here

This superior jQuery/javascript plugin is developed by laythm. For extra Advanced Usages, please go to the official website.

Related Posts

Searchable-Select-Dropdown

A Simple Searchable Select Dropdown Plugin | jQuery Select Search

Simple jQuery search on the selection options plugin for your website. Next, there is a checkbox replacement plugin that refines and beautifies the original selection element with…

country-dropdown-with-flags

A Quick jQuery-Based Country Picker With Flags | Country Select JS

Country Select JS is a jQuery plugin to select a country, based on the international phone input plugin. Adds a flag dropdown to any input, which lists…

Autocomplete-and-Typeahead-Javascript-Library

Simple and Fast Autocomplete and Typeahead Javascript Library | autoComplete.js

autoComplete.js is a simple, pure, and incrementally designed JavaScript library for speed, high versatility, and seamless integration with a wide variety of projects and systems. Features Pure…

Bootstrap-Notification-Message-Alert-Plugin

Bootstrap Notification Message Alert Plugin with jQuery

BootstrapMsg is a jQuery plugin for displaying messages with Bootstrap alert classes to generate hierarchical in-page navigation for an extended webpage sectioned by heading components. Using Bootstrap…

jquery-google-chart-plugin

jQuery Plugin for Transforming HTML Tables Into Charts Using Google Charts

Chartinator is a jQuery plugin for converting HTML tables, Google Sheets and js arrays into charts using Google Charts. Use data from HTML tables Chartinator is designed…

free-vue-chart-library

Customizable & Composable Charts for VueJS | vue-wcharts

WCharts is a library that makes it easy to create your own charts using Vuejs. You can easily create reusable chart components. Use a basic layout or…