在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML5  HTML/ 點(diǎn)擊變顏色和display='none';display='block';在IE

點(diǎn)擊變顏色和display='none';display='block';在IE瀏覽器下沒有生效怎么改?

<div class="time_title">
國內(nèi)展會圖片描述
國外展會
</div>
<div class="table">
</div>
<div class="table" style="display: none;">
</div>
.time_title a {

display: inline-block;
width: 99px;
height: 30px;
background: #ab95ff;
border-radius: 30px;
font-family: "宋體";
font-size: 12px;
text-align: center;
line-height: 30px;
color: black;
margin-right: 25px;

}
.table {

/*border: 1px solid;*/
width: 1094px;
position: absolute;
left: 98px;

}
<script type="text/javascript">
function sure (key) {
var bt1 = document.getElementById('bt1');
var bt2 = document.getElementById('bt2');
var table = document.getElementsByClassName('table')[0];
var table1 = document.getElementsByClassName('table')[1];
bt1.style.backgroundColor="#ab95ff";
bt2.style.backgroundColor="#ab95ff";
table.style.display='block';
table1.style.display='none';
if(key==1){
bt1.style.backgroundColor="#e5deff";
table.style.display='block';
table1.style.display='none';
}else if(key==2){
bt2.style.backgroundColor="#e5deff";
table.style.display='none';
table1.style.display='block';
}
}
</script>

回答
編輯回答
紓惘
  1. 確定只在ie中不生效?
  2. 確定js中的sure函數(shù)有沒有執(zhí)行?
  3. 調(diào)試中查看點(diǎn)擊后樣式有沒有生效,就算沒有生效它也會把樣式加上去的,只是警告而已。
2017年8月14日 23:52
編輯回答
風(fēng)畔

你用的ie幾啊?我把你的代碼拿到ie9下面試了,是可以成功的

2017年2月27日 03:56