1 /** 2 * focusClass 3 * @constructor 4 * @author putaoshu@126.com 5 * @date 2012-03-12 6 * @param {Object} obj 主对象 7 * @param {String} styleclass 样式名称 8 */ 9 10 vui.focusclass = vui.focusClass = function(obj,styleclass){ 11 var $this = $(obj); 12 $this.focus(function(){ 13 $this.toggleClass(styleclass); 14 }).blur(function(){ 15 $this.toggleClass(styleclass); 16 }); 17 } 18 19