Snap.svg
Snap.svg copied to clipboard
What's this Error with n.animate() - Cannot read property 'from' of undefined?
Can you tell me why I get this error `snap.svg-min.js?ver=1547965643:20 Uncaught TypeError: Cannot read property 'from' of undefined with:
var n = Snap("#fan_back");
console.log('here = ' + s + set);
console.log('selector = ' + n );
var n_bbox = n.getBBox();
console.log('boxxxxx = ' + n_bbox.x + 'yyyy= ' + n_bbox.y);
n.animate({transform: 't0,200'}, 5000, mina.backout, function () { n.animate({transform: 't0,0'}, 5000, mina.backin) });
console output:`
selector = <g id="fan_back" transform="matrix(.12621 0 0 .11663 64.247 -229.29)" xmlns="http://www.w3.org/2000/svg"><path id="path6462-3" d="m256.16 438.16c-81.738 0-148.24-66.499-148.24-148.24 0-21.983 4.702-43.148 13.976-62.908l27.158 12.746c-7.388 15.741-11.134 32.618-11.134 50.162 0 65.197 53.041 118.24 118.24 118.24z" style="fill:#c5c9f7"></path><path id="path6464" d="m336.53 414.5-16.285-25.195c33.908-21.916 54.152-59.068 54.152-99.383 0-27.402-9.587-54.11-26.994-75.203l23.139-19.096c21.832 26.455 33.855 59.944 33.855 94.299 0 50.54-25.371 97.111-67.867 124.58z" style="fill:#a7aff2"></path><path id="path6466" d="m167.96 211.17-22.369-19.99c28.108-31.453 68.406-49.492 110.56-49.492 22.509 0 44.135 4.921 64.275 14.626l-13.021 27.025c-16.047-7.731-33.291-11.651-51.254-11.651-33.624 0-65.769 14.39-88.193 39.482z" style="fill:#c5c9f7"></path><path id="path6468-6" d="m86.885 237.21-28.646-8.91c12.849-41.311 39.099-78.4 73.916-104.44 36.021-26.939 78.901-41.179 124-41.179 27.268 0 53.776 5.218 78.791 15.508l-11.414 27.744c-21.375-8.793-44.044-13.252-67.377-13.252-78.08 0-146.11 50.044-169.27 124.53z" style="fill:#c5c9f7"></path><path id="path6470" d="m298.61 492.8c-13.87 2.89-28.13 4.36-42.41 4.36h-.04c-50.58 0-99.29-18.43-137.16-51.88-37.53-33.16-61.78-78.63-68.29-128.05l29.74-3.92c11.56 87.71 87.09 153.85 175.71 153.85h.04c12.23 0 24.43-1.26 36.29-3.73z" style="fill:#c5c9f7"></path><path id="path6472" d="m382.7 454.05-18.334-23.746c43.868-33.868 69.027-85.036 69.027-140.38 0-50.681-21.771-99.045-59.732-132.69l19.898-22.451c44.381 39.335 69.834 95.882 69.834 155.14 0 32.664-7.386 63.927-21.952 92.919-13.883 27.634-34.195 52.257-58.741 71.208z" style="fill:#a7aff2"></path><path id="path6474-1" d="m256.19 366.56c-42.256 0-76.634-34.378-76.634-76.635 0-42.256 34.378-76.634 76.634-76.634s76.634 34.378 76.634 76.634c0 42.257-34.378 76.635-76.634 76.635zm0-123.27c-25.714 0-46.634 20.92-46.634 46.634 0 25.715 20.92 46.635 46.634 46.635s46.634-20.92 46.634-46.635c0-25.714-20.92-46.634-46.634-46.634z"></path><path id="path6476" d="m292.49 463.44 6.12 29.37c-13.87 2.89-28.13 4.36-42.41 4.36v-30c12.23 0 24.43-1.26 36.29-3.73z" style="fill:#a7aff2"></path><g id="g6484"><path id="path6478" d="m357.98 62.855-51.95 181.24-14.42-4.13h-70.84l-14.42 4.13-51.94-181.24 5.56-6.17c23.82-26.47 58.89-41.66 96.22-41.66h.01c37.33 0 72.4 15.19 96.22 41.66z" style="fill:#ffaa20"></path><path id="path6480-3" d="m512.19 361.28c0 22.72-6.12 45.66-18.06 66.3-18.69 32.31-49.4 55.07-84.24 62.43l-8.13 1.72-130.86-135.72 10.8-10.41 35.47-61.32 3.65-14.55 182.89 45.79 2.56 7.91c3.97 12.24 5.92 25.01 5.92 37.85z" style="fill:#ffaa20"></path><path id="path6482" d="m195.23 284.12-3.605-14.562-183.01 45.303-2.585 7.899c-11.072 33.849-6.752 71.822 11.854 104.18 18.605 32.361 49.249 55.2 84.073 62.659l8.127 1.741 131.23-135.37-10.771-10.441z" style="fill:#ffaa20"></path></g><path id="path6486-8" d="m291.61 239.96h-35.41v-224.94c37.33 0 72.4 15.19 96.22 41.66l5.56 6.17-51.95 181.24z" style="fill:#ff8900"></path><path id="path6488" d="m512.19 361.28c0 22.72-6.12 45.66-18.06 66.3-18.69 32.31-49.4 55.07-84.24 62.43l-8.13 1.72-130.86-135.72 10.8-10.41 35.47-61.32 3.65-14.55 182.89 45.79 2.56 7.91c3.97 12.24 5.92 25.01 5.92 37.85z" style="fill:#ff8900"></path><path id="path6490" d="m332.83 289.92c0 42.25-34.37 76.62-76.63 76.63h-.01c-42.25 0-76.63-34.38-76.63-76.63 0-42.26 34.38-76.64 76.63-76.64h.01c42.26.01 76.63 34.38 76.63 76.64z" style="fill:#97a1f0"></path><path id="path6492-4" d="m332.83 289.92c0 42.25-34.37 76.62-76.63 76.63v-153.27c42.26.01 76.63 34.38 76.63 76.64z" style="fill:#7985eb"></path></g>
block.js?1db4:229
boxxxxx = 64.24752598733902yyyy= -227.53821690170287
snap.svg-min.js?ver=1547965643:20 Uncaught TypeError: Cannot read property 'from' of undefined
at s.i.animate (snap.svg-min.js?ver=1547965643:20)
at onSVGLoaded (block.js?1db4:230)
at snap.svg-min.js?ver=1547965643:19
at c (snap.svg-min.js?ver=1547965643:19)
at eve (snap.svg-min.js?ver=1547965643:19)
at XMLHttpRequest.g.onreadystatechange (snap.svg-min.js?ver=1547965643:19)
Thanks for any help
Have you tried with a different version of Snap (0.5.2 on the dev branch or 0.4.1) out of interest ?