.RMF O fig.getHeight(wrap) + 'px'; marginTop = 0; } setStyles(divFilled, { height:height, marginTop:marginTop, overflow:'hidden' }); }; var scrollHandle = function() { var offsetTop = getOffset(divFilled).top; var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; var top = config.getTop(wrap)||0; if (config.fixed(wrap,scrollTop, offsetTop,top)) { toggle(true); addClass(wrap, fixedClz); if(isIE6){ top = top+scrollTop- getOffset(pNode).top; } setStyles(wrap,{ top:top+'px' }); config.onFix(wrap); } else { toggle(false); removeClass(wrap, fixedClz); config.onUnFix(wrap); } } var timerId = null; addEvent(window, 'scroll', function() { if (!timerId) { scrollHandle(); timerId = true; } else { clearTimeout(timerId); setTimeout(function() { scrollHandle(); }, 100); } }); scrollHandle(); }; window.ScrollFix = ScrollFix; })(); /*左侧评论*/ // 数字格式化 require(['js/lib/jquery','comment','js/util/numFormater'],function(jq, comment, numFormater) { (function(exports){ var $ = exports.___sinacMNT___; // 保持和页面编码一致,gbk或utf-8 $.cmnt.config.encoding = 'utf-8'; // 表情滚动固定 $.cmnt.config.fixFace = true; var FormList1 = new $.cmnt.FormList('j_commentlist',{ // 频道编号 channel:'ty', // 新闻id newsid:'comos-fymviyp1045254', // 默认为空 parent:'' },{ channel: 'ty', // 新闻id newsid:'comos-fymviyp1045254', // 默认为0,多条新闻(图片)集合的评论为1 group: 0, // 开始页数,默认为1 page: 1, // 每页评论条数 pageSize: 20, // 最大楼层 maxFloor:1, // 隐藏评论列表,只显示评论框 hideList:0, loaded: function(self) { var total = parseInt(self.data.count.total, 10); var html = '\u8bc4\u8bba'; if(total>0){ html += ''+ numFormater.getSeparatedNum(total) +''; } jq('.tool-a__cmnt').html(html); } // // 最新评论默认显示条数 // hotPageNum:5, // // 最新评论默认显示条数 // firstPageNum:5, // // 可点击最新评论正文“更多评论”按钮次数,达到该次数后,显示“查看更多评论”链接,再点击则跳转 // clickMoreTimes:3 },{}); })(window); /*左侧评论上方广告*/ (function(){ var byId = function(id){ return document.getElementById(id); }; var demo = byId('sinaads_box_fix'); var footer = byId('j_commentlist'); var S1 = new ScrollFix(demo,{ fixedClz: 'sinaads-box-fixed', fixed:function(wrap,scrollTop,offsetTop,top){ return (scrollTop > offsetTop)&&!(scrollTop+wrap.offsetHeight > footer.offsetTop + footer.offsetHeight -243 - 20); } }); })(); // 滚动固定评论框 (function(){ var demo = jq('#j_commentlist .sina-comment-top')[0]; var comNum = jq('span[comment-type="count"] a').eq(0).text(); var footer = jq('#j_commentlist'); var footMartop = parseInt(footer.css('marginTop')); var adHeig = jq("#sinaads_box_fix").height(); var S1 = new ScrollFix(demo,{ fixedClz: 'sina-comment-top-fixed', fixed:function(wrap,scrollTop,offsetTop,top){ return (scrollTop > offsetTop - adHeig)&&!(scrollTop+wrap.offsetHeight > footer.offset().top + footer.height() - 100); } }); })(); });