0.3.2 • Published 6 years ago

squery v0.3.2

Weekly downloads
5
License
BSD-2-Clause
Repository
github
Last release
6 years ago

squery

npm.io npm.io npm.io

Yet another jQuery "replacement"

squery is based on the awesome bling.js and brings the following extensions:

  • .off support. Even without a listener.
  • .on and .off support multiple space-separated event names.
  • $('a') returns a Node when only one element is matched, otherwise a NodeList.

squery currently weights 376 bytes gzipped.

Install

npm i --save squery

Examples

// working on a single element
$('#id').classList.add('newclass');
$('#id').style.backgroundColor = 'red';
$('#id').on('click focus', handler);
$('#id').off('click focus');
$('#id').find('div').on(handler);
window.on('resize', handler);
window.off('resize');

// working on multiple elements
$('a').forEach((el) => {
  el.style.color = 'red';
});
$('a').on('click focus', handler);
$('a').off('click focus', handler);

© silverwind, distributed under BSD licence

0.3.2

6 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago