Monday, January 7, 2013

click to show div and outside click to hide div

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script language="javascript">
$(document).mouseup(function (e)
{
    var container = $(".form_wrapper");

    if (container.has(e.target).length == 0)
    {
        container.hide();
    }
});
function showdiv(){

document.getElementById('form_wrapper').style.display='block';

}
</script>
<div class="form_wrapper" id="form_wrapper" style="display:none">
show div and your menu
</div>
<a  href="javascript:;" onClick="showdiv();">show</a>

i hope its help

No comments:

Post a Comment