h.max(bHeight, dHeight); iframe.height = height; } catch(ex) {} } window.setInterval("reinitIframe()", 200); //文字横向滚动 function ScrollImgLeft() { var speed = 10; //初始化速度 也就是字体的整体滚动速度 var MyMar = null; //初始化一个变量为空 用来存放获取到的文本内容 var scroll_begin = document.getElementById("scroll_begin"); //获取滚动的开头id var scroll_end = document.getElementById("scroll_end"); //获取滚动的结束id var scroll_div = document.getElementById("scroll_div"); //获取整体的开头id scroll_end.innerHTML = scroll_begin.innerHTML; //滚动的是html内部的内容,原生知识! //定义一个方法 function Marquee() { if(scroll_end.offsetWidth - scroll_div.scrollLeft <= 0) scroll_div.scrollLeft -= scroll_begin.offsetWidth; else scroll_div.scrollLeft++; } MyMar = setInterval(Marquee, speed); //给上面的方法设置时间 setInterval //鼠标点击这条公告栏的时候,清除上面的方法,让公告栏暂停 scroll_div.onmouseover = function() { clearInterval(MyMar); } //鼠标点击其他地方的时候,公告栏继续运动 scroll_div.onmouseout = function() { MyMar = setInterval(Marquee, speed); } } ScrollImgLeft(); //获取当前时间 function getNowFormatDate() { var date = new Date(); var seperator1 = "-"; var seperator2 = ":"; var month = date.getMonth() + 1; var strDate = date.getDate(); if(month >= 1 && month <= 9) { month = "0" + month; } if(strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate + " " + date.getHours() + seperator2 + date.getMinutes() + seperator2 + date.getSeconds(); return currentdate; } $(".lul li img").hover(function() { $(this).attr("src", $(this).attr("src").replace("cover", "screenshot").replace("cover.jpg", "cover2.gif")); }, function() { $(this).attr("src", $(this).attr("src").replace("screenshot", "cover").replace("cover2.gif", "cover.jpg")); }); // 播放失败提交 $("#err-button").click(function() { var title='问题反馈'; $('#bugtxt').find('option').eq(2).attr("selected",true); layer.open( { type: 1, title: title, area: ['380px', '350px'], content: $('#err-form'), cancel: function() { $("#err-form").css("display", "none"); } }); }); $('#qinquan-button').click(function() { var title='问题反馈'; $('#bugtxt').find('option').eq(3).attr("selected",true); layer.open( { type: 1, title: title, area: ['380px', '350px'], content: $('#err-form'), cancel: function() { $("#err-form").css("display", "none"); } }); }); //提交报错信息 function bugsave() { var bugtxt = $("#bugtxt").val(); var bugbeizhu = $("#bugbeizhu").val(); var bugtime = getNowFormatDate(); if(bugtxt == "请选择") { alert("请选择报错类型~"); return false; } else { $.ajax({ type: "post", url: "sb", async: true, data: { bugtxt: bugtxt, bugbeizhu: bugbeizhu, bugtime: bugtime, } , success: function(data) { if(data==1) { alert("您的请求过于频繁。"); } else { alert("反馈成功,我们会尽快解决您反馈的问题~"); } } , error: function(data) {} } ); $('#iframe').attr('src', $('#iframe').attr('src')); layer.close(layer.index); document.getElementById('err-form').style.display=='none' ? 'block': 'none'; $("#err-form").css("display", "none"); } } var href = window.location.href ; //取得整个地址栏 if (getQueryString("invite")) { postStatistics('invite'); } function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return decodeURI(r[2]); return null; } //input 的value值最大获取网址 document.querySelector("#content").value = href; //获取h5的标签 设置值 document.querySelector(".fuzhi h5").innerText=href ; function copyArticle(event) { const range = document.createRange(); range.selectNode(document.querySelector(".fuzhi h5")); const selection = window.getSelection(); if(selection.rangeCount > 0) selection.removeAllRanges(); selection.addRange(range); document.execCommand('copy'); alert("复制成功!"); postStatistics(); } document.getElementById('copyBT').addEventListener('click', copyArticle, false); $(".subPageTitle").text($(".navList .active").text()); // 二级面包屑导航 // 返回分类页面 $(".subPageTitle").on("click", function(){ var currentUrl = window.location.href; var hostname = window.location.hostname; window.location.protocol+"//"+window.location.host; var filename = currentUrl.split('/'); $(this).attr("href", window.location.protocol + "//"+ hostname + '/' + filename[3]) }) //迅雷下载 的复制功能 function copyArticle3(event) { const range = document.createRange(); range.selectNode(document.querySelector('#xunlei_nr1 input')); const selection = window.getSelection(); if(selection.rangeCount > 0) selection.removeAllRanges(); selection.addRange(range); document.execCommand('copy'); alert("复制成功!"); postStatistics(); } document.querySelector('.xunlei_fuzhi1').addEventListener('click', copyArticle3, false); function copyArticle2(event) { const range = document.createRange(); range.selectNode(document.querySelector('#xunlei_nr2 input')); const selection = window.getSelection(); if(selection.rangeCount > 0) selection.removeAllRanges(); selection.addRange(range); document.execCommand('copy'); alert("复制成功!"); postStatistics(); } document.querySelector('.xunlei_fuzhi12').addEventListener('click', copyArticle2, false);