Flash animation in Javascript : Animation « GUI Components « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Event
7. Event onMethod
8. Form Control
9. GUI Components
10. HTML
11. Javascript Collections
12. Javascript Objects
13. Language Basics
14. Node Operation
15. Object Oriented
16. Page Components
17. Security
18. Style Layout
19. Table
20. Utilities
21. Window Browser
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript DHTML » GUI Components » Animation 
Flash animation in Javascript

 <!-- ***********************************************************
Example 5-10
"Dynamic HTML:The Definitive Reference"
2nd Edition
by Danny Goodman
Published by O'Reilly & Associates  ISBN 0-596-00316-1
http://www.oreilly.com
Copyright 2002 Danny Goodman.  All Rights Reserved.
************************************************************ -->
<html>    
<head>
<title>Changing className Properties</title>
<style type="text/css">
    .red    {
              color: red;
              border: 2px solid red;
            }

    .green  {
              color: green;
              border: 2px solid yellow;
            }

    .yellow {
              color: yellow;
              border: 2px solid blue;
            }

    .blue   {
              color: blue;
              border: 2px solid green;
             }
</style>
<script language="JavaScript" type="text/javascript">
// Set global variables
var totalCycles = 0;
var currColor = 0;
var classes, intervalID;
// Build array of rule selector names
function init() {
    classes = ["red""green""yellow""blue"];
}
// Advance the color by one
function cycleColors() {
    // reset counter to 0 if it reaches 3; otherwise increment by 1
    currColor = (currColor == 3: ++currColor;
    // set style color to new color from array
    document.getElementById("hot1").className = classes[currColor];
    // invoke this function again until total = 27 so it ends on red
    if (totalCycles++ < 27) {
        intervalID = setTimeout("cycleColors()"100);
    else {
        clearTimeout(intervalID);
    }
}
</script>
</head>
<body onload="init(); cycleColors();">
<h1>Welcome to the <span class="red" id="hot1">Hot Zone</span> Web Site</h1>
<hr>
</body>
</html>


           
       
Related examples in the same category
1. Attack animation
2. Circle Animation
3. Right to left animation
4. Flash animation in JavaScript: Changing style Properties
5. Animation along Straight Line
6. Animation along a Circle
7. Dancing Text (IE)
8. Type Writer effect (IE)
9. Type Writer Effect 1.1 (IE)
10. JavaScript Ticker 1.2 (IE)
11. Animation: Lottery Number Picker and Statistics
12. Animation: wriggly
13. Animation: welcome message
14. Animation: trio
15. Auto lotto dip
16. Animation: snow
17. Animation: star
18. Animation: mouse doodle
19. Animation: fireworks
20. Animation: pretty
21. Animation: Random Movement
22. Lotto number draw
23. Following eyes
24. Animation: three eyes
25. Animation: eyes
26. Spot light
27. Big static eyes
28. Animation based on DIV with color flash
29. Framework for creating CSS-based animations
30. Animate dynamic element h1 tag
31. Popup window animation (fly across screen)
32. Animation on several images
33. Using the onFilterChange Event Handler
34. JavaScript Animation
35. Periodically Updating the Text Displayed by an HTML Element
36. Moving an Airplane Across a Web Page
37. Link Hint Scroller 2.0 (IE)
38. Snow animation
w__w_w.j___av___a___2s.___co___m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.