javascript 控制 CSS 滤镜 (4)
<head><style>
<!--
#flipfz
{
filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=0);
}
-->
</style>
<script language="JavaScript1.2">
var i=1;
function flip1()
{
if (i==4)
{i=0;}
abc.flipfz.style.filter="progid:DXImageTransform.Microsoft.BasicImage(Rotation=" + i + ")";
i++;
}
function flip2()
{
if (i==0)
{i=4;}
abc.flipfz.style.filter="progid:DXImageTransform.Microsoft.BasicImage(Rotation=" + i + ")";
i--;
}
</script>
<body>
<form name="abc">
1) Flip反转变换滤镜通道:<img src="pet_food.jpg" id="flipfz"><P>
<input type=button value="顺时针翻转" onClick=flip1()>
<input type=button value="逆时针翻转" onClick=flip2()>
</form>
</body>