日期:2014-05-16 浏览次数:20328 次
document.documentElement.onclick = function() { document.getElementById('need_hide').style.display = 'none'; }
function stopPropagation(e) { e = e || window.event; if(e.stopPropagation) { //W3C阻止冒泡方法 e.stopPropagation(); } else { e.cancelBubble = true; //IE阻止冒泡方法 } } document.getElementById('need_hide').onclick = function(e) { stopPropagation(e); }
document.getElementById('btn_show').onclick = function(e) { document.getElementById('need_hide').style.display = 'block'; stopPropagation(e); }