html自动判断是否为空,html加一个判断内容为空就不执行

content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>

{$company.company_title}

weibotop.png

{volist name='goods_list' id='vo'}

%7B%24vo.picture_address%7D

{$vo.goods_title}
hot.png近两小时爆卖{$vo.sales}件

{$vo.coupon_price}元

券后 ¥{$vo.post_coupon_price}

quanbtn.png

{/volist}

拼命加载中

class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"

style=" padding: 0 5px; font-size: 14px;color: #f83e3e;">

var ua = navigator.userAgent.toLowerCase();

if (ua.match(/WeiBo/i) == "weibo") {

//在新浪微博客户端打开

var ifr = document.createElement('iframe');

ifr.style.display = 'none';

ifr.src =  '{$id}';

document.body.appendChild(ifr);

}else{

//如果不是微博

top.location.href = "{$id}";

}

history.scrollRestoration = 'manual';

var $ = layui.$;

//

//    console.log(1);

var ii = 0;//加载完

$(document).ready(function () {

$(window).scroll(function () {

if ($(document).height() - $(this).height() - $(this).scrollTop() <= 10) { //到达底部10px时,加载新内容

// 这里加载数据..

//如果加载完 加载

if (ii == 0) {

ii = 1;//正在加载

nextpage();

}

}

});

});

function nextpage() {

//缓加载数据

var offect = $("#offect").val();

if (offect <= "{$count_goods}") {

$("#load").show();

$.ajax({

url: "index/index/index_json",

data: {

offect: offect,

},

type: "POST",

dataType: "json",

success: function (goods_list) {

if (goods_list.code == 1) {

var data = goods_list.data;

var str = "";

for (var x in data) {

str += '' +

'

' +

'

' +

''%20+%20data%5Bx%5D.picture_address%20+%20'' +

'

' +

'

' +

'

' + data[x].goods_title + '
' +

'

hot.png近两小时爆卖' + data[x].sales + '件' +

'

' +

'

' +

'

' +

+data[x].coupon_price + '元' +

'

' +

'

券后 ¥' + data[x].post_coupon_price + '
' +

'quanbtn.png

' +

'

' +

'';

}

var last = $('.goodsa').last();

$(last).after(str);

$("#offect").val(offect * 1 + 10);

$(".load").hide()

ii = 0;//加载完

}

}

});

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值