From 605e73cddb4235b15cb19ae7d3be1ccf8ca6e95c Mon Sep 17 00:00:00 2001 From: Веталь Date: Wed, 8 Feb 2017 14:42:56 +0200 Subject: [PATCH] -collection --- frontend/web/js/new_script.js | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/frontend/web/js/new_script.js b/frontend/web/js/new_script.js index 6edc178..50fb4de 100755 --- a/frontend/web/js/new_script.js +++ b/frontend/web/js/new_script.js @@ -146,21 +146,34 @@ $(document).ready(function () { }); - $('#collection').click(function () { - $('.collection .new_collection').owlCarousel({ - navigation:true, - navigationText: [], - responsiveClass: true, - loop:true, - items:2, - itemsDesktop : false, - itemsDesktopSmall : false, - itemsTablet: false, - itemsMobile : false, - mouseDrag:false - - - }); - }) + + var windowWidth = $(window).width(); + if(windowWidth<=1200){ + restart() + } + $(window).resize(function () { + var windowWidth2 = $(window).width(); + if(windowWidth2<=1200){ + restart() + } + }) + function restart() { + $('#collection').click(function () { + $('.collection .new_collection').owlCarousel({ + navigation:true, + navigationText: [], + responsiveClass: true, + loop:true, + items:2, + itemsDesktop : false, + itemsDesktopSmall : false, + itemsTablet: false, + itemsMobile : false, + mouseDrag:false + + + }); + }) + } }) \ No newline at end of file -- libgit2 0.21.4