日期:2014-05-16  浏览次数:20476 次

js如何在firefox下旋转背景图片
<html>
<head>
<title>测试</title>

<style>
.frame2{width:470px; height:400px; background:-moz-element(#im) no-repeat;background:element(#im) no-repeat;}
.out{display:none;}
</style>

</head>
<body>

<div id="frame1" style="overflow:hidden" width='500' height='600'>
    <div id="frame2" class="frame2">
        &nbsp;
    </div>
<img id='im' src='005.jpg' class="out">
</div>
<input type="button" onclick="return open();" value="点击"/>
<script type="text/javascript">
function open()
{
       var elem=document.getElementById("frame2");
       elem.style.MozTransform    = rotate(90deg);
       elem.style.WebkitTransform =  rotate(90deg);
       elem.style.OTransform      = rotate(90deg);
       elem.style.MsTransform     =  rotate(90deg);
       elem.style.transform       = rotate(90deg);
    
}

</script>

</body>
</html>
当前代码运行没有效果
js?背景图片?旋转

------解决方案--------------------
elem.style.MozTransform    = rotate(90deg);

-----》

elem.style.MozTransform    = 'rotate(90deg)';

应该是字符串