js+css 使div背景图在ie6中透明
一个小东西 就不叙述了
banner为div的ID
<script type="text/javascript">
var banner = document.getElementById('banner');
var bgimg = banner.currentStyle.backgroundImage;
var ss = bgimg.split('"');
</script>
<style type="text/css">
#banner{
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='11.jpg'); /* IE6 */
_background-image: none;
*+background-image: none;
}
</style>
<script type="text/javascript">
var banner = document.getElementById('banner');
banner.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ss[1]+"')";
</script>