HTML, XHTML and CSS All-In-One for Dummies by Andy Harris

HTML, XHTML and CSS All-In-One for Dummies by Andy Harris

Author:Andy Harris
Language: eng
Format: mobi
Tags: Web, Document Markup Languages, Cascading Style Sheets, Programming Languages, Computers, HTML (Document Markup Language), General, Html, Internet, XHTML (Document Markup Language), Web Page Design, Web Programming
ISBN: 9780470537558
Publisher: For Dummies
Published: 2010-11-01T10:00:00+00:00


2. Get a reference to the surface.

Use the normal document.getElementById trick to extract the sprite from the page. Be sure the sprite you’re animating has absolute position with top and left properties defined in a local style.

var surface = document.getElementById(“surface”);

3. Extract the sprite’s x and y parameters.

The horizontal position is stored in the left property. CSS styles are stored as strings and include a measurement. For example, the original left value of the sprite is 100px. For the program, you need only the numeric part. The parseInt() function pulls out only the numeric part of the left property and turns it into an integer, which is then stored in x. Do the same thing to get the y value.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.