Hide slide menu when user clicks outside the menu?


#1

http://samarassrtestblog.blogspot.com/

insrted code for slideout menu, but how can i make that menu close automatically when clicks outside the menu i.e., anywhere on the body of the blog ?

thanks in advance

SamaraSsr

[Character limit} [Character limit}


#2

@technohalf any help?

{character limit ]


#3

use this script to do your work

<script type="text/javascript">$(function(){$('.sammenu').click(function(){$('#css-sammenu').css({right:'0'})$("body").addClass("close-sammenu")});$('.close-sammenu').click(function(){$('#css-sammenu').css({right:'-340px'})})});$(document).click(function(event){if(!$(event.target).closest('.sammenu').length){if($('#css-sammenu').is(":visible")){$('#css-sammenu').css({right:'-340px'})}}})</script>

replace this script with above script

<script type='text/javascript'>$(function(){$('.sammenu').click(function(){$('#css-sammenu').css({right:'0'})});$('.close-sammenu').click(function(){$('#css-sammenu').css({right:'-340px'})})});</script>


#4

Menu is not working after inserting your code


#5

provide me the template upload it here or you can send it to my email id