guten tag,
beim öffnen einer Box, möchte ich diese schließen sobald man irgendwo anders hinklickt, außer auf die Box. Hat jemand ne Ahnung wie das funktioniert?
Zurzeit sieht es so aus:
HTML:
Spoiler anzeigen
JS:
Spoiler anzeigen
JavaScript
$('.full-ident-username').on('click', function() {
var isActive = $(this).hasClass('profile_active');
if(isActive) {
// Schließe Box
$(this).removeClass('profile_active');
$('.user-show-profile').removeClass('user-show-profile-active');
$('.icon-down-dir').html('');
} else {
// Öffne Box
$(this).addClass('profile_active');
$('.user-show-profile').addClass('user-show-profile-active');
$('.icon-down-dir').html('');
}
});
Alles anzeigen