This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Using JS to show a progress bar based on time elapsed between two points</title> | |
| <script type="text/javascript"> | |
| // This is only here for illustration purposes. See comments below for how to create new start/end points | |
| var randomStart = Math.random() * 24; | |
| var randomEnd = Math.random() * 24; | |
| function timeElapsed() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| +-------+----------+----------+----------+ | |
| | route | first | second | distance | | |
| +-------+----------+----------+----------+ | |
| | 1 | London | Madrid | 3 | | |
| | 2 | London | New York | 8 | | |
| | 3 | London | Chicago | 7 | | |
| | 4 | Madrid | New York | 9 | | |
| | 5 | Madrid | Chicago | 6 | | |
| | 6 | New York | Chicago | 5 | | |
| +-------+----------+----------+----------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sys import exit | |
| from collections import defaultdict | |
| from random import randint | |
| import time | |
| # Create a list with 9 spaces in it | |
| grid = [] | |
| for x in range(0, 9): | |
| grid.append(' ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="map" style="width: 550px; height: 450px"></div> | |
| <form action="#"> | |
| Eat: <input type="checkbox" id="eatbox" onclick="boxclick(this,'eat')" /> | |
| Stay: <input type="checkbox" id="staybox" onclick="boxclick(this,'stay')" /> | |
| Shop: <input type="checkbox" id="shopbox" onclick="boxclick(this,'shop')" /> | |
| Play: <input type="checkbox" id="playbox" onclick="boxclick(this,'play')" /> | |
| Community: <input type="checkbox" id="communitybox" onclick="boxclick(this,'community')" /><br /> | |
| </form> |
NewerOlder