兼容现有jQuery API的轻量级JavaScript库:Zepo

jopen 10年前

Zepo是一个JavaScript框架,其特点是兼容现有jQuery API的同时,自身体积十分小;它与jQuery有着类似的API。如果你会jQuery,那么也就会使用Zepto了。

$('div')  //=> all DIV elements on the page  $('#foo') //=> element with ID "foo"    // create element:  $("<p>Hello</p>") //=> the new P element  // create element with attributes:  $("<p />", { text:"Hello", id:"greeting", css:{color:'darkblue'} })  //=> <p id=greeting style="color:darkblue">Hello</p>    // execute callback when the page is ready:  Zepto(function($){    alert('Ready to Zepto!')  })

项目主页:http://www.open-open.com/lib/view/home/1396358489356