jquery-pseudo-class
v0.1.8
Published
jQuery CSS pseudo-class plugin
Downloads
13
Readme
jQuery pseudo-class
Add pseudo-class events control to jQuery
Install
npm install --save jquery-pseudo-class
:construction: 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 :heart: in Paris