JaSper v3.5 (© José M. Carnero)
Project in GitHub: github.com/jmcarnero/JaSper
JaSper is a multipurpose JavaScript library with the following features:
- DOM XPath selector and CSS selector.
- Extremely lightweight.
- Easy to extend and modularize.
- Dynamic loading (on demand) of components (normal and minified).
- Node management.
- Event management. You can add multiple events (comma separated) to one DOM element and one unique callback. Can delete all events associated to a DOM element (included anonymous callbacks), or only those associated with a specific event, ....
- Text translation.
- 'use strict'
- Event aggregator (DOM and/or custom).
Modules included:
- AJAX (JaSper_ajax.js) with start callback, end callback and fail callback.
- Beautifier (JaSper_beautify.js) in a very early stage yet.
- Canvas (JaSper_canvas.js) (draft version).
- CSS animations (JaSper_anim.js)
- Dates (JaSper_datetime.js) with countdown and date picker.
- Forms validation (JaSper_formazo.js) with upload image preview and callbacks for validation start (inicio), validation end (fin) and validation fail (fallo).
- Image carousel (JaSper_lightbox.js) with callbacks for image foot, description and origin.
- Object movement (JaSper_move.js) with movement start callback, end movement callback and in move callback; under mouse object information; touch devices.
- Rating (JaSper_rating.js) with stars, bars in development.
- REST (JaSper_rest.js) client, by now only GET and POST.
- Rich text box (JaSper_rtb.js).
Example:
$(document).debug().ready(function(){
$('').eventAdd('click', function(ev){
$('//p').toggle(500); //XPATH don't work in IE
}).eventAdd('mousewheel', function(ev){
if(JaSper.funcs.windowPosition().indexOf('bottom') > -1 && ev.wheelDelta == -3) alert('end of page');
}).eventAdd('custom_event', function(ev){
alert('custom event');
}).eventFire('custom_event');
});
Tested on Firefox.
Also works on Chrome and IE.
This site works with JaSper v3.5