SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript animations - how they do it

    Hello,
    How we are doing javascript animations , i mean how it is possible from what i've saw in internet nothing makes to me , and especially the javascript animations ,
    how they are able to animate such a think as fireworks ?

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,107
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Hi,

    Do you have an example of the thing you want to animate?

    If javascript in general doesn't make much sense to you then you wont be able to understand how to animate using javascript.

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the thing which i can't understand is the color selection on a selection from the screen about x=200; y=300 ;
    Code:
    var color=red;
    var x=200;
    var y=300;
    or function
    Code:
    function SomeFn(x,y,color){
    this.color=red;
    this.x=200;
    this.y=300;
    }
    Here are the things i can't understand :
    How to select area of the screen ;
    How to insert new object of type big red box in selected area , without using html and css , is javascript capable of do so ;
    In other words i am completelly confused , from i've red in the net , the people say with javascript anything can be done , well i find it painful.
    In other words how to program a big red box.

  4. #4
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,107
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    without using html and css , is javascript capable of do so
    Without HTML and css - javascript is a toy calculator

    Javascript can create / modify / delete html elements in the page - This is called DOM scripting because you are modifying the Document Object Model.
    You can also directly change the style attributes of html elements in the page with DOM scripting.

    So you don't select an area of the screen, rather you get a reference to the part of the DOM you want to change - which element in the page.

    Then you change it's properties using sets of functions,

    I think you would really benefit from the new Sitepoint book 'Simply Javascript' it's excellent.

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2007
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i will check the book , thank you .
    So you don't select an area of the screen, rather you get a reference to the part of the DOM you want to change - which element in the page.
    http://www.javascript-fx.com/submits...nes/index.html
    yeah like you said these fireworks are made from a simple dot(.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •