function GetList(ele, cid, limit, tnum, anum, showurl, keywords, type) {
var body = $(ele); //滑动主体
var timer = null;
$(document).scroll(function (e) {
totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
if ($(document).height() - 10 <= totalheight) {
clearTimeout(timer);
timer = setTimeout(function () {
GetData(body, cid, limit, tnum, anum, showurl, keywords, type);
}, 800)
}
})
}
function GetData(el, cid, limit, tnum, anum, showurl, keywords, type) {
var btn = $(".more");
var linum = $(el).children().length;
$.ajax({
url: "do-10.html",
type: 'POST',
data: {
cid: cid,
limit: limit,
tnum: tnum,
anum: anum,
showurl: showurl,
keywords: keywords,
limitstart: linum
},
async: false,
success: function (data) {
var da = JSON.parse(data);
var option = '';
if (da.flag == 200 || da.flag == 210) {
d = da.data;
btn.html("");
setTimeout(function () {
for (var i = 0; i < d.length; i++) {
if (type == 1) {
// 解决方案
option = '
';
} else if (type == 2) {
// 产品
option = ' ';
} else if (type == 3) {
// 新闻
option = ' ' + d[i].newtime + '
' + d[i].newtitle + '
' + d[i].article + '
';
}
else if (type == 4) {
// 招聘
option = ' ';
}
el.append(option);
}
if (da.flag == 210) {
btn.html("没有更多了");
$(document).unbind('scroll');
}
else {
btn.html("上拉加载更多...");
}
}, 1500);
} else if (da.flag == 220) {
btn.html("");
$(document).unbind('scroll');
setTimeout(function () {
btn.html("没有更多了");
}, 1200);
}
}
});
}
$(function () {
if (document.getElementById('mydiv')) {
var config = {
vx: 4,
vy: 4,
height: 3,
width: 3,
count: 100,
color: "255, 255, 255",
stroke: "255,255,255",
dist: 6000,
e_dist: 20000,
max_conn: 10
}
CanvasParticle(config);
}
$(".msgformbtn").on('click', function () {
$("#msgform #formtitle").text($(this).attr("data-tit"));
$("#msgform #formtitle1").text($(this).attr("data-tit1") + ":");
$("#msgform #formtitle1").siblings("textarea").attr("placeholder", "请填写" + $(this).attr("data-tit1"));
$("#msgform #mtype").val($(this).attr("data-type"));
layer.open({
type: 1,
title: false,
closeBtn: 1,
shade: .8,
shadeClose: false,
area: ['95%', 'auto'],
content: $("#msgform"),
end: function () {
$("#msgform").hide();
}
})
})
})
function pdfshow(id){
layer.open({
type: 2, // page 层类型
area: ['90%','90%'],
shade: 0.6, // 遮罩透明度
shadeClose: true, // 点击遮罩区域,关闭弹层
maxmin: true, // 允许全屏最小化
anim: 0, // 0-6 的动画形式,-1 不开启
content: 'pdfshow-'+id+'.html'
});
}