标题: png在IE6下使用滤镜的方法,但表单为什么却失效
bushiwo
新手上路
Rank: 1


UID 22144
精华 0
积分 7
帖子 6
下载币 35 枚
推广分 0 点
经验值 12 点
阅读权限 10
注册 2006-9-20
状态 离线
发表于 2008-3-5 16:29  资料  个人空间  短消息  加为好友 
png在IE6下使用滤镜的方法,但表单为什么却失效



<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body{
        background-color: #406FB2;
        background-image:url(images/bg_02.gif);
        background-repeat: repeat-x;
        background-position: top;
        margin:0px;
        padding:0px;
        TEXT-ALIGN: center;
}
form {
        margin:0px;
        padding:0px;
}
input {
        font-family: Tahoma, Arial, Helvetica, sans-serif;
        font-size: 11px;
}
.login{
background-image:url(images/login3.png);
        height:106px;
        }
.border_input_normal {
        border: 1px solid #8FA2AB;
        font-size:12px;
        background-color:#E4ECF0;
}
.border_input_clicked {
        border: 1px solid #46A8E4;
        background-color:#ffffff;
        font-size:12px;
}
.login_tip a:link {
        color: #666666;
        font-size: 11px;
        text-decoration: none;
}
.login_tip a:visited {
        font-size: 11px;
        color: #666666;
        text-decoration: none;
}
.login_tip a:hover {
        font-size: 11px;
        color: #000000;
        text-decoration: none;
}
.login_bottom {
        margin-top:5px;
}
.login_bottom td{
        font-family: Tahoma;
        font-size: 10px;
        color:#dcf3ff;
}
.login_bottom a:link {
        color: #dcf3ff;
        font-size: 11px;
        text-decoration: none;
}
.login_bottom a:visited {
        font-size: 11px;
        color: #dcf3ff;
        text-decoration: none;
}
.login_bottom a:hover {
        font-size: 11px;
        color: #FFFFFF;
        text-decoration: none;
}

#tip3{
        color:#C9DFF0;
        padding-top:50px;
        font-size: 12px;
        width:704px;
        MARGIN-RIGHT: auto;
    MARGIN-LEFT: auto;
    height:20px;
    width:704px;
    vertical-align:middle;
    line-height:30px;
        }
.btn_mout {
        height: 23px;
        width: 90px;
        margin-left:260px;
        margin-top:7px;
        color: #344f9e;
        border: none;
        background-color: #F9F8F9;
        background-image: url(images/login_l_12.gif);
        background-repeat: no-repeat;
        background-position: 0 0;
}
.login2{
background-image:url(images/login4.png);
height:113px;
width:469px;
}
.btn_mover {
        height: 23px;
        margin-left:260px;
        margin-top:7px;
        width: 90px;
        color: #F9F8F9;
        border: none;
        background-color: #FFFfff;
        background-image:url(images/btn_login1.gif);
        background-repeat: no-repeat;
        background-position: 0 0;
}
.border_input_normal1 {        border: 1px solid #cccccc;
        font-size:12px;
        }
#login{
width:704px;
height:185px;

}
#login1{
width:704px;
height:185px;
background-image:url(images/login2.png);
}
#login2{
width:704px;
height:76px;
background-image:url(images/login3.png);
}
#input1{
margin-left:400px;
margin-top:80px;
height:25px;
width:200px;
font-size:12px;
color:#454545;

}
#input2{
margin-left:400px;
height:25px;
width:200px;
font-size:12px;
color:#454545;

}
#icon{
width:95px;
height:25px;
margin-left:348px;
margin-top:20px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function correctPNG()
   {
   for(var i=0; i<document.images.length; i++)
      {
     var img = document.images[i]
     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
       i = i-1
        }
      }
   }
function alphaBackgrounds(){
   var rslt = navigator.appVersion.match(/MSIE (d+.d+)/, '');
   var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
   for (i=0; i<document.all.length; i++){
      var bg = document.all[i].currentStyle.backgroundImage;
      if (bg){
         if (bg.match(/.png/i) != null){
            var mypng = bg.substring(5,bg.length-2);
   //alert(mypng);
            document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='crop')";
            document.all[i].style.backgroundImage = "url('')";
   //alert(document.all[i].style.filter);
         }                                               
      }
   }
}

if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
window.attachEvent("onload", correctPNG);
window.attachEvent("onload", alphaBackgrounds);
}
-->
</script>
</head>
<body>
<div style="position:absolute; left: expression((body.clientWidth-704)/2); top:expression((body.clientHeight-550)/2); width: 704; height: 550";>
<form name="test" id="test" action="">
<div id="login"><img src="images/login.png" width="704" height="185" /></div>
<div id="login1"><div id="input1">用户名:
    <input name="password" type="password" class="border_input_normal" id="password" size="20" onClick="change(0)"/>
</div>
<div id="input2">密 码:
  <input name="username" type="text" class="border_input_normal" id="username" size="20" onClick="change(1)"/>
</div></div>
<div id="login2"><div id="icon"><a href="frameset.htm"><img src="images/login_l_12.gif" border="0" /></a></div>
</div>
<div id="tip3">版权所有:中国移动通信集团广东东莞分公司     技术支持:深圳市伟图科技开发有限公司</div>
</form>
</div>
</body>
</html>



把下面的网址贴到网络上任何地方,可以获得下载币 详情点击这里
http://bbs.sj63.com/viewthread.php?tid=10753&fromuid=0 复制本帖地址
顶部
[广告] 如何快速赚取论坛下载币?


当前时区 GMT+8, 现在时间是 2008-7-4 23:46
粤ICP备05029101号