<script>
$(document).ready(function() {
$('.start').click(function() {
$('.startHere').fadeToggle("fast");
});
});
$(document).ready(function() {
$(".toggle").click(function() {
$('.childtoggle').not($(this).find(".childtoggle")).hide(500);
$(this).find(".childtoggle").slideToggle(500);
});
$(".childtoggle").click(function(event) {
event.stopPropagation();
});
$(".gonext").click(function(e) {
e.stopPropagation();
if ($(this).parent().parent().next(".toggle").html() != undefined)
$(this).parent().parent().next(".toggle").trigger("click");
else
$(".toggle").first().trigger("click");
});
});
</script>
そのコードは単純なことをしています。別のdivをクリックすると、次のdivを閉じて開きます。だから私は決して1つ以上のdivを開けたことはありません。jQueryがトグルして上に移動する
しかし、私がしたいのは、新しいdivを切り替えるたびに、画面がdivsの上に移動することだけです。場合によっては、これらのdivの高さが画面よりも高く、スクロールがdivの途中にあります。
私のコードでこの作業をしてください。 – mezt
@mezt htmlも投稿できますか?私たちはそれを編集することができました。 –