IE6.0 use PNG in JS (for PNG transparency)

2010-07-12  来源:本站原创  分类:Tech  人气:179 

This carried over: http://lcgcg.blog.163.com/blog/static/8271841920086101057963/

IE6.0 use PNG's JS

div + CSS 2008-07-10 13:00:57 read 400 comments 0 font size: large, medium

Code

var arVersion = navigator.appVersion.split ("MSIE")

var version = parseFloat (arVersion [1])

function fixPNG (myImage)

(

if ((version> = 5.5) & & (version <7) & & (document.body.filters))

(

var imgID = (myImage.id)? "id = '" + myImage.id + "'": ""

var imgClass = (myImage.className)? "class = '" + myImage.className + "'": ""

var imgTitle = (myImage.title)?

"Title = '" + myImage.title + "'": "title = '" + myImage.alt + "'"

var imgStyle = "display: inline-block;" + myImage.style.cssText

var strNewHTML = "<span" + imgID + imgClass + imgTitle

+ "\" "+" Width: "+ myImage.width

+ "Px; height:" + myImage.height

+ "Px;" + imgStyle + ";"

+ "Filter: progid: DXImageTransform.Microsoft.AlphaImageLoader"

+ "(Src = \ '" + myImage.src + "\', sizingMethod = 'scale'); \"> </ span> "

myImage.outerHTML = strNewHTML

)

)

Usage:

In the template add in paragraph <HEAD>

<script language="JavaScript" type="text/javascript" src="pngfix.js"> </ script>

[Note that your path]

Want to place a transparent png formats:

<img src="xyz.png" alt="foo" width="10" height="20" onload="fixPNG(this)">

Note that your image is not high and wide to remove it! Is more onload = "fixpng (this)" only.

