温馨提示:网站使用自适应技术,手机与电脑显示界面不同,电脑界面显示效果更佳。

做了个小站,积累一些技术,分享一些原创
    体会生活,记录一些小随笔,闲说心得

让内嵌框架的链接点击无效不跳转弹窗

原创:张荣国

有时,我们在做网页的时候,难免有时要用到内嵌外部的网页,比如一些数据网页等。这时,我们为了能和自己的网页完美容和,一般会用内嵌代码:iframe,但外部网页毕竟不是自己的,有些也带其自身网站链接,虽内嵌在我们网页上,但人家一点击,一般是会弹窗到他家网页或直接跳转。这不利于与我们的网页融合,也让人一看就知道外跳不是你站的。所以,我们若不需跳转的内容的话,我们可以使用代码,让该内嵌框架的所有点击链接无效就可以了。其实很简单,我举个例:

比如你有个内嵌框架代码为:

<iframe width="320" scrolling="no" height="80" frameborder="0" allowtransparency="true" src="https://zhangrongguo.com/kj.html"></iframe>

这个内嵌后,就无框,完美融合,但是如果该页面kj.html里有链接,虽在你站内,但点击有可能就外跳了。所以,我们用以下代码使其点击链接失效就可,代码如下:

隐藏内容,回复可见(无需登录注册)    “回复本文”后“刷新页面”查看隐藏内容!

点击数:937

你可能也喜欢下面相关文章:

4 讨论

  1. cialis price说道:

    If you would like to improve your knowledge
    simply keep visiting this web site and be updated with the most recent news posted here.

  2. buy cialis online without a prescription说道:

    Greetings from Colorado! I’m bored at work so I decided to browse your website on my
    iphone during lunch break. I love the knowledge you present here and can’t wait
    to take a look when I get home. I’m shocked at how quick your blog loaded on my mobile ..
    I’m not even using WIFI, just 3G .. Anyhow, fantastic site!

  3. IaVLxdRbfWDOCiu说道:

    krAWEZYLtQBif

  4. ZLiJKBqX说道:

    StxZvulIBVb

回复 IaVLxdRbfWDOCiu 取消回复

必填项已用*标注