IE select 控件总在div的上面显示的BUG修正
2016-08-25 16:20
489 查看
//xu.browser.ie.hacker IE hacker /** * 依赖文件 core.js array.js browser.js dom.js */ if (xu.browser.$IE){ var arVersion = navigator.appVersion.split("MSIE"); xu.browser.ie.version = parseFloat(arVersion[1]); arVersion = null ; /** * <!--[if lte IE 6.5]> * <script type="text/javascript" src="browser.ie.js"></script> * <![endif]--> */ xu.browser.ie.hacker.bgImgCache = function(){ //启用 背景图片缓存 try { document.execCommand("BackgroundImageCache", false, true) } catch (e) {} } ; xu.browser.ie.hacker.pngFixed = function(){ if ((xu.browser.ie.version >= 5.5) && (document.body.filters)) { for(var j=0; j<document.images.length; j++){ var img = document.images[j]; var imgName = img.src.toUpperCase(); if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){ var imgID = (img.id) ? "id='" + img.id + "' " : ""; var imgClass = (img.className) ? "class='" + img.className + "' " : ""; var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "; var imgStyle = "display:inline-block;" + img.style.cssText ; if (img.align == "left") imgStyle = "float:left;" + imgStyle; if (img.align == "right") imgStyle = "float:right;" + imgStyle; if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle; var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" ; img.outerHTML = strNewHTML ; j = j-1 ; } } } } ; /** * IE select 控件总在div的上面显示的BUG修正,这里使用隐藏select的方式,依赖下面这段代码 */ var ie_select_bug = true ; xu.browser.ie.hacker.SelectBug = function(){ this.select_array = $TagN('select') ; this.hadFixed = false ; this.doFix = function(){ if (this.select_array && this.select_array.length > 0){ xu.array.each(this.select_array,function(arr_e,index){ arr_e.style.display = 'none'; return arr_e ; }); this.hadFixed = true ; } }; this.notFix = function(){ if (this.hadFixed){ xu.array.each(this.select_array,function(arr_e,index){ arr_e.style.display = ''; return arr_e ; }); this.hadFixed = false ; } }; return this ; } ; var SelectBugFixed = new xu.browser.ie.hacker.SelectBug(); xu.browser.ie.hacker.bgImgCache(); xu.ready(function(){ xu.browser.ie.hacker.pngFixed(); }); }
相关文章推荐
- Delphi SynEdit控件里的显示Bug小修正
- 使div浮动层显示在Select组件上面
- 使div浮动层显示在Select组件上面
- 在ie,fierfox浏览器中,div层飘在flash上面显示的问题
- 如何让浮动的div层显示在select组件的上面
- IE 6/7/8 BUG:下拉框select设宽度时option超出显示不全
- android 2.3 webView select控件 无法及时显示optionLabel的BUG
- 使div浮动层显示在Select组件上面
- jQuery 解决 IE 6/7/8 BUG:下拉框select设宽度时option超出显示不全
- 使div浮动层显示在Select组件上面
- 如何让浮动的div层显示在select组件的上面
- ExtJS FormPanel控件只读状态在IE下不显示的BUG
- (源码实例)通过层DIV实现,当鼠标放在链接上面,显示图片及文字
- IE中改变div.innerHTML的bug
- 解决 Ie 6下 select挡住div的通用函数
- IE下, div无法在select上浮动的问题.
- 对 CSS 控件适配器处理事件的 Bug 进一步修正
- [原]为我的blog添彩:-)(修正FF下显示bug)
- Vista天气预报--修正不显示中国天气预报的BUG
- 一分钟学会IE控件加载并显示内存页面