Jon and Ben should both be hung, drawn & quartered for providing the code they did. It is BAD and WRONG. :@
Also, since the JS is 90% the same for all four clocks, you can encapsulate it in a function.
Here is better code:
code: <script type="text/javascript" src="http://www.worldtimeserver.com/clocks/embed.js"></script>
<script type="text/javascript">
function renderClock(color,location)
{
showClock
({ wtsclock: 'wtsclock001.swf'
, color: color
, wtsid: location
, width: 100
, height: 100
, wmode: 'transparent'
});
}
</script>
<style type="text/css">
.clock {float: left; clear: none; margin: 0 1em;}
.break {float: none; clear: both;}
</style>
<div class="clock"><script type="text/javascript">renderClock('FF9900','GB');</script> <h2>London</h2> </div>
<div class="clock"><script type="text/javascript">renderClock('FF0000','US-MA');</script> <h2>Boston</h2> </div>
<div class="clock"><script type="text/javascript">renderClock('228B22','US-FL');</script> <h2>St Pete</h2> </div>
<div class="clock"><script type="text/javascript">renderClock('0000FF','AU-VIC');</script> <h2>Melbourne</h2></div>
<br class="break"/>
Ideally, the first block (style and script stuff) should go inside your <head>..</head> tags, but it'll work outside it too.
(The code could/should be encapsulated even further, but it's good enough for now; the main thing is to get away from the incorrect use of tables.)
|