小眼睛插件

;(function(){
  var default = {};
  $.fn.extend({
    "eye" : function(option){
    $(this).each(function(){
      $.extend(true,default,option);
      var $this = $(this);
      $this.after("woshihsi");
      $this.next().on("mousedown",function(){
        $this[0].type = "text";
    $this.next().removeClass("closed");
    $this.next().addClass("opened");
      });
      $this.next().on("mouseup",function(){
    $this[0].type = "password";
    $this.next().removeClass("opened");
    $this.next().addClass("closed");
      });
      });
      return $(this);
    }
  
  });
})(window.Zepto || window.jQuery);

你可能感兴趣的:(小眼睛插件)