js返回顶部代码在文章页能显示,在首页不行。以下代码有什么错误吗……。 10
varfixwidth=968;varwinh=$(window).height();if($(window).width()>fixwidth+110){varwinw...
var fixwidth=968;var winh=$(window).height();if($(window).width()>fixwidth+110){var winw=($(window).width()-fixwidth)/2-55}else{var winw=50}var scrolltotop={setting:{startline:200,scrollto:0,scrollduration:300},controlHTML:'<div id="topcontrolin"><div id="xqtoparrow"></div><div id="xqtopword">\u56de\u9876\u90e8</div></div>',controlattrs:{offsetx:winw,offsety:winh/3-100},anchorkeyword:"#top",state:{isvisible:false,shouldvisible:false},scrollup:function(){var a=isNaN(this.setting.scrollto)?this.setting.scrollto:parseInt(this.setting.scrollto);if(typeof a=="string"&&jQuery("#"+a).length==1)、
展开
2个回答
展开全部
var fixwidth = 968;
var winh = $(window).height();
if ($(window).width() > fixwidth + 110) {
var winw = ($(window).width() - fixwidth) / 2 - 55
} else {
var winw = 50
}
var scrolltotop = {
setting: {
startline: 200,
scrollto: 0,
scrollduration: 300
},
controlHTML: '<div id="topcontrolin"><div id="xqtoparrow"></div><div id="xqtopword">\u56de\u9876\u90e8</div></div>',
controlattrs: {
offsetx: winw,
offsety: winh / 3 - 100
},
anchorkeyword: "#top",
state: {
isvisible: false,
shouldvisible: false
},
scrollup: function() {
var a = isNaN(this.setting.scrollto) ? this.setting.scrollto : parseInt(this.setting.scrollto);
if (typeof a == "string" && jQuery("#" + a).length == 1
帮你重新贴下代码。。。
看格式应该是用了某个插件,看看首页是否有这个插件,还有首页的锚#top是否存在
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询