realgreenzb
V2EX  ›  问与答

IE 下面带 contenteditable 属性的元素, 奇怪现象, 有同学遇到过么?

  •  
  •   realgreenzb · Sep 5, 2015 · 3194 views
    This topic created in 3927 days ago, the information mentioned may be changed or developed.

    基本结构如下:

    <h1 contenteditable="false" class="">
    需要编辑的内容区域.
    <a href="###" class="btn_edit" contenteditable="false">编辑</a>
    </h1>

    ---------友好的分割线-----------

    写了一个小功能, 点击编辑按钮的时候, 会给 h1 增加 contenteditable 属性, 设置为 true, 这样就能编辑 h1 的内容.
    因为按钮在 h1 内部, 所以给编辑按钮设置了 contenteditable 的 false 属性, 在 chrome 下面完美执行.

    问题来了, 在 IE 下面, 点击编辑后, 按钮四周就会出现可调整大小的拖动框,影响脚本正常运行. 有同学知道这是什么鬼么?

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2737 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:33 · PVG 20:33 · LAX 05:33 · JFK 08:33
    ♥ Do have faith in what you're doing.