Permalink
Browse files

refactor about.js

+ update modernizr to v2.5.3, add prefixed()
  • Loading branch information...
1 parent b39809d commit 2f91b1700b5a5ca046087534b7d3e8a7da903c05 @desandro committed Apr 9, 2012
Showing with 20 additions and 19 deletions.
  1. +3 −3 _base/js/modernizr.js
  2. +2 −2 content/4.about/about.css
  3. +15 −14 content/4.about/about.js
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -115,8 +115,8 @@ h1 {
position: relative;
}
.csstransforms #socialize {
- margin-top: 40px;
- height: 400px;
+ margin-top: 80px;
+ height: 400px;
}
#socialize h2 {
View
@@ -1,16 +1,17 @@
-;$(function(){
- if( $('.csstransforms').length ) {
- var liCount = $('#socialize li').length;
+$(function(){
+
+ // position tranform links in pinwheel
+ if ( Modernizr.csstransforms ) {
+ var $socializeItems = $('#socialize li')
+ var liCount = $socializeItems.length
+ var transformProp = Modernizr.prefixed('transform')
+
+ var theta;
+
+ $socializeItems.each( function( i ) {
+ theta = ( 360 / liCount ) * i
+ this.style[ transformProp ] = 'rotate(' + theta + 'deg)'
+ })
+ }
- $('#socialize li').each(function(i){
- var theta = (360/liCount)*i;
- var transformation = 'rotate(' + theta + 'deg)';
- $(this).css({
- '-webkit-transform': transformation,
- '-moz-transform': transformation,
- '-o-transform': transformation
- });
- });
-
- }
});

0 comments on commit 2f91b17

Please sign in to comment.