简体   繁体   中英

jQuery Dialog: How to scroll/jump to top/bottom/#link in the dialog?

I've a page with links like this:

<a href="#link-1">Link 1</a>

OnClick it jumps to:

<a href="" name="link-1">Link 1 Topic</a> 
Text...
<a href="#top">top</a>

Everything works fine but now I want to display the content of that page in a jQuery dialog.

Problem: onClick (top/bottom/#link) the whole page jumps but I only want the content withhin the dialog to jump.

Any ideas how to fix it simple without too much JS? Thanks in advance!

Simple Solution:

<a href="" name="_top"></a>
<a href="#_top">top</a>

Notice : the "_" before "top"!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM