Skip to content

Commit 023062c

Browse files
authored
Improvement for custom sliders and menu
1 parent 037bac8 commit 023062c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

view/frontend/templates/lazy.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@
6868
});
6969
}
7070

71-
var navSectionsNavigation = document.querySelector('.nav-sections .navigation');
72-
if(navSectionsNavigation) {
73-
navSectionsNavigation.addEventListener("click", handlerMouseEvent, false);
74-
navSectionsNavigation.addEventListener("mouseenter", handlerMouseEvent, false);
75-
}
71+
document.querySelectorAll('.nav-sections .navigation, .navigation-bar').forEach(function(el){
72+
el.addEventListener("click", handlerMouseEvent, false);
73+
el.addEventListener("mouseenter", handlerMouseEvent, false);
74+
});
75+
7676
function handlerMouseEvent(e) {
7777
e.target.querySelectorAll('img[data-original^="h"],source[data-originalset^="h"]').forEach(function (el) {
7878
replacePixelImage(el);
@@ -82,7 +82,7 @@
8282

8383
/* Fix for sliders */
8484
var intr = setInterval(function(){
85-
var sliders = document.querySelectorAll('.slick-track, .swiper-wrapper, .owl-carousel');
85+
var sliders = document.querySelectorAll('.slick-track, .swiper-wrapper, .owl-carousel, .carousel-inner');
8686
if (!sliders.length) clearInterval(intr);
8787
sliders.forEach(function(el) {
8888
var imgs = el.querySelectorAll('img,source');

0 commit comments

Comments
 (0)