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

一个div可以实现边平移边旋转吗?
如题 
用jquery做吗?
伸手求代码 谢谢
css3 html5 jquery 网站开发 网页设计

------解决方案--------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<FCK:meta http-equiv="Content-Type" content="text/html; charset=utf-8"  />
<title>Tester</title>
<style type="text/css">

#panel {position: relative; width: 300px; height:310px; background: url('Logo300px.png'); cursor: pointer}

#test{}

</style>
<script src="jquery-1.9.0.min.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function(){
$("#panel").animate({left: "700px", height:"310px" ,opacity: "1"}, 500)
 .animate({left: "500px" , width :"300px"}, 3000 );  
var $elie = $("#panel"), degree = 0, timer;
    rotate();
    function rotate() {
        
        $elie.css({ WebkitTransform: 'rotate(' + degree + 'deg)'});  
        $elie.css({ '-moz-transform': 'rotate(' + degree + 'deg)'});                      
        timer = setTimeout(function() {
            ++degree; rotate();
        },5);
    }
document.getElementById('test').innerHTML = $(window).width(); 
   }
</script>
</head>
<body>

<div id="panel"></div>
<label id="test"> test </label>

</html>


//========把jquery 1.9.0 和 你要的div 以及 code (html)文件 放到一个文件夹里===========