Template:NavBar
From 2014.igem.org
(Difference between revisions)
m |
m |
||
Line 140: | Line 140: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
if (!!('ontouchstart' in window)){ | if (!!('ontouchstart' in window)){ | ||
- | $('.dropToggle' | + | $('.dropToggle').click(function(e) { |
- | $('.navDropMenu', this). | + | $('.navDropMenu').slideToggle(200); |
+ | $('.dropToggle').toggleClass('active'); | ||
+ | e.stopPropagation(); | ||
+ | }); | ||
+ | $(document).click(function() { | ||
+ | if ($('.navDropMenu').is(':visible')) { | ||
+ | $('.navDropMenu', this).slideUp(); | ||
+ | $('.dropToggle').removeClass('active'); | ||
+ | } | ||
}); | }); | ||
- | |||
- | |||
- | |||
- | |||
} | } | ||
}); | }); | ||
</script> | </script> | ||
<html> | <html> |
Revision as of 15:16, 31 January 2014