$(document).ready(function(){ $('ul[class$="_slidelst"]').each(function(){ var options = { mode: 'horizontal', auto: true, autoControls: true, autoControlsCombine: true, controls: true, pager: true, speed: 750, pause: 5000, nextSelector: '', prevSelector: '', startText: '', stopText: '', onSliderLoad: function(){}, onSlideAfter: function(){}, onSlideBefore: function(){}, preloadImages: 'visible', useCSS: true, touchEnabled: true, responsive: true, keyboardEnabled: true, infiniteLoop: true } if ($(this).find('li').length === 1){ options.auto = false; options.pager = false; } if($(this).attr('class') == "mMain3_slidelst"){ var mMain3 = options; mMain3.auto = false; mMain3.autoControls = false; mMain3.autoControlsCombine = false; mMain3.nextSelector = '.ctrl_next'; mMain3.prevSelector = '.ctrl_prev'; mMain3.pause = 4000; mMain3.onSliderLoad = function(currentIndex){ $(".mMain3_slidelst li:not([class='bx-clone'])").eq(0).addClass("active"); $("#slideNum .current-index").text("0" + (currentIndex+1)); $(".bx-clone").find("a").prop("tabIndex","-1"); }; mMain3.onSlideAfter = function(currentSlide, totalSlides, currentSlideHtmlObject){ currentSlide.addClass("active"); $(".mMain3_slidelst").children("li").each(function(){ if($(this).attr("aria-hidden") == "false"){ $(this).find("a").attr("tabIndex","0"); }else{ //$(this).find("a").attr("tabIndex","-1"); } }); }; mMain3.onSlideBefore = function($slideElement, oldIndex, newIndex){ $(".mMain3_slidelst").find("li").removeClass("active"); $("#slideNum .current-index").text("0"+(newIndex+1)); }; $("#slideNum").prepend(""); var mMain3Slider = $(this).bxSlider(mMain3); $(window).bind("load resize",function(){ mMain3Slider.reloadSlider(mMain3); }); $("#slideNum").append("0"+mMain3Slider.getSlideCount()); $('.mMain3_slidelst a').focusin(function(){ mMain3Slider.stopAuto(); }); } }); });