兼容現有jQuery API的輕量級JavaScript庫:Zepo
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!') })
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!