相关文章
  • IE6.0 use PNG in JS (for PNG transparency) 2010-07-12

    This carried over: http://lcgcg.blog.163.com/blog/static/8271841920086101057963/ IE6.0 use PNG's JS div + CSS 2008-07-10 13:00:57 read 400 comments 0 font size: large, medium Code var arVersion = navigator.appVersion.split ("MSIE") var version =

  • js优化针对IE6.0起作用(详细整理) 2014-11-24

    js优化针对IE6.0起作用,总结一下几点:字符串拼接.for 循环.减少页面的重绘.减少作用域链上的查找次数.避免双重解释等等,需要了解的朋友可以参考下,或许会有所帮助 js优化针对IE6.0起作用,总结一下几点: 一,字符串拼接:用数组拼接 function func2(){ var start = new Date().getTime(); var array = []; for(var i = 0; i < 10000; i++){ array[i] = "<input ty

  • Most all of the CSS browser compatibility issues order (IE6.0.IE7.0 and FireFox) (reproduced) 2010-04-15

    CSS browser compatibility is sometimes very stressful, and perhaps when you know the skill with which the principle will be that is not difficult, from the online collection of IE7, 6 compatibility with Fireofx approach and organize a bit. For web2.0

  • Most all of the CSS browser compatibility issues order (IE6.0.IE7.0 and FireFox) 2010-04-18

    CSS browser compatibility is sometimes very stressful, and perhaps when you know the skill with which the principle will be that is not difficult, from the online collection of IE7, 6 compatibility with Fireofx approach and organize a bit. For web2.0

  • css IE6.0.IE7.0 compatible with FireFox CSS solution 2010-07-26

    Quote: http://hi.baidu.com/% C2% AB% DC% F6% C1% FA% D2% BB/blog/item/1cd59e15d470e20a4b90a74e.html good article helped me solve a big problem IE6.0, IE7.0 and FireFox CSS-compatible solutions 2009-04-29 14:51 1.DOCTYPE affect CSS handling 2.FF: div

  • IE6.0.IE7.0 compatible with FireFox CSS solution 2010-08-25

    IE6.0, IE7.0 and FireFox CSS-compatible solutions 1.DOCTYPE affect CSS handling 2.FF: div to set margin-left, margin-right to auto, has been centered, IE not work 3.FF: body when setting text-align, div need to set the margin: auto (mainly margin-lef

  • IE5.5 and IE6.0 in the background transparent png problem 2010-11-21

    IE5.5 and IE6.0 in the background transparent png problem recently discovered a very simple and can handle ie5.5, ie6.0 super simple way. First to http://www.twinhelix.com/css/iepngfix/ download iepngfix.zip (15kb). Then extract the files inside the

  • 我教你学之IE6.0性能注册表修改实例 2014-02-15

    微软的IE浏览器大家一定都不陌生吧,虽然,许多用户现在都安装了MYIE.GOSURF等其它的浏览器,但是IE浏览器的地位在整个Windows系统中仍然至关重要,这点从卸载IE会带来的诸多麻烦中就可见一斑了.这里,让我们来看看如何使用注册表修改让您的IE6.0性能完全尽在掌握,让IE的功能也变得如此合适您自己的口味. ●给IE浏览器的工具栏选择背景图案: 通常IE浏览器的工具栏是没有背景图案的,通过Windows XP注册表的修改您可以给它加上背景图案,打开HKEY_CURRENT_USERSof

  • Let ie6.0 + support css3 2010-04-27

    Saw an article here today to IE6, 7 and 8 support for CSS3 Previously heard of htc, but has no care about how to use. Search, I read an old article on the htc, I would like to own though outdated, but also new knowledge on their own, and whether that

  • IE6.IE7.IE8的CSS.JS兼容 2012-07-06

    Internet Explorer 6中查看使用 Microsoft JScript 的网页,可能会遇到web浏览器速度较慢的性能问题.原因是如果js脚本同时创建大量变量,jscript引擎执行垃圾收集算法时会监视脚本中变量分配的 数量.脚本中使用的文字值的数量和脚本中分配的字符串值的总大小,如果超过这些值的阈值,就会发生垃圾收集,垃圾收集进程会中断正在运行的脚本.因此,这 些运行中的脚本将被挂起,直至垃圾收集完成为止. IE6 . IE7 . IE8 在 CSS 和 JS 方面的区别 : 1.

  • [Multi-browser compatibility issues] IE6.0.IE7.0. FireFox in the different writing styles 2010-03-31

    Original Source: http://www.xianzheng.net.cn/post/ie6-ie7-firefox-css-02.html Reference Articles: http://www.javaeye.com/topic/602506 Perhaps you have been complaining about why the written specifically for IE and FF a different css, why such a heada

  • [Multi-browser compatibility issues] IE6.0.IE7.0. FireFox written in different styles 2010-11-30

    Original Source: http://www.xianzheng.net.cn/post/ie6-ie7-firefox-css-02.html Reference article: http://www.javaeye.com/topic/602506 Perhaps you have been complaining about why the written specifically for IE and FF different css, why the IE this hea

  • IE6.0,ie7.0与Firefox的CSS兼容性问题 2014-04-21

    现在我大部分都是用!important来hack,对于ie6和firefox测试可以正常显示,但是ie7对!important可以正确解释,会导致页面没按要求显示!搜索了一下,找到一个针对IE7不错的hack方式就是使用"*+html",现在用IE7浏览一下,应该没有问题了. 现在写一个CSS可以这样: #example { color: #333; } /* Moz */ * html #example { color: #666; } /* IE6 */ *+html #examp

  • org.studio.crusoe.mobile.android alpha 0.2 extended web js API 2010-12-14

    Standard function expansion alert () Js alert overload the standard functions, the system uses to achieve the local AlertDialog alert the prompts. confirm () Confirm the standard js function overloading, the system uses to achieve the local AlertDial

  • ie6下png图片背景不透明的解决办法使用js实现 2014-03-15

    我们时常在使用png图片的时候,在ie6下发生背景不透明的问题,解决的方法实在是太多了,下面给大家介绍下一个js解决的方式,感兴趣的朋友可以了解下的 我们时常在使用png图片的时候,在ie6下发生背景不透明的问题,下面给大家介绍下一个js解决的方式. 首先我们要用到一个js,代码如下: /** * DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML <IMG/>. * Author: Dre

  • 日历控件在FF2.0,ie6下测试可用 2014-05-25

    有什么意见,提一下.偶以后改进 ps:在FF2.0,ie6下测试没问题 为保证输入正确,记得给控件加个readonly /********************************************************* * 使用方法 * 控件调用onclick="fPopCalendar(event,this,this)" * 如下,给控件设置为readonly * <input type="text" style="border:

  • JS控制显示隐藏兼容问题(IE6.IE7.IE8) 2014-08-23

    IE6.IE7.IE8 JS控制显示隐藏兼容问题 在IE7中, 使用jQuery 显示:$("#a").attr("style",""); 隐藏:$("#a").attr("style","display:none"); 但是显示这个方法在IE8中不行 IE8 显示:$("#a").removeAttr("style"); 隐藏:$("#

  • JS控件autocomplete 0.11演示及下载 1月5日已更新 2014-11-07

    1月5日已更新 修复自动完成文本框焦点移失,自动完成容器不能消失的bug 增加expandAllItem方法,双击时可出现全部的item,详情请看示例 增加customStyle示例,该示例演示了如何对autocomplete控件进行css美化,见autocomplete_custom的css文件 演示及下载: http://www.never-online.net/code/neverModules/autocomplete/ 功能较上一版本的改进和功能: 1.匹配速度的提高. 2.加入ign

  • JS access to the window width and height 2008-12-10

    DOCTYPE declaration in the absence of circumstances: document.body.clientWidth document.body.clientHeight For the current window width / height; DOCTYPE declaration in the future document.body.clientWidth document.body.clientHeight For the entire pag

  • In ie6 and previous versions of Chinese url url transmission solutions 2010-05-13

    Prerequisite: Background are using utf-8 access, URL parameters. Reason: IE6.0 and earlier, through the address bar enter the URL, use the default encoding is gbk IE7.0, IE8 version, enter the URL in the Address bar, use the default encoding is UTF-8