我正在处理以下代码,并且有点难过为什么我在调试器中遇到错误。显然在以varvar skillsLimit = ...
类开头的行中是未定义的。我在这里错误地设置了var吗?.top
skillsOffset
skillsOffset
// Set Pie graph to position fixed during a specified range
var $window = $(window);
var windowHeight = $(window).height();
var pos = $window.scrollTop(); //position of the scrollbar
var $this = $(this);
$window.bind('scroll', function(){ //when the user is scrolling...
var pos = $window.scrollTop(); //position of the scrollbar
var skillsOffset = $('#skills').offset();
var skillsLimit = $('#skills').skillsOffset.top + $('#skills').outerHeight();
if ( pos > skillsOffset ) {
$('.chartwell-pies').css({ 'position' : 'fixed' });
}
});