';
var KeyWord=data.data.list[i].keywords.split(",");
var num_video = "";
if ($(window).width() < 1024) {
if(KeyWord.length>1){
num_video = 1;
}else{
num_video = KeyWord.length;
}
for(var j=0;j1){
num_video = 1;
}else{
num_video = KeyWord.length;
}
for(var j=0;j'+KeyWord[j]+'';
}
}
htmlstr += '
';
}
$("#dglmlb ul").append(htmlstr);
Echo.init({
offset: 0, //离可视区域多少像素的图片可以被加载
throttle:10 //图片延时多少毫秒加载
});
$.ajax({
url:zanurl,
type:"get",
dataType:"jsonp",
jsonp:"jsonp_callback",
jsonpCallback:"cb" + curPage,
cache:true,
success: function(data){
var _obj=data.data;
for(var a in _obj){
var dianzannum=_obj[a];
if(dianzannum<10000){
$("."+a).html(dianzannum);
}else{
$("."+a).html((dianzannum/10000).toFixed(1)+"万");
}
}
}
})
//点赞
$("#dglmlb ul li").each(function(){
$(this).find(".xin-right").bind("click", function () {
//console.log($(this).attr("class").split(" ")[2])
var that=$(this);
var videoids=that.attr("class").split(" ")[2];
if($(this).hasClass('xin-rightclick')){
}else{
$(this).addClass('xin-rightclick');
dianzan(videoids);
var adddianzannum=parseInt(parseInt($(this).text())+1);
if(adddianzannum<10000){
if($(window).width()<= 1024){
}else{
$(this).find("i").fadeIn();
$(this).siblings().addClass('addone').fadeIn(function(){
$(this).fadeOut();
});
}
var self = $(this)
setTimeout(function(){
$(".ysw19295-jingpin ul li .jctj-xin .dianzan i").fadeOut();
self.text(adddianzannum);
},500)
}else{
self.text((adddianzannum/10000).toFixed(1)+"万");
}
}
/*dianzan(videoids)
if($(window).width()<= 1024){
if(!that.hasClass('xin-rightclick')){
that.addClass('xin-rightclick');
}
}else{
if(!that.hasClass('xin-rightclick')){
that.addClass('xin-rightclick');
$(this).siblings().fadeIn();
$(this).siblings().addClass('addone').fadeIn(function(){
$(this).fadeOut();
});
}
}
var adddianzannum=parseInt(parseInt(that.text())+1);
that.html(adddianzannum);*/
})
})
$(".dyw19295-loading").show();
if(total<=(curPage*pageSize)){
$('.dyw19295-loadingno').show();
$(".dyw19295-loading").hide();
jiazaizhong = false;
}else{
jiazaizhong = true;
}
},
error:function(){}
});
}
//增加点赞数
function dianzan(videoID){
var url='//api.itv.cntv.cn/praise/add?type=other&id='+videoID+'&jsonp_callback=?&r=';
$.ajax({
type:'get',
dataType:"jsonp",
url:url,
data:"",
success:function(data){}
});
}
// 绑定:上拉加载更多监听
function addPullLoaderEvent() {
if(window.addEventListener) {
window.addEventListener('scroll', pullGetMore, false);//滚动条滚动执行addcomment方法
} else {
window.attachEvent('onscroll', pullGetMore);//ie滚动条滚动执行addcomment方法
}
}
function pullGetMore(ev) {
var height=getClientHeight(),// 窗口可视范围的高度
theight=getScrollTop(),//获取窗口滚动条高度
rheight=getScrollHeight(),//获取文档内容实际高度
bheight=rheight-theight-height;// 滚动条距离底部的高度
var cHeight;
if(navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)){
var screenWidth = window.screen.width;
var screenHeight = window.screen.height;
cHeight = Math.ceil(1200*screenHeight/screenWidth);
}else{
cHeight = document.documentElement.clientHeight; //可见内容区高度
}
if(bheight <= cHeight){
if(jiazaizhong){
jiazaizhong = false;
setTimeout(function(){
curPage=curPage+1;
showlimllb(curPage,pageSize);
},800)
}else{
/*$('.dyw19295-loading').css('display','none');
$('.dyw19295-loadingno').css('display','block');*/
}
}
}
var isFirstInit=true;
if (isFirstInit){
showlimllb(curPage,pageSize);
//添加,上拉加载更多监听
addPullLoaderEvent();
isFirstInit=false;
}
//获取窗口可视范围的高度
function getClientHeight(){
var clientHeight=0;
if(document.body.clientHeight&&document.documentElement.clientHeight){
var clientHeight=(document.body.clientHeight