我爱黑客网首页 设为首页
加入收藏
联系我们
 首 页  技术文章 下载中心 站长学院 交流论坛
 软件:
 文章:        教程:
 推荐: 我爱黑客网论坛
 
 
 
 
   
黑软: Q Q 软件 木马间谍 探嗅监听 溢出攻击 加密解密 漏洞扫描 脚本注入 远程控制 综合利用 聊天工具  
 
技术文章: 爱黑新闻 | 黑客攻防 | 网络技术 | 程序设计 | 系统操作 | 本站动态 | 业界动态 | 安全公告 | 病毒公告 | 八卦黑客
 
 
您当前的位置:我爱黑客 -> 黑客攻防 -> 技术杂谈 -> 文章内容  
栏目导航
· Q Q 攻防 · 黑客入门
· 攻防实战 · 安全初步
· 工具详解 · 黑客教程
· 漏洞研究 · 黑客编程
· 技术杂谈
热门文章
· 为什么网站设计标准化..
· Ajax内部交流文档
· 自适应图片大小的弹出..
· 纯JS实现的动态表格
· 本来想写个Cs的Web服务..
· 看程序员们是如何喝酒..
· 使用MD5变换算法防穷举..
· JavaScript系列之防止..
· RSS 2.0 简明资料
· 在Blog上追加了「牛啦..
· 纯字符模仿Longhorn/o..
· 操作cookie的类 (DHTM..
相关文章

· Microsoft Windows即..
· Windows Plug-and-P..
· Microsoft Internet..
· windows 2003中配置..
· [图文] VPN On OpenB..
· 利用openbsd+openvp..
· 在NETBSD上配置ADSL..
· NEC推出邮件启动的V..
· 深信服VPN安全网关实..
· [图文] 虚拟私人网络..
查看更多与PNG alpha support for Internet Explorer相关内容

PNG alpha support for Internet Explorer
作者:佚名  来源:不详  发布时间:2007-1-8 12:26:53  发布人:ghostfire

减小字体 增大字体


点击下载此文件

引 用 :
Introduction

Internet Explorer doesn’t support the alpha channel in PNG images. However the fix is to use the "AlphaImageLoader" filter.
This script replaces all PNG images on the page with a blank image (blank.gif) and adds the "AlphaImageLoader" filter with the original image source.
The blank image is to avoid the "broken image" picture to display above the filter. This script also supports printing and changing the source image at runtime.


Source

代 码 :
//Array containing all PNG images on the page
var PNGimageArray = new Array();
var isPrinting = false;

//Path to the blank image (1x1 transparent)
var blankSrc = "blank.gif";

//Captures print events
window.attachEvent("onbeforeprint", function () { beforePrint(); } );
window.attachEvent("onafterprint", function () { afterPrint(); } );
//Tests if element is a PNG image, and if so fixes it
function addPngImage(element){
  if (/\.png$/i.test(element.src)) {
    fixImage(element);
    element.attachEvent("onpropertychange", function () 
      { propertyChanged(); } );
    PNGimageArray[PNGimageArray.length] = element;
  }
}

//Applies filter and changes source to blank
function fixImage(element) {
  element.runtimeStyle.filter = 
   "progid:DXImageTransform.Microsoft.AlphaImageLoader(
      src='" + element.src + "')";
  element.src = blankSrc;
}

//If property "src" is changed fixs image (not 
//if it is changed to blank though)
function propertyChanged() {
  if (isPrinting) return;
  var element = event.srcElement;
  var pName = event.propertyName;
  if (pName != "src") return;
  if (!new RegExp(blankSrc).test(element.src))
    fixImage(element);

}

//Turns image back to original before print (Explorer can't print filters)
function beforePrint() {
  isPrinting = true;
  var element;
  for(var i = 0; i < PNGimageArray.length; i++){
    element = PNGimageArray[i];
    element.src = element.filters[0].src;
    element.runtimeStyle.filter = "";
  }

}

//Fixes image after print
function afterPrint() {
  isPrinting = false;
  var element;
  for(var i = 0; i < PNGimageArray.length; i++){
    element = PNGimageArray[i];
    fixImage(element);

  }
}


Style that makes all images run the addPngImage function. I use "expression" instead of "behavior" to avoid some security issues in Internet Explorer. 

代 码 :
<style type="text/css"> img { filter:expression(addPngImage(this)); }
</style>


点击下载此文件


[Last Edited By KusTa @ 2005-11-26 05:06 PM]

查看更多与PNG alpha support for Internet Explorer相关内容

[ ] [返回上一页] [打 印] [收 藏]
上一篇文章:
下一篇文章:
      PHP:三个版本的共同承诺       用!important解决IE和Mozilla/FF/Opera的布局差别
∷相关文章评论∷   (评论内容只代表网友观点,与本站立场无关!) [发表评论]
 
 
 
 
晋ICP备05008232   维护网络安全、传播安全技术才是我们的目标! 
 
关于本站 - 网站帮助 - - 下载声明 - 友情连接 -网站地图