3个回答
推荐于2016-10-16
展开全部
<!DOCTYPE HTML>
<html>
<head>
<meta charset=UTF-8>
<title>recursion</title>
<style type="text/css">
</style>
<script type="text/javascript">
var test = function ()
{
var reg = /(rotate\([\-\+]?((\d+)(deg))\))/i;
var wt = div.style['-webkit-transform'], wts = wt.match (reg);
var $2 = RegExp.$2;
console.log ($2);
div.style['-webkit-transform'] = wt.replace ($2, parseFloat (RegExp.$3) + 10 + RegExp.$4);
}
</script>
</head>
<body>
<button onclick="test();">rotate</button>
<div id="div" style="width: 300px; height: 300px; border: 1px solid black; -webkit-transform: translate(300px, 0px) rotate(10deg) scale(1, 1)">ddd</div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询