简体   繁体   English

关注链接中的内容

[英]focus on content within the link

Below is some html code that i am trying to store collapsible div tags下面是我试图存储可折叠 div 标签的一些 html 代码
I am having a problem that when i click on the link Overland Expo April27 2011 which is contained along with other links which expand within the adventure diaries div, that focus is going to the top of the page.我遇到了一个问题,当我单击 Overland Expo April27 2011 链接以及在冒险日记 div 中扩展的其他链接时,该焦点将转到页面顶部。 I want when you click on one of the links that focus remains on the content within that collapsible link div.我希望当您单击其中一个链接时,焦点仍停留在该可折叠链接 div 中的内容上。 Dose anyone have some advice please请给任何人一些建议

   <!--<div> <a href="#para2"><a href="#" onclick="return toggleMe('para1')"/><h3>Click for adventure diaries</h3></a><br/>

 <link="para2" style="display:none">< link="#" onclick="return toggleMe('para1')" /></a>  
 <div id="para1" style="display:none">  

<p class="myTab" id="test">Content
</p


 </div><!-- end of first date --> -->

See your onclick="return toggleMe('para1')"看到你的onclick="return toggleMe('para1')"

When the onclick function returns false , the link does nothing -- so it won't take the page to # .onclick function 返回false时,链接什么也不做——所以它不会把页面带到#

You need to change toggleMe to return false.您需要更改toggleMe以返回 false。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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