Answer the question
In order to leave comments, you need to log in
Bootstrap $(...).tab is not a function error in the Bitrix template that occurs every other time. How to understand what is wrong?
Good afternoon, help me figure it out.
There is a site on bitrix. I'm making a template and here's the problem.
There is a catalog.element component in script.js like this
(function (window) {
'use strict';
if (window.CatalogElement)
return;
window.CatalogElement = function (arParams , ajaxParams) {
this.params = arParams;
this.ajaxParams = ajaxParams;
this.tabs = {
obTabs: BX('tabs-nav'),
obTabsScroll: 'tabs-nav-scroll',
objTopTabNav: {
description: BX('description-tab'),
characteristic: BX('characteristic-tab'),
set: BX('set-tab'),
video: BX('video-tab'),
documents: BX('documents-tab'),
payment: BX('payment-tab'),
delivery: BX('delivery-tab')
},
objScrollTabNav: {
description: BX('description-tab-fix'),
characteristic: BX('characteristic-tab-fix'),
set: BX('set-tab-fix'),
video: BX('video-tab-fix'),
documents: BX('documents-tab-fix'),
payment: BX('payment-tab-fix'),
delivery: BX('delivery-tab-fix')
}
};
this.error = {};
this.init();
};
window.CatalogElement.prototype = {
init: function ()
{
this.initTabs();
},
/* region Tabs */
initTabs: function()
{
BX.bind(this.tabs.objTopTabNav.description , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objTopTabNav.characteristic , 'click', BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objTopTabNav.set , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objTopTabNav.video , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objTopTabNav.documents , 'click', BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objTopTabNav.payment , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objTopTabNav.delivery , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objScrollTabNav.description , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objScrollTabNav.characteristic , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objScrollTabNav.set , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objScrollTabNav.video , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objScrollTabNav.documents , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objScrollTabNav.payment , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(this.tabs.objScrollTabNav.delivery , 'click' , BX.proxy(this.tabSelect, this));
BX.bind(BX('characteristic-link') , 'click' , BX.proxy(this.tabSelect, this));
},
tabSelect: function()
{
var element = BX.proxy_context;
$('html, body').animate({ scrollTop: $($(element).attr('href')).offset().top }, 1500);
$($(element).attr('href')).tab('show');
},
};
})(window);
<?php
/**Common CSS Files **/
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . '/bootstrap/bootstrap.min.css');
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . '/css/animate.min.css');
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . '/css/hover-min.css');
Asset::getInstance()->addCss(SITE_TEMPLATE_PATH . '/css/all.min.css');
/**Common JS Files **/
Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . '/js/jquery-3.3.1.min.js');
Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . '/js/bootstrap.bundle.min.js');
?>
Answer the question
In order to leave comments, you need to log in
In short, I don’t know why it happened, but when I removed the transport company widget from the page, everything worked out. I accidentally removed it and the glitch stopped, I put it back and the glitch continues. I don’t know why, because it has never been displayed in errors, in general, if there are such problems, just turn everything off and connect everything in turn.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question