Creating a new library with javascript

how can we make a simple library like jquery through javascript? I want to use my functions that can be used as animate functions in javascript

+3
source share
3 answers

I found that a very good tutorial is http://www.mikedoesweb.com

+1
source

if you want to write a library similar to jquery

see this good video

http://ejohn.org/blog/building-a-javascript-library/

You can write you jquery extensions as below    

For example, I wrote the following a few days ago

jQuery.fn.centerElement = function () {
        trace('trying to center');
        this.css("position","relative");
        var parentObj = $(this).parent();
        this.css("top", ( parentObj.height() - this.height() ) / 2 + "px");
        this.css("left", ( parentObj.width() - this.width() ) / 2 + "px");
        return this;
    };

you can use as below

$('#divid').centerElement();
0
source

-

0

All Articles