/* +------------------------------------------ | 鏁寸悊琛ㄥ崟鏍峰紡鐨勪唬鐮 | By Zinn +------------------------------------------ */ $.fn.extend({form:function(v){ $.fn.form.a = $.extend({ obj: this, dlSelect: 0, //寮€鍚嚜瀹氫箟select鏍峰紡 UI_Input_Cur: 'blue'// blue娣¤摑鑹 green娣$豢鑹 },v); // 瀵硅〃鍗曢粯璁ゆ牱寮忚繘琛屼竴娆′慨鏁 // 閫変腑鍚庤繘琛岄珮浜晥鏋 var focus=function(){ var a = $.extend({}, $.fn.form.a); var i = a.obj.find('input, textarea'); i.focus(function(){ var n = $(this).attr('notline'), s = $(this).attr('siblings'), p = $(this).parent(); if(typeof n=='undefined' && !p.hasClass('s')) p.addClass(a.UI_Input_Cur); if(typeof s!='undefined') p.siblings().addClass(a.UI_Input_Cur); }); i.blur(function(){ var s = $(this).attr('siblings'), p = $(this).parent(); p.removeClass(a.UI_Input_Cur); if(typeof s!='undefined') p.siblings().removeClass(a.UI_Input_Cur); }); i.each(function(i, e){ $(this).attr({autocomplete:'off'}); }); a.obj.find('.J-i').each(function(index, element){ var s = '', t = $(this); if(t.hasClass('s1')) s=''; else if(t.hasClass('s2')) s=''; else if(t.hasClass('s')) s=''; s && t.append(''+s+''); }); } /* +-------------------------- 鑷畾涔塻elect鑿滃崟 +-------------------------- */ var select={ cur:'SEL2385564219', sl:'.J-i.s', at:'.J-i.s dd[on]', dd:'.J-i.s dd', dl:'.J-i.s dl', i: function(){ var a=this, dl=$(a.dl), at=$(a.at), sl=$(a.sl), dd=$(a.dd), doc=$(document); if(at.length>0) a.d(at); dl.I(); sl.click(function(e){ e.stopPropagation(); var e = $(this), isSelf = e.hasClass(a.cur); a.c(sl.parent().children('.'+a.cur)); if(!isSelf){ e.addClass('cur '+a.cur); if($.Mobile()) a.p(e); } return false; }); dd.click(function(e){ e.stopPropagation(); a.d($(this)); return false; }); dl.click(function(e){ e.stopPropagation(); }); doc.click(function(e){ a.c($('.'+a.cur)); }); return a; }, d: function(o){ var p = o.parents('.J-i.s'), h = o.html() || o.attr('value') || '', v = o.attr('value') || o.html() || h; p.find('input').val(v); p.children('div').html(h); if(v) this.c(p); }, c: function(p){ p.removeClass('cur '+this.cur).find('dl').removeClass('JustInX').addClass('JustOutDown'); }, p: function(p){ p.find('dl').addClass('JustInX JustAnimate').removeClass('JustOutDown'); } } focus(); if($.fn.form.a.dlSelect) select.i(); return this; }});