recommend-for-you-product-desc.js
735 Bytes
/**
* 为您优选
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/11/16
*/
var Swiper = require('yoho.iswiper'),
$ = require('jquery');
var recommendSwiper,
$recommendForYou = $('.recommend-for-you'),
productSkn = $('#productSkn').val();
$.get('/product/detail/preference', {productSkn: productSkn}).then(function(html) {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}).fail(function() {
$recommendForYou.hide();
});