Move a div in a curved path (like tweening in Flash old days)?

前端 未结 4 1021
谎友^
谎友^ 2020-12-05 16:34

I\'d like to build a function like

fromHeretoThere(x1,y1,x2,y2){
  //....
}

So that I can move a

or an image from
4条回答
  •  生来不讨喜
    2020-12-05 17:26

    You can use at least:

    • JavaScript (http://api.jquery.com/animate/)
    • CSS3 Transitions (http://www.the-art-of-web.com/css/css-animation/)
    • Canvas (https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images)

    CSS3 is probably the easiest, but JavaScript would be the most browser compatible.

    You may also want to look at something like this:

    • http://jsanim.com/
    • http://processingjs.org/

    What is it that you're trying to do?

提交回复
热议问题