当鼠标悬停时他们如何隐藏 URL?
大家都知道,当鼠标悬停
链接时,传统的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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许我不清楚您要做什么(因为示例链接已消失),但这看起来正确吗?
HTML:
jQuery:
Perhaps I'm unclear on what you're trying to do (since the example link is gone), but does this seem right?
HTML:
jQuery:
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
Google AdSense 使用
onclick
< /a> JavaScript 事件处理程序用于在本例中重定向用户,而不是链接的href
属性。下面是捕获用户鼠标点击的元素(几个 iframe 深)的(大约)源代码。根据 Firebug 的说法,用户的鼠标点击会转到外部 <代码>td元素。实际的文本链接是无关紧要的;它们比垃圾邮件发送者的鼠标跟随 iframe 的高度更低(其不透明度设置为 0.1,因此用户几乎看不到它)。
ga
只是一个使用top.location.href
:顺便说一句,当您点击该特定广告时,无需担心垃圾邮件发送者会赚钱,因为它是 公益广告 (PSA)。点击 PSA 不会为发布商带来任何收入,Google 可以出于多种原因展示 PSA,其中包括 AdSense 帐户尚未获得批准。
Google AdSense uses an
onclick
JavaScript event handler to redirect the user in this case, not thehref
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 outertd
element.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 usingtop.location.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.