/** * Делаем автозамену селектов для ие. * Пока что так - некрасиво- будет время - оформим. :( */ $(document).ready(function(){ if( $.browser.msie ){ $('select').hide().each( function( i, elem ){ elem = $(elem); sID = elem.attr('id') + '__customSelect'; if( elem.attr('id') == 'select-search' ){ iClientWidth = '241px'; sPicture = 'http://softline.ru/legalboss/js/customselect/select_small.gif'; }else{ iClientWidth = '321px'; sPicture = 'http://softline.ru/legalboss/js/customselect/select.gif'; }; tmpstr = $('option:selected', elem ).text(); if( tmpstr.length > 46 ) tmpstr=tmpstr.substring(0,46)+'...'; finalSelect = elem.parent().prepend('
').children('.selectHandler').finalselect({ id: sID, zIndex: 100, animalSpeed: 0, viewWidth: 'auto', viewHeight: 'auto', selectText: tmpstr, defaultValue: elem.val(), selectName: elem.attr('name') + '__customSelect', selectWidth: iClientWidth, selectImage: sPicture, viewTop:"24px",//top,bottom viewLeft:"0"//left,right }); options = $('option', elem); $('option', elem).each(function(j, item){ item = $(item); finalSelect.addItem( ''+item.text()+'', item.val() ); }); }); $('a.close').click(function(){ $('#select-client__customSelect-select').show(); }); $('a#showdesc-terminal').click(function(){ if( $('#showdesc-terminal').parent().children('.info').css('display') == 'block' ){ $('#select-client__customSelect-select').hide(); }else{ $('#select-client__customSelect-select').show(); }; }); } }); $(document).ready(function(){ $(document.body).click(function(){ $('.SlCustomSelect').hide(); $('.SlCustomSelectI').parent().removeClass("hover"); }); }); $(document).ready(function(){ $(".SlCustomSelectI").click( function () { $(this).parent().addClass("hover"); }); }); //select表示select本身,view表示跳出的選項 (function($){ $.fn.extend({ //計算文字Byte數,並回傳 getByteLength: function(strIN){ var i, cnt=0; for (i=0; i