链接下方的文本在 Internet Explorer 中妨碍操作

发布于 2024-09-16 22:16:04 字数 424 浏览 13 评论 0原文

我在整个网站上使用 Nivo 幻灯片 (http://nivo.dev7studios.com/)正在开发...它工作得很好,除了在 Internet Explorer 中,链接仅在鼠标未悬停在幻灯片中的文本上时才起作用 - 在其他浏览器中,您可以单击幻灯片中的任意位置(在图像上、在标题上、在标题上等)...但在 IE 中,由于某种原因,当鼠标悬停在文本上时,链接不起作用?有什么想法吗?这是该网站的链接 - 大多数页面上都有幻灯片:http://www.arcaspicio.squarespace。 com

非常感谢!

I am using the Nivo slideshow (http://nivo.dev7studios.com/) throughout a site i am developing ... it is working great, except that in Internet Explorer the links only work when the mouse is not hovering over the text in the slideshow - in other browsers you can click anywhere in the slideshow (on the image, on the caption, on the headline, etc) ... but in IE for some reason the link does not work when hovering over the text? any ideas? here is the link to the site - most pages have the slideshow on it: http://www.arcaspicio.squarespace.com

Much appreciated!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只是一片海 2024-09-23 22:16:04

这只是浏览器的一个怪癖,你必须破解它。

当鼠标悬停在文本上时,某些浏览器会接管鼠标,或者文本被视为无法单击的图层(即使它看起来透明),因此您需要执行以下操作(未经测试):

$(".nivo-caption").hover(function() {
 $(this).css('cursor','pointer');
 }, function() {
 $(this).css('cursor','auto');
});

$(".nivo-caption").click(function() {
  var url = 'somewhere';
  document.location.href = 'wherever';
});

您将需要尝试使用选择器等,并且您还需要对 URL 进行一些操作,即从单击文本的父级或同级文本等获取 URL。

It's just a browser quirk which you will have to hack your way around.

Some browsers take over the mouse when it hovers over text or the text is treated as a layer that can't be clicked through (even though it appears transparent) so you will need to do something like this (untested):

$(".nivo-caption").hover(function() {
 $(this).css('cursor','pointer');
 }, function() {
 $(this).css('cursor','auto');
});

$(".nivo-caption").click(function() {
  var url = 'somewhere';
  document.location.href = 'wherever';
});

You will need to play around with selectors etc. and you will also need to do something with the URL i.e. get the URL from the clicked text's parent or sibling etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文