拉斐尔变换规模传送

时间:2018-06-28 23:58:11

标签: javascript html transform scale raphael

我在Raphael缩放方面有点问题。

我的代码如下:

HTML

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>Mapa</title>
    <link rel="stylesheet" type="text/css" href="styles.css" /> 
</head>
<body>
<div class="map_container">
        <img src="images/map_gray_bg.png" alt="Map gray background" id="map_gray_bg" />
        <div id="map"></div>
        <h3 id="okres_name">SSSSSSSSSSSSSSS</h3>
    </div>



    <script type="text/javascript" src="raphael-lib.js"></script>
    <script type="text/javascript" src="map_copy.js"></script>
</body>
</html>

JavaScript

var rsr = Raphael('map', '1271.7809', '747.93085');


var okres102 = rsr.path("m 1141.7545,860.05392 c -0.5141,-0.6875 -0.8239,-4.175 -0.6885,-7.75 0.1355,-3.575 -0.193,-7.91421 -0.7299,-9.64268 l -0.9761,-3.14269 -3.2078,-0.48758 c -1.7644,-0.26818 -3.9658,-0.0915 -4.8922,0.39268 -0.9263,0.48415 -3.8738,0.88027 -6.55,0.88027 h -4.8657 l -1.244,-1.25 c -0.6842,-0.6875 -3.3267,-1.925 -5.8724,-2.75 l -4.6284,-1.5 -1.1616,-3.48454 -1.1616,-3.48453 -5.8367,-1.77693 c -3.2101,-0.97731 -7.224,-2.83518 -8.9198,-4.1286 l -3.0832,-2.35167 -2.4961,0.92652 c -1.3729,0.50958 -4.2535,0.952 -6.4014,0.98316 l -3.9051,0.0566 -1.8226,-2.37002 -1.8226,-2.37003 -0.022,-4.57186 -0.022,-4.57186 2.9722,-3.92814 c 1.6347,-2.16048 2.9847,-4.47976 3,-5.15397 0.015,-0.67421 -0.8452,-2.66132 -1.9121,-4.41581 l -1.94,-3.18997 1.44,-2.78453 c 0.7919,-1.5315 1.4399,-3.93189 1.4399,-5.3342 v -2.54966 h 3.0923 3.0922 l 2.6242,-2.0642 2.6242,-2.0642 1.2475,1.70601 c 0.6861,0.93831 1.4109,2.19642 1.6107,2.7958 0.1998,0.59939 1.8377,-0.58942 3.6397,-2.64181 l 3.2764,-3.7316 h 4.6739 4.6739 l 2.3456,-1.64291 2.3455,-1.6429 2.9613,1.74923 2.9612,1.74924 2.6657,-2.51391 2.6657,-2.5139 5.2941,-0.34243 5.2942,-0.34242 0.5368,2.14042 c 0.2952,1.17723 1.8503,3.39892 3.4558,4.93709 l 2.9191,2.79667 v 7.31291 7.31291 h -0.9326 c -1.2697,0 -2.164,3.12808 -2.4764,8.66236 l -0.2608,4.62017 2.7547,1.58097 2.7547,1.58097 0.6193,4.12969 0.6192,4.1297 2.4513,1.31185 2.4512,1.31185 2.0269,-1.83436 2.027,-1.83436 2.7327,2.55823 c 1.5031,1.40703 3.7453,2.86412 4.9828,3.23797 2.2327,0.6745 3.1589,2.54496 1.2602,2.54496 -1.6372,0 -7.7608,10.23898 -8.4217,14.08159 l -0.6159,3.5816 -2.3397,2.03431 -2.3397,2.03431 -0.667,5.02862 c -0.6457,4.86702 -2.5621,7.97034 -4.0211,6.51137 -0.3909,-0.39096 -0.4139,0.063 -0.051,1.00868 0.7711,2.00949 0.098,2.26369 -1.2439,0.46952 z")
    okres102.attr({ fill: '#00c2f6', "fill-opacity": '1', 'stroke-width': '0', 'stroke-opacity': '1' }).transform("t-336.84932,-178.33251").data('id', 'path5038');

当我这样做

okres102.mouseover(function (e) {
    this.scale(2);
});

一切正常,但是当我尝试放置转换

this.transform('s2');

因为我需要它来制作动画。它只是开始跳来跳去。我只是不知道该怎么办。

0 个答案:

没有答案