目的:可视区域可以自动适应页面改变!
前言:https://blog.csdn.net/weixin_45799003/article/details/116569864
window.addEventListener('load', function (ev) {
//1实现瀑布流布局
waterFull('main', 'box');
//2加载数据
var time1 = null;
window.addEventListener('scroll', function (ev1) {
clearTimeout(time1);
/*问题----------------2:节约内存!使用一次定时器!!*/
time1 = setTimeout(function () {
if (checkWillLoadNewBox('main', 'box')) {
//2.1假数据
var dateArr = [
{
'src': "images/watch.jpg"},
{
'src': "images/watch.jpg"},
{
'src': "images/watch.jpg"},
{
'src': "images/watch.jpg"},
{
'src': "images/watch.jpg"},
{
'src': "images/watch.jpg"},
{
'src': "images/watch.jpg"},