...
|
...
|
@@ -5,10 +5,12 @@ |
|
|
*/
|
|
|
|
|
|
var $ = require('jquery'),
|
|
|
Hammer = require('hammer'),
|
|
|
tip = require('../plugin/tip'),
|
|
|
lazyLoad = require('yoho.lazyload');
|
|
|
|
|
|
var winH = $(window).height(),
|
|
|
var navHammer,
|
|
|
winH = $(window).height(),
|
|
|
loadMoreH = $('#load-more').height(),
|
|
|
$goodList = $('#goods-list'),
|
|
|
loading = false,
|
...
|
...
|
@@ -35,8 +37,11 @@ if (kidsType) { |
|
|
|
|
|
$curNav = $navList.children('.focus');
|
|
|
|
|
|
$('#maybe-like-nav').delegate('li', 'tap', function() {
|
|
|
var $this = $(this),
|
|
|
navHammer = new Hammer($navList[0]);
|
|
|
navHammer.on('tap', function(e) {
|
|
|
var $this = $(e.target).closest('li'),
|
|
|
//$('#maybe-like-nav').delegate('li', 'touchstart', function() {
|
|
|
// var $this = $(this),
|
|
|
$goods = $('.goods-list'),
|
|
|
$content;
|
|
|
|
...
|
...
|
@@ -59,9 +64,18 @@ $('#maybe-like-nav').delegate('li', 'tap', function() { |
|
|
$(document).trigger('scroll'); //Trigger lazyLoad
|
|
|
});
|
|
|
|
|
|
$('.maybe-like p').on('touchstart', function (e) {
|
|
|
search();
|
|
|
});
|
|
|
|
|
|
//srcoll to load more
|
|
|
$(window).scroll(function () {
|
|
|
if ($(window).scrollTop() + winH >= $(document).height() - loadMoreH - 50) {
|
|
|
search();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
function search() {
|
|
|
if (loading) {
|
|
|
return;
|
|
|
}
|
...
|
...
|
@@ -120,6 +134,4 @@ $(window).scroll(function () { |
|
|
loading = false;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}); |
|
|
\ No newline at end of file |
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|