Home › Forums › JavaScript › Close menu on click of Options button and outside of container › Reply To: Close menu on click of Options button and outside of container
April 10, 2016 at 11:12 am
#240387
Shikkediel
Participant
Yeah, you’d have to copy the HTML from the page source. Raw PHP won’t work on someone else’s server. But the code seems to be working fine :
jQuery(document).ready(function($) {
$('.bbp-admin-links:even').css({position: 'absolute', right: '380px'});
$('.bbp-meta ul.bbp_custom_links_menu li.parent > a').click(function(e) {
$(this).next('.bbp_custom_links_submenu').toggle();
e.preventDefault();
})
.mouseup(function(e) {
e.stopPropagation();
});
$(document).mouseup(function(e) {
if ($(e.target).closest('.bbp_custom_links_submenu').length === 0) {
// Not within the container
$('.bbp_custom_links_submenu').hide();
}
});
});