Я пытаюсь сделать очень простой скрипт поворота HTML5 / jQuery.Вот код:
$(document).find("[data-rot]").each(function(i, e) {
var rotation = $(this).attr("data-rot");
console.log(i+' '+rotation);
$(this).css({ '-moz-transform': rotation, '-webkit-transform': rotation });
});
И HTML:
<div data-rot="90">Rotate me 90 degrees</div>
<div data-rot="20">Rotate me 20 degrees</div>
<div data-rot="180">Rotate me 180 degrees</div>
<div data-rot="300">Rotate me 300 degrees</div>
Что я делаю не так?Console.log () работает.