Skip to content

有害部落格同好會

2006/02/05 / JavaScript, VBScript

讓 IE 可以處理透明 PNG 圖形

參考來源:PNG in Windows IE

適合有架設網站的人士使用。指令碼只針對 IE 5.5/6 處理,其餘瀏覽器自動忽略。

1. 下載 pngfix.js 檔案,儲存到適當的地方。

2. 將以下敘述加至 區段。放在其餘地方也可以,但是不建議。

HTML 代碼:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
<script src="pngfix.js" default type="text/javascript">
/*
Correctly handle PNG transparency in Win IE 5.5 & 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.
Use in with DEFER keyword wrapped in conditional comments:
<script src="" defer type=""></SCRIPT>
*/
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
 
if ((version >= 5.5) && (document.body.filters))
{
for(var i=0; i<document.images.length; img.src.touppercase()
if (imgname.substring(imgname.length-3, imgname.length)="=" (img.id) ? "id="" + img.id + "" (img.classname) ? "class="" + img.classname + "" (img.title) ? "title="" + img.title + "" " : "title="" + img.alt + "" "display:inline-block;" + img.style.csstext
if (img.align="=" "float:left;" + imgstyle
if (img.align="=" > + " style="" + "width:" + img.width + "px; height:" + img.height + "px;" + imgstyle + ";"
+ "filter:progid:dximagetransform.microsoft.alphaimageloader"
+ "(src="" + img.src + "', sizingmethod="scale">"
img.outerHTML = strNewHTML
i = i-1
}
}
}
</script>

<script src="pngfix.js" default type="text/javascript"> /* Correctly handle PNG transparency in Win IE 5.5 & 6. http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006. Use in with DEFER keyword wrapped in conditional comments: <script src="" defer type=""></SCRIPT> */ var arVersion = navigator.appVersion.split("MSIE") var version = parseFloat(arVersion[1]) if ((version >= 5.5) && (document.body.filters)) { for(var i=0; i<document.images.length; img.src.touppercase() if (imgname.substring(imgname.length-3, imgname.length)="=" (img.id) ? "id="" + img.id + "" (img.classname) ? "class="" + img.classname + "" (img.title) ? "title="" + img.title + "" " : "title="" + img.alt + "" "display:inline-block;" + img.style.csstext if (img.align="=" "float:left;" + imgstyle if (img.align="=" > + " style="" + "width:" + img.width + "px; height:" + img.height + "px;" + imgstyle + ";" + "filter:progid:dximagetransform.microsoft.alphaimageloader" + "(src="" + img.src + "', sizingmethod="scale">" img.outerHTML = strNewHTML i = i-1 } } } </script>

Post navigation

Previous Post:

把那五個字留給女生

Next Post:

隱藏在XP中的磁碟工具

分類

  • 新奇有趣の搶先報導
    • Raspberry Pi
    • 手機相關
    • 推薦軟體
    • 新鮮有趣
    • 生活資訊
  • 想破腦袋の程式技巧
    • Oracle EBS
    • Database
    • Excel, VBA
    • php
    • JavaScript, VBScript
    • VS.NET
    • Others
    • Windows
    • SAP
  • 撩動心弦の短文小品
  • 聚沙成塔の理財守則
  • 不可不知の職場實錄
  • 剎那永恆の生活翦影

近期文章

  • 受保護的內容: 如何透過Personalize功能呼叫另一form來回傳值
  • Win10 / 8 / 7 無法安裝 SSD
  • 受保護的內容: 樹梅派+遠端連線
  • EBS R12 取得客戶的phone, email, URL資料
  • 受保護的內容: 管控Workflow Administrator Role

友站

  • Masaya396's 協奏曲
  • 老塗的咁仔店

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

Tag Cloud

你目前使用的瀏覽器不支援 HTML5 的 CANVAS 標籤。

  • 管理
  • php
  • 感情
  • WinXP
  • HTC
  • excel
  • VB6
  • EBS 11.5.10
  • EBS 12.1.3
  • VB.Net
  • Oracle DB
  • SAP
  • SQL
  • javascript
  • Oracle EBS
  • MySql
  • CSS
  • VBA
  • LDAP
  • Win7
© 2025 有害部落格同好會 - Powered by SimplyNews