锚标签不工作在Firefox和铬 [英] Anchor tag not working in firefox and chrome
本文介绍了锚标签不工作在Firefox和铬的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< a href =Home.aspx?ModuleID = 1>
< img src =图片/ Logo.gifborder =0/>
< / a>
有人知道问题出在哪里吗?
document.getElementById([anchor tag])。scrollToView(true) ;
<$ p $ < code>< a href =#onclick =document.getElementById('ShowMeHow2')。scrollIntoView(true); return false;>
示例:
--from -
<$ p $ < code>< a href =#onclick =document.getElementById('ShowMeHow2')。scrollIntoView(true); return false;>
< - > - 至 -
< a id =ShowMeHow2name =ShowMeHow2> < / A>
I am facing an amazing problem. I have a hyperlink on an image on my client site. It's working in IE but when I open the same page in Chrome/Mozilla it's not showing the anchor pointer and nothing happens on clicking either. My link code is
<a href="Home.aspx?ModuleID=1">
<img src="Images/Logo.gif" border="0"/>
</a>
Does somebody have any idea what the issue could be?
解决方案
Simple Work around: This works in all browsers I have tested so far use document.getElementById([anchor tag]).scrollToView(true);
Example: --from--
<a href="#" onclick="document.getElementById('ShowMeHow2').scrollIntoView(true);return false;">
--to--
<a id="ShowMeHow2" name="ShowMeHow2"> </a>
这篇关于锚标签不工作在Firefox和铬的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文