zoukankan      html  css  js  c++  java
  • IE去掉链接虚线框的几个方法

    转载自:http://www.hujuntao.com/archives/ie-remove-the-link-to-the-dotted-rectangle-several-ways.html

    虚线框简直就是个多余的东西,上一篇教大家怎么去除Firefox中链接和按钮虚线框,今天叫大家去掉去除IE中链接的虚线框。
    方法一:利用javascript的onfocus事件,实现如下:
    Html代码

    1. <a href="http://www.hujuntao.com/" onfocus="this.blur();">设计蜂巢</a>

    如果引入了jQuery框架则可以利用它的事件绑定机制:

    Js代码

    1. $('a').bind('focus', function(){
    2. if(this.blur){ //如果支持 this.blur
    3. this.blur();
    4. }
    5. });

    方法二:利用css样式,实现如下:

    1. Css代码
    2. a{
    3. blr: expression(this.onFocus=this.close());
    4. } /* 只支持IE,过多使用效率低 */
    5. a{
    6. blr: expression(this.onFocus=this.blur());
    7. } /* 只支持IE,过多使用效率低 */
    8. a:focus {
    9. -moz-outline-style: none;
    10. } /* IE不支持 */
    11. :focus {
    12. outline: none;
    13. } /* for Firefox */

    方法三:利用标签属性,仅支持IE,实现如下:

    Html代码

    1. <a href="http://www.hujuntao.com/" hidefocus="true">设计蜂巢</a>

    方法四:HTC 实现如下:
    将一下代码保存为.htc后缀的文件

    Js代码

    1. <public:attach event="onfocus" onevent="quit()" />
    2. <script language="javascript">
    3. function quit(){
    4. this.blur();
    5. }
    6. </script>

    CSS代码

    1. a {behavior:url("htc文件")}
  • 相关阅读:
    2440中断
    2440内存管理
    printf不定参数
    时钟体系
    Uart串口
    链接脚本与重定位
    指令速记
    OpenOCD-JTAG调试
    ATPCS规则
    ARM三级流水线
  • 原文地址:https://www.cnblogs.com/hutaoer/p/3078886.html
Copyright © 2011-2022 走看看