JQuery写插件

 

$.fn.extend({
  BigPicLook:function(options){
  var defaults={
  "pic_list":new Array(),
  "width":200,
  "height":200
  }

  var options=$.extend(defaults,options);//有了这个调用的时候就你能改变默认的值了

  function Bigimg(){

          $(this).css({"width":options.width,"height":options.height});

      }

}

});

 

//调用

<script>
$("img").BigPicLook({
  "width":400,
  "height":400
});
</script>

posted @ 2015-05-28 17:22  luoyiming  阅读(87)  评论(0)    收藏  举报