如题 要怎么做啊 我JS完全不会啊
var menuLeft = document.getElementById( 'cbp-spmenu-s1' ),
showLeftPush = document.getElementById( 'showLeftPush' ),
body = document.body;
showLeftPush.onclick = function() {
classie.toggle( this, 'active' );
classie.toggle( body, 'cbp-spmenu-push-toright' );
classie.toggle( menuLeft, 'cbp-spmenu-open' );
disableOther( 'showLeftPush' );
};
function disableOther( button ) {
if( button !== 'showLeftPush' ) {
classie.toggle( showLeftPush, 'disabled' );
}
}
点击空白就隐藏怎么改
达到你所说的效果很简单
<input type="button" onclick="Show();" value="显示" />设置一个隐藏层,点击按钮的时候改变隐藏层的display属性,将隐藏层显示出来。
再给隐藏层设置一个Hide()点击方法,点击隐藏层再次隐藏。
望采纳!
追问大神 可加企鹅详聊吗
追答代码效果不行吗?
二九四二七六九一九
哥们,帮忙采纳一下!谢谢!
可以参考这个!
document.onclick = function(){
//隐藏层代码
};
div.onclick = function(oEvent){
//取消冒泡
oEvent = oEvent || window.event;
if(document.all){
oEvent.cancelBubble = true;
}else{
oEvent.stopPropagation();
}
};