zoukankan      html  css  js  c++  java
  • iframe导致的文本框无法聚焦

    很多人都认为是ie本身的bug。是由于iframe没有移除,即使移除了。内存上也没有清除造成的。解决方法是在tb_remove()中先手动移除iframe然后,在强制做垃圾回收

     
    代码如下:
     
    function tb_remove() {
    var seq=PopSeq();
    $("#TB_imageOff"+seq).unbind("click");
    $("#TB_closeWindowButton" + seq).unbind("click");
     
    $("#TB_window" + seq).fadeOut("fast", function() {
    ///手动移除ifrmae,IE的一个bug
    $('#TB_iframeContent' + seq).remove();
    $('#TB_window' + seq + ',#TB_overlay' + seq + ',#TB_HideSelect' + seq).trigger("unload").unbind().remove();
    ///自己调用垃圾回收,强制清楚iframe内存,解决文本框无法输入问题。
    CollectGarbage();
    });
    if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
    $("body","html").css({height: "auto", "auto"});
    $("html").css("overflow","");
    }
    document.onkeydown = "";
    document.onkeyup = "";
    return false;
  • 相关阅读:
    Java内部类与异常类
    Java 继承和接口
    134. 加油站
    P1567 统计天数
    P2141 珠心算测验
    P1428 小鱼比可爱
    P1427 小鱼的数字游戏
    python中使用xlrd、xlwt操作excel表格详解
    同步机制
    CSS学习
  • 原文地址:https://www.cnblogs.com/puream/p/2839335.html
Copyright © 2011-2022 走看看