JavaScript - A Graphic Odometer
I have the following code which works fine until I try and display graphics.
Please tell me how I could/should display the odometer in graphics format rather than text. I have all the necessary images as .png(0 through 9) in the same folder as the following code. It is just that the text counter displays but not the graphics? Code: <html> <head> <script type="text/javascript"> var c=0; var t; var timer_is_on=0; function GraphicOdo(Nommer) { d = Nommer.toString(); for (i=0; i<d.length; i++) { var image="<IMG SRC=c"+d[i]+".gif>"; // alert(image); document.getElementById('GraphicCounter').innerHtml=image; } } function timedCount() { document.getElementById('txt').value=c; c=c+1; GraphicOdo(c); t=setTimeout("timedCount()",1000); } function doTimer() { if (!timer_is_on) { timer_is_on=1; timedCount(); } } </script> </head> <body> <form> <input type="button" value="Start count!" onclick="doTimer()"> <input type="text" id="txt" /><br /><br /> <div id="GraphicCounter"> <img src="c0.gif" alt="zero"/> </div> </form> </body> </html> Similar TutorialsHey, I want to create a nice Info Graphic for Web, something like this one: Is possible to do it with JS and style with CSS? Is there any library to generate this graphics and allow to style it with CSS? I've looked at google charts api but I think that I'm not able to style it as I want. Let me know if is there any other solution to create this (without flash). Thanks hello... I'm sorry, i did read the advises, and i've been through the forum, trying to figure out where to look... but i dont know where to find it... so, i'm sorry if my help request will sound silly,,, i'm only looking for someone that will want to point me in the right direction... and i'll try to do my best on my own ... we want to offer personalized tshirts... so we do need a way for the customer to choose size, color, subject and text and check all this in real time... someone that is doing something that we want is http://www.vistaprint.com/embroidere...aspx?xnav=top# in your opininion, is that vistaprint application a java? pls, could you point me in the right direction to understand that? thanks to anyone that will want to help me some simple stuff ive been stuck on. been trying to get these to come up one after another: set the colour to white draw a filled circle set the colour to blue draw an outline circle i dont know how to make the loop continue and at each loop carry out on of these instructions? any help appreciated!! var canvas; canvas = openGraphics(); var x; var y; var size; x = 10; y = 10; size = 200; while( size > 0 ) { canvas.drawEllipse( x, y, size, size ); x = x + 10; y = y + 10; size = size - 20; } canvas.paint(); I have some code that uses a form, and will check it and show an image. If you have/know a script that is simple, let me know! Otherwise, I'm wondering if someone who is proficient in JS/HTML could help me with this task. It's all coded, I just need some help with an error I am getting. Thanks, Blockis Hi, Is it possible to rotate a dial to follow the mouse cursor? I'm trying to recreate this: http://verbdesign.com/hl/rockwell/index.html but would rather it worked like this: http://www.actionscript.org/resource...-II/Page1.html ...but in javascript. Any help extremely welcome. Thanks, Richard |