<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
;(function($){
//全部方法写这里
var method={
init : function( options ) {
//this.text(options.name);
},
hide : function( ) {
this.text(options.name);
}
}
$.fn.yybox=function(){// 添加yybox 插件
// Method calling logic
if ( method[method] ) {
return method[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return method.init.apply( this, arguments );
} else {
$.error( 'Method ' + method + ' does not exist on jQuery.tooltip' );
}
}
})(jQuery);
$(function(){
$("#id1").on("click",function(){
$("#id1").yybox({name:'520'})
})
})
</script>
<div class="a" id="id1">red</div>
<div style="color:#blue; ">blue</div>
<div style="color:#green; ">green</div>
<div style="color:#yellow; ">yellow</div>
jq 插件编写 待
最新推荐文章于 2024-01-05 19:47:22 发布