gpt4 book ai didi

javascript - Jquery移动滚动到新页面底部

转载 作者:行者123 更新时间:2023-11-28 13:58:34 24 4
gpt4 key购买 nike

当我单击新页面的 #link 时遇到问题,它会将页面跳转到新页面的底部。我尝试使用在文档中找到的 minScrollBack = 'infinity' 但没有效果。当然这不应该默认这样做?

**编辑示例页面。我已将 id="landing"和 "link1"设置为工作链接。当点击首页的link1(登陆)时,它会加载然后跳转到底部(缩小浏览器窗口进行测试)

<div data-role="page" data-theme="a" id="landing">

<div data-role="header">
<div class="home-header"></div>
</div><!-- /header -->
<div data-role="content" data-theme="a">

<div class="panel">
<h2>Content</h2>
<p>content</p>
<a href="#home-insurance" data-role="button" data-theme="b">Learn more</a></span>
<a href="#quote" data-role="button" data-theme="c" class="margin-neg" >1-Min Home Quote</a> </span>
</div>


<a href="#link1" data-role="button" data-theme="a" data-icon="arrow-r" data-iconpos="right">Link1</a>
<a href="#link2" data-role="button" data-theme="a" data-icon="arrow-r" data-iconpos="right">Link2</a>
<a href="#link3" data-role="button" data-theme="a" data-icon="arrow-r" data-iconpos="right">link3</a>

</div><!-- /content -->

<div data-role="footer" data-theme="b">
<h4>Call free now</h4>
</div><!-- /footer -->
</div><!-- /page -->


<div data-role="page" data-theme="a" id="link1">

<div data-role="header">
<div class="home-header"></div>
</div><!-- /header -->

<div data-role="content" data-theme="a">

<div class="panel">
<h2>Content</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi et eros turpis. Vivamus rhoncus neque vel mi vestibulum euismod sagittis neque hendrerit. Pellentesque lacinia, ligula sit amet consectetur condimentum, erat lectus ornare neque, eleifend sollicitudin quam lacus ut nunc. Quisque.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi et eros turpis. Vivamus rhoncus neque vel mi vestibulum euismod sagittis neque hendrerit. Pellentesque lacinia, ligula sit amet consectetur condimentum, erat lectus ornare neque, eleifend sollicitudin quam lacus ut nunc. Quisque. </p>
<a href="#link2" data-role="button" data-theme="b">Learn more</a></span>
<a href="#link3" data-role="button" data-theme="c" class="margin-neg" >1-Min Home Quote</a> </span>
</div>


<a href="#landing" data-role="button" data-theme="a" data-icon="arrow-r" data-iconpos="right">Landing</a>
<a href="#link2" data-role="button" data-theme="a" data-icon="arrow-r" data-iconpos="right">Link2</a>
<a href="#link3" data-role="button" data-theme="a" data-icon="arrow-r" data-iconpos="right">link3</a>

</div><!-- /content -->

<div data-role="footer" data-theme="b">
<h4>Call free now</h4>
</div><!-- /footer -->

最佳答案

我遇到了同样的问题,我发现页脚中的 h4 标记使整个页面向下滚动到底部。将其替换为 p 或除标题标记之外的任何内容,应该就可以了。

干杯

马蒂亚斯。

关于javascript - Jquery移动滚动到新页面底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6676291/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com