jquery实现点击元素,若是弹出层隐藏则显示,显示则隐藏

点击按钮id="buttonA";css

弹出层 id="divcontent"ide

事件onclik   函数   showandhide函数

<button id="buttonA" onclick="showandhide()"></button>事件

function showandhide(){io

    if($("#divcontent").css("display")=="none"){//隐藏function

        $("#divcontent").show();cli

    }di

    else{co

        $("#divcontent").hide();display

    }

}

相关文章
相关标签/搜索