jq封装插件
$(function(){
// $.extend()拓展方法:
$.extend({
backgroundColor:function(){
$('body').css('background','#ccc');
}
})
$.backgroundColor();//----->就可以调用;
})
$(function(){
// $.fn.extend() jq对象的拓展方法:
$.fn.extend({
color:function(){
$(this).css('color','red');
},
bg:function(){
$(this).css('background','red');
}
})
$('#txt').bg();//----->就可以调用;
})
本博客主要记录自己的学习点滴~,文章来源于总结,还有在工作中实际碰到的问题以记录。

浙公网安备 33010602011771号