特定のdivコンテナの一番上までスクロールしようとしています。現在、私のコードは代わりにページのコンテンツをスクロールして表示しています。誰もがどのように間違っているのか考えていますか?:)コードは次のとおりです。
var openItem;
var showBox = function(item) {
item.removeClass("loading");
var infoBox = $("div.test", item);
// Resize box
item.width(853);
item.height(infoBox.outerHeight());
// Reload Masonry
$('#container').isotope('reLayout');
// Insert close button
$('<a href="#" class="close">Close</a>"')
.prependTo(".test .content")
.click(function (e) {
e.preventDefault();
close(item);
});
// Insert close button
$('<a href="#" class="close">Close</a>"')
.appendTo(".test .content")
.click(function (e) {
e.preventDefault();
close(item);
});
// Fade in test box
setTimeout(function () {
testBox.fadeIn();
// Scroll box into view
$(document).scrollTo(item, 1000);
}, 280);
}