ie正常 我有个div
<div name="dragMngDIV" id="dragMngDIV" class="dragMngDIV" style="display:none;"></div>
<button class="btn_2" onclick="viewMMngBox()">
增删模块
</button>
function viewMMngBox(){
var mMngBox=document.getElementById('dragMngDIV');
if(mMngBox.style.display=='none'){
mMngBox.style.display='block';
}else{
mMngBox.style.display='none';
}
}火狐浏览器上我点击按钮增上模块!页面会显示一下然后忽然又隐藏了!我仔细观察发现页面刷新了!怎么解决! 怎么解决! 他怎么自动刷新!
<div name="dragMngDIV" id="dragMngDIV" class="dragMngDIV" style="display:none;"></div>
<button class="btn_2" onclick="viewMMngBox()">
增删模块
</button>
function viewMMngBox(){
var mMngBox=document.getElementById('dragMngDIV');
if(mMngBox.style.display=='none'){
mMngBox.style.display='block';
}else{
mMngBox.style.display='none';
}
}火狐浏览器上我点击按钮增上模块!页面会显示一下然后忽然又隐藏了!我仔细观察发现页面刷新了!怎么解决! 怎么解决! 他怎么自动刷新!
就是这问题。你点按钮的时候本来是正确的,但这里又重新载入,重新载入时它的默认状态是style="display:none;",所以肯定会隐藏了