JQuery AutoComplete插件在IE9下会因为bgiframe的问题出错

解决方法:

引入新的bgiframe

jquery.bgiframe-2.1.2.js:

/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 2.1.2
*/

(function($){

$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) {
    s = $.extend({
        top     : 'auto', //auto == .currentStyle.borderTopWidth        left    : 'auto', //auto == .currentStyle.borderLeftWidth        width   : 'auto', //auto == offsetWidth        height  : 'auto', //auto == offsetHeight        opacity : true,
        src     : 'javascript:false;'
    }, s);
    var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+
                   'style="display:block;position:absolute;z-index:-1;'+
                       (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
                       'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+
                       'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+
                       'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
                       'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
                '"/>';
    return this.each(function() {
        if ( $(this).children('iframe.bgiframe').length === 0 )
            this.insertBefore( document.createElement(html), this.firstChild );
    });
} : function() { return this; });

//old alias$.fn.bgIframe = $.fn.bgiframe;

function prop(n) {
    return n && n.constructor === Number ? n + 'px' : n;
}

})(jQuery);

转载于:https://www.cnblogs.com/davidgu/archive/2012/04/27/2473125.html

解决JQuery AutoComplete在IE9下出错的问题相关推荐

  1. 解决jquery.autocomplete在IE6下被下拉框遮住的问题

    jquery.autocomplete是一个让人又爱又恨的东东,一直用得不错,可是用得越是深入就越是郁闷,这不,之前发现并解决了两个问题,这次又有问题找上我了.之前的两个问题分别是:<为jque ...

  2. 解决IE9下JQuery的ajax失效的问题

    解决IE9下JQuery的ajax失效的问题 参考文章: (1)解决IE9下JQuery的ajax失效的问题 (2)https://www.cnblogs.com/cxf520/p/5777119.h ...

  3. IE6-IE9兼容性问题列表及解决办法_补充之五:在IE9下, disabled的文本框内容被选中后,其他控件无法获得焦点问题...

    先看一段Htm代码,里面一个disabled的文本框,一个普通可写的文本框,还有一个按钮,非常简单,代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD X ...

  4. 解决jquery下checked取值问题...

    解决jquery下checked取值问题... 参考文章: (1)解决jquery下checked取值问题... (2)https://www.cnblogs.com/playerlife/archi ...

  5. JQuery Autocomplete实战

    废话不多说,先看效果!~ 需要引入的资源如下 <link rel="stylesheet" href="/css/jquery.autocomplete.css&q ...

  6. Jquery autocomplete插件

    转自:https://www.cnblogs.com/Leo_wl/p/7845730.html Jquery autocomplete插件的使用示例 回到目录 Jquery autocomplete ...

  7. JQuery AutoComplete插件实现自动补全

    JQuery AutoComplete插件实现自动补全 官网 jquery提供的这个插件确实强大,十几行代码就可以实现自动补全功能,而且还可以选择多种不同的数据源,可以说是非常方便. 此文还查阅了一些 ...

  8. ajax error parsererror,完美解决ajax跨域请求下parsererror的错误

    AJAX 的 完美解决ajax跨域请求下parsererror的错误 ajax请求报parsererror错误是很宽泛的概念,很多情况下都报这个错, 在很多时候,即使ajax提交.返回都正常 XMLH ...

  9. jquery autocomplete 实现搜索提示功能,中文/拼音也没问题

    1.接下来我们根据我写的实例来讲解: 效果如下图所示 2.注意jquery 的类库要用  jquery autocomplete 自带的库 下载地址: jquery.autocomplete1.1.z ...

最新文章

  1. efishell无法开机shell_电脑出现EFIshellversion解决方法W1048/海尔青春小蓝
  2. ANNOTATION PROCESSING 101 by Hannes Dorfmann — 10 Jan 2015
  3. ngnix之lnmp环境搭建及Dvbbs搭建
  4. 在Windows 10上安装TensorFlow 2.2.0 RC4版
  5. 【ElasticSearch】Es 源码之 NodeConnectionsService 源码解读
  6. dnp服务器未响应,PTP时间戳精度
  7. Jquery跨域调用(JSONP)遇到error问题的解决
  8. Sass--占位符 %placeholder
  9. 【优化预测】基于matlab布谷鸟算法优化灰色模型预测【含Matlab源码 1244期】
  10. OpenDDS 安全配置
  11. 全国31省份实体经济发展水平数据 (2004-2017年)
  12. AI学习教程:AI(Adobe lliustrator)快速入门
  13. 世界期货市场竞争格局的变迁
  14. 菜鸟IT技术杂谈(一)——从多任务系统原理说起
  15. word 绘制计算机结构图,职称计算机考试辅导:Word绘制基本图形
  16. LoRa节点ABP入网方式怎么样
  17. 中小公司IT经理面试指南
  18. oppoa9处理器怎么样_OPPOA9处理器是骁龙几?
  19. 解决java压缩图片内存溢出问题
  20. 解决spyder的input()方法出现TypeError: _show_prompt() got an unexpected keyword argument ‘separator‘的问题

热门文章

  1. AjaxFileUpload 方法与原理分析
  2. php导出excel数据使用csv替代xls格式
  3. Oracle CBO 与 RBO
  4. WPF 触发器Triggers
  5. bzoj4361 isn (dp+树状数组+容斥)
  6. 无法找到python第三方库的处理方法
  7. 经典算法面试题目-置矩阵行列元素为0(1.7)
  8. lnmp 60秒的服务器缓存时间
  9. LCA 求 树中两个点的距离
  10. SVN之文件同步更新