Codesnipp.it Social Code Sharing

Federico

Rotate element with Less 1.1.3

by Federico on Jun 13, 2011

This its not mine, i just use it i dont remember where found it. Include the rotate to Microsoft browsers [code] .rotation(@deg: 5deg){ @degree: @deg; @rotation: `parseInt(this.degree.toJS())`; @degToRadian: `Math.PI * 2 / 360`; @rad: `this.rotation.toJS() * this.degToRadian.toJS()`; @M11: `Math.cos(this.rad.toJS())`; @M21: `Math.sin(this.rad.toJS())`; // the properties -moz-transform: rotate(@deg); -webkit-transform: rotate(@deg); -o-transform: rotate(@deg); transform: rotate(@deg); filter: e(%("progid:DXImageTransform.Microsoft.Matrix(M11=%d, M12=-%d, M21=%d, M22=%d)", @M11, @M21, @M21, @M11)); } [/code]

Can't see the comments? Please login first :)