में फिट नहीं Raphael.js प्रलेखन
var el = paper.rect(10, 20, 300, 200);
// translate 100, 100, rotate 45°, translate -100, 0
el.transform("t100,100r45t-100,0");
// if you want you can append or prepend transformations
el.transform("...t50,50");
el.transform("s2...");
// or even wrap
el.transform("t50,50...t-50-50");
// to reset transformation call method with empty string
el.transform("");
// to get current value call it without parameters
console.log(el.transform());
के अनुसार Check this Fiddle: सभी परिवर्तनों का प्रदर्शन
var icon = paper.rect(100,200,100,100);
var anim = Raphael.animation({
"10%":{transform:'t100,0'}, //transform on x-axis
"20%":{transform:'...t0,100'},//transform on y-axis
"30%":{transform:'...t-100,0'},//transform on x-axis(negative)
"40%":{transform:'...t0,-100'},//transform on y-axis(negative)
"50%":{transform:'...t200,200'},//transform diagonally
"60%":{transform:'...t-100,-100'},//transform diagonally(negative)
"70%":{transform:'...s1,1.5'},//scale y-axis
"80%":{transform:'...s1.5,1'},//scale x-axis
"90%":{transform:'...s2'},//scale in both direction
"100%":{transform:'...r45'},//rotate
},5000);
icon.animate(anim.delay(1000));
।
तो अपने मामले में आप इस करना होगा:
वर SomeName = paper.path ("पथ का समन्वय करता है") को बदलने ('s2,3');
जहां 2 चौड़ाई & 3 ऊंचाई के लिए है।
thx, लेकिन यह मेरी समस्या के लिए बिल्कुल सही नहीं है। यदि मैं आपके कोड ट्रांसफॉर्म का उपयोग करता हूं, तो मुझे वही प्रभाव मिलता है, जैसे दस्तावेज़ में "element.scale"। –
तो यदि आप पैरेंट चौड़ाई और ऊंचाई बदलते हैं तो आइकन –
करना चाहते हैं - आइकन सभी जगह भरें। धन्यवाद। –