Quantcast
Channel: javascript – Codigo Manso
Viewing all articles
Browse latest Browse all 10

mansofk: the super mega ultra lightweight js framework

$
0
0

I needed a javascript framework that was able to change the CSS of the elements, that was able to do AJAX requests, able to load external JS and CSS dynamically, able to add or change HTML on the fly, able to handle events, able to do animations and able to avoid collisions with other frameworks or with other versions of himself, and, on top, I wanted a framework that was ultra lightweight and I wanted something that worked on IE6+, FF, Safari, Chrome and Opera.

After being tired of looking for this, I finally decided to do it myself, and honoring the blog I called it manso framework, mansofk for firends.

I got all that functionality in just 1.5 KB!!

The main features are:

  • Easy to rename the framework to avoid collissions (with other frameworks or other versions of mansofk)
  • Chaining support
  • Dynamic load of external elements
    • Supports loading external CSS files upon request
    • Supports loading external JS files upon request
  • Simple DOM manipulations
    • Select elements by ID
    • Add new HTML on an element
    • Replace the HTML of an element
  • Support CSS manipulations
    • Get the current property of an element
    • Change the property of an element
    • Change several properties at once
  • Simple CSS animations
    • Supports several attributes at once
    • Several parameters, supports changing the duration or the frames per second
    • You can choose the linear function and the cubic function
  • Event support
    • bind
    • unbind
  • AJAX calls
    • Using GET and POST
    • Support parsing XML data
    • Supports parsing JSON data
    • Supports getting plain text
  • Super lightweight
    • 3.3 KB minified
    • 1.5 KB gzipped!

You are all free to use this framework for whatever you want, but don’t blame at me if it fails (although bugs are welcome).

Following you have the minified version using Google Closure Compiler and the development version:

So…  that’s it!  I think it would be great to give you a demo, but right now I’m out of time, so I leave it for another day.


Viewing all articles
Browse latest Browse all 10

Trending Articles