鼠标悬停时如何隐藏URL? [英] How do they hide URL when mouseover?

查看:125
本文介绍了鼠标悬停时如何隐藏URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人都知道,当 mouseover 链接时,旧学校 windows.status 不再起作用。但是,我发现一个站点似乎总是在URL链接的下方,而该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.

下面的详细信息:
已回答

推荐答案

Google AdSense使用 onclick JavaScript事件处理程序在这种情况下,将重定向用户,而不是链接的 href 属性。这是诱捕用户鼠标单击的元素(大约几个iframe)的(大约)源代码。根据Firebug的说法,用户的鼠标单击位于外部 td 元素

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&amp;ai=BBuZpfBTrTMqHJ8zLsQfDsviMDfKumAKzyl3SmZ0CABABGAEgACgEOACCAQZjYS1wdWKIAQGQAfDkArIBDXNvbGFyLWFpZC5vcme6AQoxMjB4NjAwX2FzwAEC2gEZaHR0cDovL3d3dy5Tb2xhci1BaWQub3JnL8gDFw&amp;num=1&amp;adurl=http://www.Solar-Aid.org/&amp;client=ca-pub-0563973986972825&amp;nm=34" target="_top" id="aw0">
        Solar Energy Charity
      </a>
    </font>
    <br><br><br>
    <!-- snip -->
  </div>
</td>

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

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;
  }
}

顺便说一句,无需担心点击该特定广告是因为它是公共服务广告(PSA)。点击PSA不会为发布商赚钱,并且Google可以显示PSA的原因有很多,其中包括AdSense帐户尚未获得批准。

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.

这篇关于鼠标悬停时如何隐藏URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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