gilbitron / Dropit

Dropit is a jQuery plugin for single level dropdown menu's
153 stars 74 forks source link

Problem with click on submenu link #18

Open stojankukrika opened 9 years ago

stojankukrika commented 9 years ago

Hi. I have a problem with dopit plugin. I create a submenu and put this in custom.js file: $(document).ready(function() { $('.nav-drop').dropit(); });

This is result: Image of problem I type a links to user can change language, but when I click nothings happened. Can you help me? P.S. Link what I like to click is below. In ul class "list nav-drop-menu", li childrens a tag. sorry for bad marker.

Garric15 commented 9 years ago

The problem is on the line 32 of dropit.js of v1.0 and line 35 of v1.1.0.

Change return false; by return;

The return false override the click.

shadialnamrouti commented 8 years ago

@Garric15 is right:

$el.on(settings.action, settings.this, function() {
                        if ($(this).hasClass('active-drop')) {
                            $(this).removeClass('active-drop');
                            return true; /////////////// It was return false which will prevent href action
                        }
                        settings.beforeHide.call(this);
                        $('.active-drop').removeClass('active-drop');
                        settings.afterHide.call(this);
                        settings.beforeShow.call(this);
                        $(this).addClass('active-drop');
                        settings.afterShow.call(this);
                        return false;
                    });