0
我运行这个jQuery脚本滚动的divJQuery的动作滚动窗口向下
http://jsfiddle.net/sg3s/rs2QK/
jQuery(function($) {
$('a.panel').click(function() {
var $target = $($(this).attr('href')),
$other = $target.siblings('.active');
if (!$target.hasClass('active')) {
$other.each(function(index, self) {
var $this = $(this);
$this.removeClass('active').animate({
left: $this.width()
}, 500);
});
$target.addClass('active').show().css({
left: -($target.width())
}).animate({
left: 0
}, 500);
}
});
});
问题是,如果例如,上面有具有一定高度,这JQuery的两个div的报头将滚动窗口为相同的标题高度的行动。
有什么办法可以防止这种情况发生?
感谢