标签云

微信群

扫码加入我们

WeChat QR Code

I've created this android app that sends onTouchEvents points to a web server, and I have a page which gets the motion points JSON data via Ajax like so:{"data":[{"x":224.28035,"y":235.4906},{"x":263.32916,"y":219.45718},{"x":293.3667,"y":215.44885},.....]}Now I want to use this data and animate a div on the screen with smooth path animation, similar to flash path animation, is there a plugin that solves this issue?PS: http://weepy.github.com/jquery.path/ does not seem to have a custom path animation, or I may be missing something.Thanks :)


github.com/weepy/jquery.path

2019年05月23日54分46秒

It was exactly what I was looking for... thanks :-)

2019年05月24日54分46秒

pathAnimator looks cool but the demo seems to have a serious error:Argument 1 of SVGPathElement.getPointAtLength is not a finite floating-point value. js/pathAnimator.js: line 68

2019年05月23日54分46秒

it works perfect for me on all supported browsers..Tested on IE9+, FF and Chrome. what is this SVGPathElement thing you are referring to?

2019年05月24日54分46秒

Strange! When I copy>paste the code from the Github page (github.com/yairEO/pathAnimator/blob/master/README.md) without changing anything, Firefox generates the floating-point error. Chrome does not generate this error, but it still fails to traverse the path.The full demo (in the zip file) IS working, so perhaps I should try and strip that down to the bare essentials. (the demo is a bit bloated, making the exact workings unclear).

2019年05月24日54分46秒

so maybe you did something wrong..? I must see what you did in order to understand it. And the demo is not bloated, it's super easy basic JS, and it's obvious only the first 46 lines of code on the main.js file are the core of how to use pathAnimator, and everything else is just things which are specific for the demo.

2019年05月23日54分46秒

By bloated I mean there's a lot of interface stuff going on, which makes it harder to get the pure animation code. The animation itself is very cool indeed! I'm glad someone took the trouble to make this, I'm sure I can find the error. I have created a JSFiddle with the github example: jsfiddle.net/6nnRW/1

2019年05月24日54分46秒