锚标签不工作在Firefox和铬 [英] Anchor tag not working in firefox and chrome

查看:184
本文介绍了锚标签不工作在Firefox和铬的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正面临着一个惊人的问题。我在客户端网站上的图片上有一个超链接。它在IE中工作,但是当我在Chrome / Mozilla中打开相同的页面时,它没有显示锚点指针,点击也没有任何反应。我的链接代码是

 < a href =Home.aspx?ModuleID = 1> 
< img src =图片/ Logo.gifborder =0/>
< / a>

有人知道问题出在哪里吗?

document.getElementById([anchor tag])。scrollToView(true) ;



示例:
--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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