Giter VIP home page Giter VIP logo

vine's Introduction

Vine.js
-About 1.7KB(about 1k gzipped)
-Can be used with or without the DOM

Goal
-<2KB
-Cross-browser
-Easily embedded and used in libraries
-usable standalone

Tested in:
-Browser:Grade*
-Chrome 11:A
-IE 8:A
-FF 4:A
-Opera 11:A

*A=Full support, B=Partial support, C=no support

API:

vine.bind(target:Object/DOMElement,type:String,handler:Function[,data:Object]) //binds a handler to the element
vine.unbind(target:Object/DOMElement[,type:String][,handler:Function)) //unbinds a handler based on criteria
vine.trigger(target:Object/DOMElement[,type:String][,event:Object/Event]) //returns event object after handler execution

new vine.Event(event:Object/Event) //normalizes an event (internal)

Examples:
//if passed a string-it looks for an element with that id
vine.bind("ch","click",function(e){
e.preventDefault();
})

//simulate a mouseclick, this will check a checkbox if no events are bound to prevent that.
vine.trigger("check_box","click")

//will focus on a textarea
vine.trigger("text","focus")

Plugins:
*delegate
   -vine.delegate(context:Document/DOMElement,target:DOMElement,type:String,handler:Function[,data:Object])
   -vine.undelegate(context:Document/DOMElement,target:DOMElement,type:String)
*once
   -vine.once(target:Object/DOMElement,type:String,handler:Function[,data:Object]) //binds a handler that will be unbound once triggered

vine's People

Contributors

arextar avatar

Watchers

James Cloos 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.