1;(function ($) { 2 $.fn.SelectDown = function ( opt ) { 3 var def = { 4 num: -1, 5 start:function(ojb,i,val){ 6 7 }, 8 deffun:function(i,val){ 9 10 } 11 } 12 var el=this; 13 14 opt = $.extend( def , opt ); 15 this.each(function(){ 16 var _this=$(this); 17 18 _this.find('.SelectTxt').on('click',function(enevt) { 19 if( _this.find('.SelectUl ul li').length > 0){ 20 21 $('.SelectFoldBox').not( _this).find('.SelectUl').stop(true).slideUp(); 22 23 _this.find('.SelectUl').stop(true).slideToggle(); 24 25 $(this).find('.icon').toggleClass('iconOn'); 26 $('.SelectFoldBox').not( _this ).find('.icon').removeClass('iconOn'); 27 } 28 29 enevt.stopPropagation(); 30 31 }); 32 33 _this.find('.SelectUl ul').delegate('li','click',function(enevt){ 34 _this.find('.SelectTxt span').text( $(this).text() ); 35 _this.find('.SelectTxt span').attr('data-val',$(this).attr('data-val')) 36 _this.find('.SelectUl').stop(true).slideUp(); 37 $('.SelectFoldBox .icon').removeClass('iconOn'); 38 var _num=$(this).index(); 39 var _val=$(this).attr('data-val'); 40 opt.deffun(_num,_val); 41 enevt.stopPropagation(); 42 }); 43 44 45 46 el.resetSelect=function(num){ //æ·»å éç½®æ¹æ³ 47 num=num||0; 48 _this.find('.SelectUl ul li').eq(num).click(); 49 } 50 51 52 if( opt.num > -1 ){ 53 function init(){ 54 var vtxt= _this.find('.SelectUl ul li').eq(opt.num).text(); 55 vda= _this.find('.SelectUl ul li').eq(opt.num).attr("data-val") 56 _this.find('.SelectTxt span').text(vtxt); 57 _this.find('.SelectTxt span').attr('data-val', vda); 58 // _this.find('.SelectUl ul li').eq(opt.num).click(); 59 } 60 init(); 61 } 62 opt.start(_this); 63 64 $(document).on('click',function() { 65 $('.SelectFoldBox .SelectUl').stop(true).slideUp(); 66 $('.SelectFoldBox .icon').removeClass('iconOn'); 67 }); 68 69 70 }); 71 return this; 72 } 73})(jQuery); 74 75 76 77 78
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.