HTML5+CSS3旋转风车

JS

// JavaScript Document
$(document).ready(function(){
	setInterval('zb()',100);
	
})
var s=0;

var transformString = Modernizr.prefixed('transform');//引用插件,自动添加前缀


function zb(){
	var mi=$('#befor > img');
    s=Number(s)+10;
	mi.css(transformString, 'rotateX(0deg) rotateY(0deg) rotateZ('+s+'deg) translate3d(0px, 0px, 0px) scale3d(1,1,1)');
}

$(document).bind('mousedown',function(event){
	console.log(event.pageX+","+event.pageY);
})

 

HTML

<div class="container gbox">
      <h3>windmill</h3>
      <div class="windmill">
          <article>
              <section id="befor">
              <img src="images/3.png" style="transform:rotateX(0deg) rotateY(0deg) rotateZ(0deg) translate3d(0px, 0px, 0px) scale3d(1,1,1);transform-origin:65px 67px; position:absolute; transform-style:preserve-3d">
              </section>
          </article>
      </div>
     
</div>

 

CSS

@charset "utf-8";
/* CSS Document */

/* - 1.0. - CSS RESET
---------------------------------------------- */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,th,var{font-style:normal;font-weight:normal;}ol,ul{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;}
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display:block }
audio, canvas, video { display:inline-block; *display:inline;*zoom:1}
audio:not([controls]) {display:none}
[hidden] {display:none}
* { outline:0!important; -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; transition-timing-function:ease-out; -moz-transition-timing-function:ease-out; -webkit-transition-timing-function:ease-out; -o-transition-timing-function:ease-out; transition-duration:.3s;
-moz-transition-duration:.3s;-webkit-transition-duration:.3s;-o-transition-duration:.3s}
html { overflow-x:hidden; font-size:100%; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100% }

h3{font-size:30px; font-family:Arial}
.clear{clear:both}

/*windmill*/
.container{width:960px; height:auto; margin:0 auto; transform-style:preserve-3d}
.gbox h3{font-size:20px; text-align:center}
.windmill{margin-top:30px; transform-style:preserve-3d; text-align:center}

 

转载于:https://www.cnblogs.com/dean5277/archive/2012/09/13/2683718.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值