嘿伙计们,我正在尝试弄清楚如何让用户重定向到另一个页面并基于单击的链接;让它把它们放在包含信息的页面上的位置。
我计划在 JQuery 中对此进行编码。请告诉我:)
谢谢大家,我希望你们度过了一个美好的星期四!!!
编辑:
<div class="online_training">
<div class="training_image">
<a href="../services.php">...</a>
</div><!-- .training_image -->
<div class="top-textArea">
<h2><a href="../services.php"></a>....</h2>
<p>
.....
</p>
</div><!-- .top-textArea -->
</div><!-- .online_training -->
I have mutiple of these and so the part to notice where I want to have
it redirect to and go to that part of the page is the where the .training_image <a> is and the <h2> one is.
最佳答案
最简单的方法是使用 anchor 标记。
在初始页面上:
<a href="/otherpage#spot1">Go to spot1</a>
在其他页面上:
<a href="#" name="spot1"></a>
当其他页面加载时,它将滚动到名为spot1的 anchor 。
关于jquery - 单击某个链接时,如何让用户弹出到页面上的特定位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15823583/