Answer the question
In order to leave comments, you need to log in
Why don't tabs work on mobile phones?
I wrote tabs, it works well from a computer, but when I go from a mobile phone, or when I turn on the inspector in the browser, the tabs are pressed 2-3 times and performance is turned off.
/*tabs*/
;!(function ($) {
$.fn.classes = function (callback) {
var classes = [];
$.each(this, function (i, v) {
var splitClassName = v.className.split(/\s+/);
for (var j = 0; j < splitClassName.length; j++) {
var className = splitClassName[j];
if (-1 === classes.indexOf(className)) {
classes.push(className);
}
}
});
if ('function' === typeof callback) {
for (var i in classes) {
callback(classes[i]);
}
}
return classes;
};
})(jQuery);
$('.TVCatNavButton, .TVOrderContinue').click(function() {
$('.TVCatNav .TVCatNavActive').removeClass('TVCatNavActive');
var activ_button_tab = $(this).classes()[2];
$('.' + activ_button_tab).addClass('TVCatNavActive');
$('.TVLayerSwitch .TVCatAboutHotel').addClass('TVHide');
var activ_tab = $(this).classes()[0];
$('.TVLayerSwitch .TVCatAboutHotel.' + activ_tab).removeClass('TVHide');
if ($('.TVLayerSwitch .TVNavPrice').hasClass('TVHide') != true) {
$('.TVOrderContinue').addClass('flow-disable');
} else {
$('.TVOrderContinue').removeClass('flow-disable');
}
});
Answer the question
In order to leave comments, you need to log in
Tabs are :hover ?
If yes, try clicking twice,
instead of clicking on on('click, touch')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question