当鼠标悬停时他们如何隐藏 URL?

发布于 2024-10-04 05:42:50 字数 158 浏览 6 评论 0原文

大家都知道,当鼠标悬停链接时,传统的windows.status就不再起作用了。然而,我发现一个网站似乎将 URL 链接清空,而该链接始终位于鼠标下方。

更多详细信息如下: 已回答

Everybody knows that the good old school windows.status is not working anymore when mouseover a link. However, I found a site which seems to be blanking out the URL link while the link is always below the mouse.

More details below:
Answered

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

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

发布评论

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

评论(3

楠木可依 2024-10-11 05:42:50

也许我不清楚您要做什么(因为示例链接已消失),但这看起来正确吗?

HTML:

<a href="">Link</a>

jQuery:

$("a").click(function() {
location.href="www.yahoo.com";
return false;
});

Perhaps I'm unclear on what you're trying to do (since the example link is gone), but does this seem right?

HTML:

<a href="">Link</a>

jQuery:

$("a").click(function() {
location.href="www.yahoo.com";
return false;
});
温柔一刀 2024-10-11 05:42:50

class="vmenuballon" onclick="javascript:parent.location.href='home'" onmouseover="window.tip='back'"alt="back" title="back" >Home

class="vmenuballon" onclick="javascript:parent.location.href='home'" onmouseover="window.tip='back'"alt="back" title="back" >Home

伤感在游骋 2024-10-11 05:42:50

Google AdSense 使用 onclick< /a> JavaScript 事件处理程序用于在本例中重定向用户,而不是链接的 href 属性。下面是捕获用户鼠标点击的元素(几个 iframe 深)的(大约)源代码。根据 Firebug 的说法,用户的鼠标点击会转到外部 <代码>td元素

<td valign="middle" align="center" onclick="ga(this,event)" onmouseout="cs()" onmouseover="return ss('go to www.Solar-Aid.org','aw0')" onmousedown="st('aw0')" onfocus="ss('go to www.Solar-Aid.org','aw0')" class="ch" id="taw0">
  <div style="overflow: hidden; word-wrap: break-word; width: 116px;">
    <font face="impact, poster bodoni, geneva" style="font-size: 20px;">
      <a style="text-decoration: none;" class="textcolor" onmouseout="cs()" onmouseover="return ss('go to www.Solar-Aid.org','aw0')" onmousedown="st('aw0')" onclick="ha('aw0')" onfocus="ss('go to www.Solar-Aid.org','aw0')" href="http://googleads.g.doubleclick.net/pagead/iclk?sa=l&ai=BBuZpfBTrTMqHJ8zLsQfDsviMDfKumAKzyl3SmZ0CABABGAEgACgEOACCAQZjYS1wdWKIAQGQAfDkArIBDXNvbGFyLWFpZC5vcme6AQoxMjB4NjAwX2FzwAEC2gEZaHR0cDovL3d3dy5Tb2xhci1BaWQub3JnL8gDFw&num=1&adurl=http://www.Solar-Aid.org/&client=ca-pub-0563973986972825&nm=34" target="_top" id="aw0">
        Solar Energy Charity
      </a>
    </font>
    <br><br><br>
    <!-- snip -->
  </div>
</td>

实际的文本链接是无关紧要的;它们比垃圾邮件发送者的鼠标跟随 iframe 的高度更低(其不透明度设置为 0.1,因此用户几乎看不到它)。 ga 只是一个使用 top.location.href

function ga(o, e) {
  if(document.getElementById) {
    a = o.id.substring(1);
    // snip
    top.location.href = document.getElementById(a).href;
  }
}

顺便说一句,当您点击该特定广告时,无需担心垃圾邮件发送者会赚钱,因为它是 公益广告 (PSA)。点击 PSA 不会为发布商带来任何收入,Google 可以出于多种原因展示 PSA,其中包括 AdSense 帐户尚未获得批准。

Google AdSense uses an onclick JavaScript event handler to redirect the user in this case, not the href attribute of a link. Here is the (approximate) source code of the element (several iframes deep) that traps the user's mouse click. According to Firebug, the user's mouse click goes to the outer td element.

<td valign="middle" align="center" onclick="ga(this,event)" onmouseout="cs()" onmouseover="return ss('go to www.Solar-Aid.org','aw0')" onmousedown="st('aw0')" onfocus="ss('go to www.Solar-Aid.org','aw0')" class="ch" id="taw0">
  <div style="overflow: hidden; word-wrap: break-word; width: 116px;">
    <font face="impact, poster bodoni, geneva" style="font-size: 20px;">
      <a style="text-decoration: none;" class="textcolor" onmouseout="cs()" onmouseover="return ss('go to www.Solar-Aid.org','aw0')" onmousedown="st('aw0')" onclick="ha('aw0')" onfocus="ss('go to www.Solar-Aid.org','aw0')" href="http://googleads.g.doubleclick.net/pagead/iclk?sa=l&ai=BBuZpfBTrTMqHJ8zLsQfDsviMDfKumAKzyl3SmZ0CABABGAEgACgEOACCAQZjYS1wdWKIAQGQAfDkArIBDXNvbGFyLWFpZC5vcme6AQoxMjB4NjAwX2FzwAEC2gEZaHR0cDovL3d3dy5Tb2xhci1BaWQub3JnL8gDFw&num=1&adurl=http://www.Solar-Aid.org/&client=ca-pub-0563973986972825&nm=34" target="_top" id="aw0">
        Solar Energy Charity
      </a>
    </font>
    <br><br><br>
    <!-- snip -->
  </div>
</td>

The actual text links are irrelevant; they are farther down than the height of the spammer's mouse-following iframe (which has a set opacity of 0.1, so it remains nearly invisible to the user). ga is just a function that changes the outside window's URL using top.location.href:

function ga(o, e) {
  if(document.getElementById) {
    a = o.id.substring(1);
    // snip
    top.location.href = document.getElementById(a).href;
  }
}

By the way, there's no need to worry about the spammer making money when you click on that particular ad because it is a public service ad (PSA). Clicks on PSAs do not earn any money for a publisher, and Google can show PSAs for several reasons including that the AdSense account has not been approved.

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