'+data.data.list[i].fc+'
'; var KeyWord=data.data.list[i].last_video.keywords.split(","); var num_video = ""; if(KeyWord.length>2){ num_video = 3; }else{ num_video = KeyWord.length; } for(var j=0;j'+KeyWord[j]+''; } htmlstr+='0
'; } } $(".neirongzhuanqu18847_ind03 ul").append(htmlstr); $(".gongneng .biaoqian a:last-child").addClass("last"); $(".jiazai_more").show(); Echo.init({ offset: 0, //离可视区域多少像素的图片可以被加载 throttle:10 //图片延时多少毫秒加载 }); //分享 $(".neirongzhuanqu18847_ind03 ul li").each(function(i){ $(this).find(".share a").click(function(){ var href=$(".neirongzhuanqu18847_ind03 ul li").eq(i).find(".top .img a").attr("href"); var title=$(".neirongzhuanqu18847_ind03 ul li").eq(i).find(".top .tit a").text(); var shaimg=$(".neirongzhuanqu18847_ind03 ul li").eq(i).find(".top .img img").attr("src"); shareObj.shareUrl = href; shareObj.shareTitle = title; shareObj.pic = shaimg; shareObj.summary =""; }) }) if(total<=(curPage*pageSize)){ $('.neirongzhuanqu18847_ind03 .jiazai_more a').text('没有更多啦').css({"background": "transparent"}); gundong = false; }else{ gundong = true; } //获取点赞数 $.ajax({ url:zanurl, type:"get", dataType:"jsonp", jsonp:"jsonp_callback", jsonpCallback:"cb", cache:true, success: function(data){ var _obj=data.data; for(var a in _obj){ var dianzannum=_obj[a]; if(dianzannum<10000){ $("#zanNum"+a).html(dianzannum+"+1"); }else{ $("#zanNum"+a).html((dianzannum/10000).toFixed(1)+"万+1<\/i>"); } } }, }); //点赞 $(".dianzan").bind("click",function(){ var Data=$(this).attr("data"); if(!$(this).hasClass("cur")){ $(this).addClass("cur"); $(this).find("i").fadeIn(); dianzan(Data); var adddianzannum=parseInt($(this).text())+1; //alert(adddianzannum); if(adddianzannum<10000){ var self = $(this) setTimeout(function(){ $(".neirongzhuanqu18847_ind03 ul li .gongneng .dianzan i").fadeOut(); self.html("+1") self.find("i").before(adddianzannum); },500) }else{ $(this).find("i").before((adddianzannum/10000).toFixed(1)+"万"); } } }); } }, 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){} }); } var gundong = true; window.onload = function(){ //返回顶部 function inspect(){ var osww=$(window).width(); var oshh=$(window).height(); var oscolw=(osww-1200)/2; var num=0; if(oscolw>200){ num=(osww-1200)/2 - 200; } else{ num=0; } if($(window).scrollTop()>oshh/2){ $(".back_top18847").show().css({"right":num+"px"}) } else{ $(".back_top18847").hide().css({"right":num+"px"}) } } inspect(); var throldHold = 100; var scrolltop_btn = $(".back_top18847"); $(".back_top18847").hover(function(){ scrolltop_btn.addClass("cur"); scrolltop_btn.animate({"width":"135px"},200); scrolltop_btn.find("i").show() },function(){ scrolltop_btn.stop().css({"width":"56px"}); scrolltop_btn.removeClass("cur"); scrolltop_btn.find("i").hide(); }) $(".back_top18847").click(function(){ $("body,html").animate({scrollTop:0},300) return false; }); window.onresize = window.onscroll = function () { clearTimeout(throldHold); window.timer = setTimeout(inspect, throldHold); //返回顶部 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(1220*screenHeight/screenWidth); }else{ cHeight = document.documentElement.clientHeight;//可见内容区高度 } if (gundong){ if (bheight<=cHeight){ gundong = false; setTimeout(function(){ curPage = curPage+1; showli(curPage,pageSize); },800); } } //window.timer = setTimeout(inspect, throldHold); } } //获取窗口可视范围的高度 function getClientHeight(){ var clientHeight=0; if(document.body.clientHeight&&document.documentElement.clientHeight){ var clientHeight=(document.body.clientHeightdocument.documentElement.clientHeight)?document.body.clientHeight:document.documentElement.clientHeight; } return clientHeight; } //获取窗口滚动条高度 function getScrollTop(){ var scrollTop=0; if(document.documentElement&&document.documentElement.scrollTop){ scrollTop=document.documentElement.scrollTop; }else if(document.body){ scrollTop=document.body.scrollTop; } return scrollTop; } //获取文档内容实际高度 function getScrollHeight(){ return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight); }
回到顶部