page jump from div to an anchor

让人想犯罪 __ 提交于 2019-11-30 17:45:46

As long as your anchor has an ID you can link to a location in your view by clicking the div you will just need some javascript.

Setting the window.location.hash value will put the focus of the view on the selected ID.

Sample

<a href="#test1" id="back">Test</a>

<div id="test1" onclick="window.location.hash='back'; ">

JSFiddle Example

I think then you have to add <a href="yourid">page place</a> inside your first div and have to give id to your anchor tag <a href="yourplace" id="idname"></a>

if you have link to go another with variable you can use with id # sign

<a href="product.php?action=edit#lastdiv>Go to Product Last Div</a>

<div id="lastdiv">There are last product Exist</div>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!