附加var vartop = 0;
在var topMargin = 0;
这之后,这里是我附加的代码:
$(document).ready(function(){
var contentButton = [];
var contentTop = [];
var content = [];
var lastScrollTop = 0;
var scrollDir = '';
var itemClass ='';
var itemHover ='';
var menuSize = null;
var stickyHeight = 0;
var stickyMarginB = 0;
var currentMarginT = 0;
var topMargin = 0;
var vartop = 0; //附加默认值这里!
$(window).scroll(function(event){
加好之后在浏览器控制台就不会报这个错了 Uncaught ReferenceError: vartop is not defined