I have a file in which I call functions. Some of them do not work. But if the non-working function is moved to another location of this file, it starts working. I understand that the case is most likely in syntax, but I can not find the error. I hope for help. File contents:
$(document).ready(function() { $(".mapopen").click(function() { $(".mapblock").toggle(); $(".viewsr").hide(); }); $(".close").click(function() { $(".mapblock").hide(); }); $("#closform").click(function() { $(".oformlenie").hide(); }); $(".cartt button").click(function() { $(".oformlenie").show(); }); $(".viewopen").click(function() { $(".viewsr").toggle(); $(".mapblock").hide(); }); $(".prim").click(function() { $(".cbox").toggle(); }); $(".viewclose").click(function() { $(".viewsr").hide(); }); $.ionTabs("#tabs_1, #tabs_2, #tabs_3, #tabs_4, #otzivi", { type: "none" }); $(".rslides").responsiveSlides({ auto: true, // Boolean: Animate automatically, true or false speed: 500, // Integer: Speed of the transition, in milliseconds timeout: 4000, // Integer: Time between slide transitions, in milliseconds pager: true, // Boolean: Show pager, true or false nav: false, // Boolean: Show navigation, true or false random: false, // Boolean: Randomize the order of the slides, true or false pause: false, // Boolean: Pause on hover, true or false pauseControls: true, // Boolean: Pause when hovering controls, true or false prevText: "", // String: Text for the "previous" button nextText: "", // String: Text for the "next" button maxwidth: "", // Integer: Max-width of the slideshow, in pixels navContainer: "", // Selector: Where controls should be appended to, default is after the 'ul' manualControls: "", // Selector: Declare custom pager navigation namespace: "rslides", // String: Change the default namespace used before: function() {}, // Function: Before callback after: function() {} // Function: After callback }); $(".rslides2, .rslides3, .rslides4, .rslides5, .rslides6, .rslides7, .c1").responsiveSlides({ auto: true, nav: true, prevText: "", // String: Text for the "previous" button nextText: "" }); $('.crsl-items').carousel({ speed: 1000, autoRotate: 6000, visible: 4, carousel: true }); $(".boxvideo").fitVids(); $('select').styler({ selectSmartPositioning: '-1' }); $('.slide__link').on('click', function(e) { e.preventDefault(); var $this = $(this), item = $this.closest('.slide__item'), wrap = $this.closest('.slideShow'), gap = wrap.find('.slide__gap'), itemPath = $this.find('img').attr('src'), dur = 500; if (!item.hasClass('activSl')) { item.addClass('.activSl').siblings().removeClass('activSl'); gap.find('img').fadeOut(dur, function() { $(this).attr('src', itemPath).fadeIn(dur); }); } }); //Галерея товара }); $(window).load(function() { }) With this arrangement
$(".boxvideo").fitVids(); $('select').styler({ selectSmartPositioning: '-1' }); The last function does not work.