Last active
December 16, 2015 13:19
-
-
Save rodrigo-x/5440768 to your computer and use it in GitHub Desktop.
Girar o texto..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Giro = (function () { | |
var getTransformProperty = (function (element) { | |
var properties = [ | |
'transform', | |
'WebkitTransform', | |
'msTransform', | |
'MozTransform', | |
'OTransform' | |
]; | |
var prop; | |
while (prop = properties.shift()) { | |
if (typeof element.style[prop] != 'undefined') { | |
return prop; | |
} | |
} | |
return false; | |
}); | |
var modifyText = (function () { | |
var div = document.getElementById('efeito'); | |
var property = getTransformProperty(div); | |
if (property) { | |
var i = 0; | |
setInterval(function () { | |
div.style[property] = 'rotate(' + (i++ % 360) + 'deg)'; | |
}, 100); | |
} | |
}); | |
return { | |
Animar: modifyText, | |
}; | |
}()); | |
Giro.Animar(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Rodrigo Nery</title> | |
</head> | |
<body> | |
<div id="efeito" class="span4"> | |
<h1>< Rodrigo Nery ></h1> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment