相容性:jquery在ie7下的(Rowspan)屬性賦值問題
阿新 • • 發佈:2019-02-19
<script type="text/javascript">
$(document).ready(function(){
var bro=$.browser;
if(bro.msie) {binfo="Microsoft Internet Explorer "+bro.version;}
if(bro.mozilla) {binfo="Mozilla Firefox "+bro.version;}
if(bro.safari) {binfo="Apple Safari "+bro.version;}
if(bro.opera) {binfo="Opera "+bro.version;}
alert(binfo);
$("#zhankai").click(function(){
$("#tr1").slideToggle();
if($(this).parent().attr("rowspan")!=null&&$(this).parent().attr("rowspan")!="1")
{
//收起
$(this).parent().removeAttr("rowspan");
}
else
{
//展開
$(this).parent().attr("Rowspan","2");
}
});
});
</script>
<table width="100%" border=1> <tr> <td><a id="zhankai" href="#">點我展開</a></td> <td>1</td> <td>2</td> <td>3</td> </tr> <tr style="display:none" id="tr1"> <td>4</td> <td>5</td> <td>6</td> </tr> </table>