Pure JavaScript Library Add Custom Classes To Element On Hover | MultiDeviceHover

MultiDeviceHover is a pure JavaScript library that adds.is-hover class instead of css:hover for mobile and desktop.

add class on mouseover javascript, on hover add class to another div css, hover css, add class on hover jquery, hover css animation

How to make use of it:

1. Install and import the MultiDeviceHover.

$ npm i multi-device-hover
import MultiDeviceHover from 'multi-device-hover';

2. Or embrace the mdh.min.js on the web page.

<script src="dist/standalone/mdh.min.js"></script>

3. Initialize the MultiDeviceHover in your component. This will add a CSS class named is-hover to the factor when hovering over.

const targetEle = document.querySelectorAll('#myElement');

4. You can even apply multiple CSS lessons to the aspect when hovering over.

const targetEle = document.querySelectorAll('#myElement');
  hoverClass: ['is-hover', 'is-hover-2', 'is-hover-3']

5. Destroy the instance.


6. Callback features.

  onEnter: (element,mouseEvent) => {
  onLeave: (element,mouseEvent) => {
  onDestroy: (element) => {

Add Custom Classes To Element On Hover, MultiDeviceHover Plugin/Github

See Demo And Download

Official Website(sk-rt): Click Here

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

Related Posts


Generating Beautiful Vector Graphs With jQuery | smartGraph

SmartGraph is a free and easy-to-use JavaScript library to create beautiful vector diagrams with many customizations. This plugin allows developers to create dynamic, responsive, draggable vector graphics…


Image Slider With 20 Cool Transitions Component | vue-flux

Vue flux is an image slider developed with Vuejs 2 that comes with 20+ nice transitions out of the box. Included transitions 2D transitions Fade: Fades from…


Simple background Image Parallax Scroll Plugin In jQuery

Background parallax effect is a simple jQuery background image without any library. Uses jQuery’s scroll() function to track the scroll event and applies the exact parallax scroll…


Modular Color Picker Plugin for Bootstrap | BS Colorpicker

Bootstrap Colorpicker is a standard color picker plugin for Bootstrap 4. Colorpicker Plugin for Bootstrap 5/4/3 frameworks that allow you to add a color picker to an…


GDPR Friendly iFrame Manager In Vanilla JS | iframemanager

IframeMananger is a lightweight JavaScript plug-in that helps you to comply with GDPR by completely removing iframes at first and setting a notice related to that service….


Diagonal Thumbnails Carousel Slider | Anime.js

Diagonal Slider is a cool mini carousel made with Anime.js JavaScript library. It takes a bunch of pictures and turns them into a circular user interface where…