【发布时间】:2014-10-11 14:09:18
【问题描述】:
我在使用时遇到问题
:not(.disabled)
在类选择器中。用了之后就进不去了
$(this).position().top
这里是代码
$('.game:not(.disabled)').bind('click', function(){
// Note, there is also scrollToX and scrollToY methods if you only
// want to scroll in one dimension
$('.game').removeClass('active');
$(this).addClass('active');
var newgame = $(this).attr('data-href');
theGame = newgame;
console.log('EVENT: [CHANGED] ['+theGame+']');
var y = $(this).position().top;
console.log('EVENT: [SCROLLTO]['+0+' : '+y+']');
console.log(y);
api.scrollTo(0, y);
return false;
});
当我删除 :not(.disabled) 时,它可以正常工作,并且 'y' 坐标也可以正常使用..
我该如何解决这个问题?
【问题讨论】:
标签: javascript jquery css position css-position