jq 插件编写 待
2014-12-18 10:12
274 查看
<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插件编写成果:little酷炫的图片滑动切换效果
- 实战编写jq插件轮播图
- 2017/8/13 jq编写插件方法
- jQ插件编写
- jQ 编写插件
- jq插件的编写方法(自定义jq插件)
- [jq] 最终确定的jq插件结构编写
- jq编写轮播插件
- 【前端】jq插件的编写
- VS2010 编写NPAPI 插件
- jq选项卡鼠标延迟的插件
- 写一个简单的jq插件
- 由云台协议DLL浅谈插件程序的编写(上)【原创】
- typecho插件编写教程(三):保存配置
- typecho插件编写教程(六):调用接口
- jq返回值插件
- 使用c++开发excel插件 (3.4、编写一个简单的动态链接库)
- jQuery插件编写
- Node.js插件的正确编写方式