日期:2014-05-16 浏览次数:20354 次
<tr id="messageformtr" style="display:none"> <td> <form action="" method="post" id="messageinfoform"> <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#D5D5D5" id="sendInfoTable"> <tr bgcolor="#FFFFFF"> <Td width="20%" align="right"> 选中的人:</Td> <td width="70%" id="selectPeople"> <span id="selectPeople"></span> </td> </tr> </table> </form> </td> </tr>
<style type="text/css"> .autoLineFeed{table-layout:fixed;word-wrap:break-word;} .autoTD{word-break:break-all;} </style>
<%--获取浏览器类型及版本--%> <script type="text/javascript"> function getBrowser() { var Sys = {}; var ua = navigator.userAgent.toLowerCase(); var re =/(msie|firefox|chrome|opera|version).*?([\d.]+)/; var m = ua.match(re); Sys.browser = m[1].replace(/version/, "'safari"); Sys.ver = m[2]; return Sys; } <%--绑定监控浏览器类型并设置相应样式--%> $(function(){ $("#sendInfo").click( function(){ var showValue = $('#messageformtr').css('display'); if(showValue == "block"){ var sys = getBrowser(); if(sys.browser=="msie"){ $("#selectPeople").addClass("autoTD"); }else{ $("#sendInfoTable").addClass("autoLineFeed"); } } } ); }) </script>