npm

Need private packages and team management tools?Check out npm Orgs. »

jquery-pseudo-class

0.1.8 • Public • Published

jQuery pseudo-class

Add pseudo-class events control to jQuery

Install

npm install --save jquery-pseudo-class

🚧 The module is still in development. The following pseudo-classes are supported:

  • active
  • hover
  • ... work in progress ...

Usage

$elem.onPseudoClass( pseudo_class, function_in, function_out );
 
$elem.onPseudoClass( {
    pseudo_class: [function_in, function_out],
    pseudo_class: [function_in, function_out],
    ...
} );

For exemple:

var $elem = $('.js-button');
 
$elem.onPseudoClass('hover',
    function(e) {
        $elem.html('Mouse is in');
    },
    function(e) {
        $elem.html('Mouse is out');
    }
);

Or

var $elem = $('.js-button');
 
$elem.onPseudoClass({
    hover: [
        function(e) {
            $elem.html('Mouse is in');
        },
        function(e) {
            $elem.html('Mouse is out');
        }
    ],
    active: [
        function(e) {
            $elem.html('Mouse pressed');
        },
        function(e) {
            $elem.html('Mouse released');
        }
    ]
});

Licence

This plugin is under the Apache 2.0 Licence. Please refer to the LICENCE file for more details.

Made with ❤️ in Paris

install

npm i jquery-pseudo-class

Downloadsweekly downloads

3

version

0.1.8

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability