Commit 605e73cddb4235b15cb19ae7d3be1ccf8ca6e95c
1 parent
0709701f
-collection
Showing
1 changed file
with
29 additions
and
16 deletions
Show diff stats
frontend/web/js/new_script.js
... | ... | @@ -146,21 +146,34 @@ $(document).ready(function () { |
146 | 146 | |
147 | 147 | |
148 | 148 | }); |
149 | - $('#collection').click(function () { | |
150 | - $('.collection .new_collection').owlCarousel({ | |
151 | - navigation:true, | |
152 | - navigationText: [], | |
153 | - responsiveClass: true, | |
154 | - loop:true, | |
155 | - items:2, | |
156 | - itemsDesktop : false, | |
157 | - itemsDesktopSmall : false, | |
158 | - itemsTablet: false, | |
159 | - itemsMobile : false, | |
160 | - mouseDrag:false | |
161 | - | |
162 | - | |
163 | - }); | |
164 | - }) | |
149 | + | |
150 | + var windowWidth = $(window).width(); | |
151 | + if(windowWidth<=1200){ | |
152 | + restart() | |
153 | + } | |
154 | + $(window).resize(function () { | |
155 | + var windowWidth2 = $(window).width(); | |
156 | + if(windowWidth2<=1200){ | |
157 | + restart() | |
158 | + } | |
159 | + }) | |
160 | + function restart() { | |
161 | + $('#collection').click(function () { | |
162 | + $('.collection .new_collection').owlCarousel({ | |
163 | + navigation:true, | |
164 | + navigationText: [], | |
165 | + responsiveClass: true, | |
166 | + loop:true, | |
167 | + items:2, | |
168 | + itemsDesktop : false, | |
169 | + itemsDesktopSmall : false, | |
170 | + itemsTablet: false, | |
171 | + itemsMobile : false, | |
172 | + mouseDrag:false | |
173 | + | |
174 | + | |
175 | + }); | |
176 | + }) | |
177 | + } | |
165 | 178 | |
166 | 179 | }) |
167 | 180 | \ No newline at end of file | ... | ... |