Code Monkey home page Code Monkey logo

so's Introduction

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.

so's People

Contributors

krmgns avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.