Skip to content
/ so Public

So.js: A multipurpose JavaScript library (DOM, HTTP, Events, Animations and extensions built with So).

License

Notifications You must be signed in to change notification settings

krmgns/so

Repository files navigation

So.js is a multipurpose JavaScript library that contains DOM, HTTP, Event, Animation objects and extensions built with So.

DOM Example

// set each '<p>' font size to '15px', wich has no 'foo' class
so.onReady(function($) {
    $.dom("p:not(.foo)").style("font-size", 15);
    // or
    $.dom("p").not(".foo").style("font-size", 15);
    // or
    $.dom("p").filter(function(el) {
        return !$.dom(el).hasClass('.foo');
    }).style("font-size", 15);
});

HTTP (Ajax) Example

so.onReady(function($) {
    $.http.get("/url", {}, function(data, /* client */) {
        console.log(data);
        /* console.log(client, client.request, client.response); */
    });
});

Event Example

// stop default actions of each <a> if 'href' is '#'
so.onReady(function($) {
    $.dom("a[href='#']").on("click", function(e) {
        e.stopDefault();
    });
});

Animation Example

// set each '<p>' font size animating to '15px', wich has no 'foo' class
so.onReady(function($) {
    $.dom("p:not(.foo)").animate({"font-size": 15});
    // or
    $.dom("p").not(".foo").animate({"font-size": 15});
    // or
    $.dom("p").filter(function(el) {
        return !$.dom(el).hasClass('.foo');
    }).animate({"font-size": 15});
});

Browser Support (Desktop)

Firefox Chrome Opera Safari IE
4 5 11.6 5 9

Browser Support (Mobile)

Firefox Chrome Opera Safari IE Android
4 11.5

See documentation here.

About

So.js: A multipurpose JavaScript library (DOM, HTTP, Events, Animations and extensions built with So).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published