User Tools

Site Tools


dashboards

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
dashboards [2023/06/05 08:40] – [JavaScript for dashboard] emozolyakdashboards [2023/06/05 08:43] (current) – [JavaScript for dashboard] emozolyak
Line 514: Line 514:
 <code javascript> <code javascript>
 // Image rotation example  // Image rotation example 
-IMAGE_ID = 2 +var IMAGE_ID = 2;
 var currentAngle = 0; var currentAngle = 0;
- +  
-function setAngle(){ +function setAngle() { 
-setObjProperty(IMAGE_ID, {angle:currentAngle});  +    setObjProperty(IMAGE_ID, {angle:currentAngle});  
-currentAngle = currentAngle + 10; +    currentAngle = currentAngle + 10; 
-if (currentAngle >= 360) { +    if (currentAngle >= 360) { 
-currentAngle = 0}+ currentAngle = 0
 +    }
 } }
 +
 setInterval(setAngle, 40); // will be called every 40 ms  setInterval(setAngle, 40); // will be called every 40 ms 
 +
 </code> </code>
  
dashboards.txt · Last modified: 2023/06/05 08:43 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki