このJQueryスクリプトを実行してdivをスクロールしています
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);
}
});
});
問題は、たとえば、この 2 つの div の上に高さのあるヘッダーがある場合、JQuery はアクション時に同じヘッダーの高さでウィンドウを下にスクロールします。
これを防ぐ方法はありますか?
ありがとう