...
|
...
|
@@ -5,14 +5,23 @@ |
|
|
*/
|
|
|
|
|
|
|
|
|
var Swiper = require('yoho.iswiper');
|
|
|
var Swiper = require('yoho.iswiper'),
|
|
|
$ = require('jquery');
|
|
|
|
|
|
var recommendSwiper;
|
|
|
var recommendSwiper,
|
|
|
$recommendForYou = $('.recommend-for-you');
|
|
|
|
|
|
recommendSwiper = new Swiper('#swiper-recommend', {
|
|
|
slidesPerView: 'auto',
|
|
|
grabCursor: true,
|
|
|
slideElement: 'li',
|
|
|
lazyLoading: true,
|
|
|
watchSlidesVisibility: true
|
|
|
$.get('/home/preference').then(function(html) {
|
|
|
$recommendForYou.html(html);
|
|
|
if ($('#swiper-recommend').length) {
|
|
|
recommendSwiper = new Swiper('#swiper-recommend', {
|
|
|
slidesPerView: 'auto',
|
|
|
grabCursor: true,
|
|
|
slideElement: 'li',
|
|
|
lazyLoading: true,
|
|
|
watchSlidesVisibility: true
|
|
|
});
|
|
|
}
|
|
|
}).fail(function() {
|
|
|
$recommendForYou.hide();
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|