javascript - Mailto or hyperlink doesn't work on footer menu due to submenu script -



javascript - Mailto or hyperlink doesn't work on footer menu due to submenu script -

do submenu script mailto link or hyperlink doesn't work , don't why , in script causes problems.

$(function () { $('footer > ul > li a').click(function(event) { event.preventdefault(); event.stoppropagation(); var $parentli = $(this).closest('li'); $parentli.siblings('li').find('ul:visible').hide(); $parentli.find('> ul').stop().toggle(); }); }); $(document).click(function() { $("footer ul li ul").hide(); });

fiddle: http://jsfiddle.net/foroloca/65t6gk5n/

you're calling event.preventdefault();. prevents default functionality of event, , prevents link beingness fired.

if need functionality in place other a elements in footer, suggest add together class name , modify event handler apply elements:

<ul> <li> <a href="..." class="prevent-default">...</a> </li> <li> <a href="mailto:...">...</a> </li> ... </ul> class="lang-js prettyprint-override">$('footer > ul > li a.prevent-default').click(function(event) { event.preventdefault(); ... });

jsfiddle demo.

javascript onclick footer submenu mailto

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -