用了jqm那么久,难得还没有自己写过一个widget,那就来吧!
(function($,window){
$.widget("mobile.myWidget",$.mobile.widget,{
//_create
_create:function(){
}
//自定义方法
});
//..
$(document).bind("pagecreate create",function(e){
$.mobile.myWidget.prototype.enhanceWithin(e.target);
});
})(jQuery,this)