Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #24953

Re: Simple graphics/animation question

From Joao Rodrigues <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: Simple graphics/animation question
Date 2014-06-20 13:55 -0300
Organization Aioe.org NNTP Server
Message-ID <lo1p1p$g3k$1@speranza.aioe.org> (permalink)
References <ab26a5ad-8582-4ea5-85c9-1efa7e639aa3@googlegroups.com> <lo1c8n$gc2$1@dont-email.me>

Show all headers | View raw


Em 20/06/2014 10:17, Jukka K. Korpela escreveu:
> 2014-06-20 1:05, patchydunn@gmail.com wrote:
>
>> I'm relatively new to programming, but want to create a program with
>> the following function: An image of a ball moves across the screen
>> and goes "behind" an image of a basket. How feasible is this with
>> Javascript and HTML?
>
> Rather easy.
>
> You could even use just HTML and CSS: use a <marquee> element containing
> a ball as an image or as a character and a <span> element positioned
> over the <marquee> element.
>
> You could also use CSS animation to create the movement.

Try using animate.css:
<http://daneden.github.io/animate.css/>

>
> Alternatively, you can make the ball move with JavaScript, using
> setTimeout() to perform a change of its position at regular intervals.
>

I'd suggest experimenting with requestAnimationFrame function, which is 
widely supported and more efficient than the traditional setTimeout() 
approach:
<http://caniuse.com/requestanimationframe>

E.g. 
<http://flippinawesome.org/2014/05/20/frame-by-frame-animation-with-html-and-javascript/>

-- 
Joao Rodrigues (J.R.)

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Simple graphics/animation question patchydunn@gmail.com - 2014-06-19 15:05 -0700
  Re: Simple graphics/animation question "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-20 01:05 +0200
  Re: Simple graphics/animation question "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-06-20 16:17 +0300
    Re: Simple graphics/animation question Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-06-20 13:55 -0300
      Re: Simple graphics/animation question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-21 05:08 +0200
        Re: Simple graphics/animation question Joao Rodrigues <groups_jr-1@yahoo.com> - 2014-06-22 00:56 -0300
          Re: Simple graphics/animation question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-24 12:54 +0200
  Re: Simple graphics/animation question Danny <dann90038@gmail.com> - 2014-06-20 12:37 -0700
  Re: Simple graphics/animation question "Chris M. Thomasson" <no@spam.invalid> - 2014-06-20 16:53 -0700

csiph-web