問題タブ [js-scrollintoview]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
0 に答える
32 参照

javascript - scrollIntoView function doesn't scroll anywhere

I can't figure out why, but scrollIntoView() function doesn't work in Chrome Version 71.0.3578.98 and I believe in any other either. The browser displays no errors and screen isn't scrolling anywhere. I haven't been able to find any answer in the Internet. Below is simplified code:

Do somebody have any ideas why it doesn't work?

P.S. I am using DataTables to render the table and for convenience didn't display it in the code.

0 投票する
1 に答える
8036 参照

angular - scrollIntoView() angular 7はスクロールしません

アプリケーションであるコンポーネントから別のコンポーネントへのスクロールを実装しようとしていますが、現時点ではコンポーネントに「ジャンプ」しているだけで、スクロールしていません。

私は次のことを試しました:

ここに私のテンプレートがあります:

または、 を使用して試してみましたが、これはまだレンダリングされていないため、想定どおりにViewChild()常に返されます。undefined<app-portfolio-slider>

スクロールをスムーズに行うにはどうすればよいですか?