Authored by 梁志锋

product desc

... ... @@ -4,23 +4,16 @@
* @date: 2015/11/18
*/
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
lazyLoad = require('yoho.lazyload');
var loading = require('../../plugin/loading');
var loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
var introUrl = $('#introUrl').val(),
winH = $(window).height(),
$productDesc,
searching = false,
end = false,
num;
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 50) {
search();
}
}
end = false;
function search() {
if (searching || end) {
... ... @@ -34,7 +27,7 @@ function search() {
type: 'GET',
url: introUrl,
success: function(data) {
var $productDesc = $('#productDesc');
$productDesc = $('#productDesc');
$productDesc.append(data);
lazyLoad($productDesc.find('img.lazy'));
... ... @@ -51,8 +44,14 @@ function search() {
});
}
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 50) {
search();
}
}
//srcoll to load more
$(window).scroll(function () {
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
... ...