Dropdown menu only works once

Asked

Viewed 28 times

0

I’m creating a blog and since I don’t have much knowledge in the programming area I took a template ready just to modify, but I noticed only one problem in it that I can’t solve, a dropdown menu that has only works once, that is, when opening the site the first time and hovering over the dropdown it works, but when passing again it no longer works, I have already tested in different browsers and the error happens in all. As I said, I have little knowledge, so I didn’t want to mess with the code.

I’m going to leave here the HTML part of the menu, a Javascript function that I believe is dropdown but I’m not sure and the error that I was able to see through the Chrome console, this error aocntece the first time you hover over the menu. If you want more part of the code just say that I seek and put here, and if you want to access the site to see the error is www.skypoint.com.br.

Who can give a help to see the problem has solution thank you.

    VM221:1491 Uncaught TypeError: jQuery.easing[jQuery.easing.def] is not a function
        at Object.swing (VM221:1491)
        at init.run (jquery.min.js:2)
        at a (jquery.min.js:2)
        at Function.v.fx.timer (jquery.min.js:2)
        at Kn (jquery.min.js:2)
        at HTMLUListElement.o (jquery.min.js:2)
        at Function.dequeue (jquery.min.js:2)
        at HTMLUListElement.<anonymous> (jquery.min.js:2)
        at Function.each (jquery.min.js:2)
        at init.each (jquery.min.js:2)

  (function ($) {
    $.fn.mobileMenu = function (b) {
        var c = {
                defaultText: "Navigate to...",
                className: "select-menu",
                subMenuClass: "sub-menu",
                subMenuDash: "&ndash;"
            },
            settings = $.extend(c, b),
            el = $(this);
        this.each(function () {
            el.find("ul").addClass(settings.subMenuClass);
            $("<select />", {
                "class": settings.className,
                "title": settings.defaultText
            }).insertAfter(el);
            $("<option />", {
                "value": "#",
                "text": settings.defaultText
            }).appendTo("." + settings.className);
            el.find("a").each(function () {
                var a = $(this),
                    optText = "&nbsp;" + a.text(),
                    optSub = a.parents("." + settings.subMenuClass),
                    len = optSub.length,
                    dash;
                if (a.parents("ul").hasClass(settings.subMenuClass)) {
                    dash = Array(len + 1).join(settings.subMenuDash);
                    optText = dash + optText
                }
                $("<option />", {
                    "value": this.href,
                    "html": optText,
                    "selected": this.href == window.location.href
                }).appendTo("." + settings.className)
            });
            $("." + settings.className).change(function () {
                var a = $(this).val();
                if (a !== "#") window.location.href = $(this).val()
            })
        });
        return this
    }
})(jQuery);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<li><a href='#'>Categorias</a>
  <ul class='sub-menu'>
    <li><a href='#'>Geral</a></li>
    <li><a href='#'>Performance</a></li>
    <li><a href='#'>Segurança</a></li>
    <li><a href='#'>Técnico</a></li>
  </ul>
</li>

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.