Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
スクロール機能を実行したい:
$("body").scrollTo({ top: "0px", left: "2200px" }, 800);
...手動(クリック)トリガーなしで、基本的にロード時に実行する必要があります。出来ますか?
え?何を求めているのかよくわかりません。.trigger('click')問題の要素を呼び出すことにより、ユーザーがマウスを物理的にクリックしなくても、プログラムでクリックをトリガーできます。
.trigger('click')
スクロールをすぐに実行したいだけの場合は、それをラップします$(document).ready(function() { ... });
$(document).ready(function() { ... });
.load() を追加してみてください
$("body").load().scrollTo({ top: "0px", left: "2200px" }, 800);
jsfiddle デモ