На мобильной версии сайта не работает меню на Bootstrap 4

250
10 января 2019, 21:30

В мобильной версии меню не работает, в п версии все работает. Не добавляет класс active, игнорируется. хотя в п версии все работает как добавить хитрый клик или может что изменить в самом файле Bootstrap 4 Уже все пробовали

       (function ($) { 
        $(document).ready(function () { 
            var windowWidth = $(window).width(); 
            documentScrollTop = $(document).scrollTop(); 
            //ТАБУЛЯТОРЫ МЕНЮ 
 
            $('.lp-tabs').each(function () { 
                var tabs = $(this), 
                    tabsTitlesNames = []; 
                tabs.find('div[data-tab-title]').each(function () { 
                    tabsTitlesNames.push($(this).attr('data-tab-title')); 
                }).addClass('lp-tab'); 
                tabs.wrapInner('<div class="lp-tabs-content"></div>'); 
                tabs.prepend('<div class="lp-tabs-titles"><div class="menuToggle"><a><img src="img/burger!.png"></a></div><ul class="menu clearfix"></ul></div>'); 
                var tabsTitles = tabs.find('.lp-tabs-titles'), 
                    tabsContent = tabs.find('.lp-tabs-content'), 
                    tabsContentTabs = tabsContent.find('div[data-tab-title]'); 
                tabsTitlesNames.forEach(function (value) { 
                    tabsTitles.find('ul').append('<li>' + value + '</li>'); 
                }); 
                var tabsTitlesItems = tabsTitles.find('ul li'); 
                tabsTitlesItems.eq(0).addClass('active'); 
                tabsContentTabs.eq(0).addClass('active').show(); 
                tabsContent.height(tabsContent.find('.active').outerHeight()); 
                tabsTitlesItems.on('click', function () { 
                    if (!tabs.hasClass('changing')) { 
                        tabs.addClass('changing'); 
                        var curTab = tabsContent.find('.active'), 
                            nextTab = tabsContentTabs.eq($(this).index()); 
                        tabsTitlesItems.removeClass('active'); 
                        $(this).addClass('active'); 
                        var curHeight = curTab.outerHeight(); 
                        nextTab.show(); 
                        var nextHeight = nextTab.outerHeight(); 
                        nextTab.hide(); 
                        if (curHeight < nextHeight) { 
                            tabsContent.animate({ 
                                heigh: nextHeight 
                            }, 500) 
                        } 
                        curTab.fadeOut(500, function () { 
                            if (curHeight > nextHeight) { 
                                tabsContent.animate({ 
                                    heigh: nextHeight 
                                }, 500) 
                            } 
                            nextTab.fadeIn(500, function () { 
                                curTab.removeClass('active'); 
                                nextTab.addClass('active'); 
                                tabs.removeClass('changing'); 
                            }); 
                        }); 
                    } 
                }); 
                $(window).on('resize', function () { 
                    tabsContent.height(tabsContent.find('.active').outerHeight()); 
                }); 
            }); 
 
            //ADAPTATION 
 
            $(function(){ 
                var pull = $('.menuToggle'); 
                menu = $('.menu'); 
                menuHeight  = menu.height(); 
 
 
                $(window).scroll(function() { 
                    var $block = $('.menuToggle'); 
                    if($(window).scrollTop() > 50) { 
                        $block.addClass('fixed'); 
                    } else { 
                        $block.removeClass('fixed'); 
                    } 
                }); 
 
                $(pull).on('click', function() { 
                    if (windowWidth < 768) { 
                        $('body,html').animate({scrollTop: 0}, 500); 
                        $(menu).slideToggle(200, function () { 
                            $('.news, .tour, .band, .store, .albums, .videos, .photoes').css('margin-top', '300px'); 
                            if ($('.menu').css('display') === "none") { 
                                $(this).removeAttr('style'); 
                                $('.news, .tour, .band, .store, .albums, .videos, .photoes').css('margin-top', '0'); 
                            } 
                        }); 
 
                    } 
                }); 
 
                $(pull).on('click', function() { 
                    if (windowWidth < 768) { 
                        $('body,html').animate({scrollTop: 0}, 500); 
                        $(menu).slideToggle(200, function () { 
                            $('.news, .tour, .band, .store, .albums, .videos, .photoes').css('margin-top', '300px'); 
                            if ($('.menu').css('display') === "none") { 
                                $(this).removeAttr('style'); 
                                $('.news, .tour, .band, .store, .albums, .videos, .photoes').css('margin-top', '0'); 
                            } 
                        }); 
    })(jQuery);

READ ALSO
Объединение 2-х БД

Объединение 2-х БД

Задача такова: нужно объединить две БД с заменой идентификаторов PRIMARY KEY на null (чтобы mysql не ругался на схожие записи)Возможно это сделать с помощью...

260
Mysql Update с помощью переменных

Mysql Update с помощью переменных

как реализовать следующий mysql запрос? var sql = "UPDATE some_table SET ? = ? WHERE id = ?";

210
Как убрать рамку для button/input? [закрыт]

Как убрать рамку для button/input? [закрыт]

Рылся в интернете находил много всякой информации на мою тему, но ничего из найденного не помогаетМожет вы поможете

204
Как выполнить js код введенный через input?

Как выполнить js код введенный через input?

Вообщем, у меня есть кнопка и поле для ввода:

188