problem description
The menu bar is located on the far right of the body. The hidden way is to display the right:0; when the right:-135px; clicks the button.
close the right:-135px; to hide and close the effect. What you still want to achieve now is how to achieve the effect of hiding and closing when you click on a page other than the menu bar. By the way, is it appropriate for me to display and hide the menu bar in this way?
the environmental background of the problems and what methods you have tried
tried using $(document). Click (function () {.})
but to no avail
related codes
/ / Please paste the code text below (do not replace the code with pictures)
//
$("-sharpnav_open").click(function(){
$("-sharpnav_big_div").css("right","0");
$("-sharpnav_big_div").css("transition",".5s");
})
$("-sharpnav_close").click(function(){
$("-sharpnav_big_div").css("right","-350px");
})
what result do you expect? What is the error message actually seen?
you can close the menu bar that is displayed when you want to click elsewhere on the page.