It's possible to dynamically create horizontal and vertical lines and rectangles using Internet Explorer 4.0 Dynamic HTML to alter the width and/or height of a single pixel image. Using this method and lots of code it could even be possible to create a rudimentary bar graph. The following code shows you how to alter the length of a line in response to the user clicking on a link.
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function setLine (linewidth) {
redline.width=linewidth;
}
</SCRIPT>
</HEAD>
<BODY>
Select width for line below: <A
HREF="javascript:setLine(50)">50 pixels</A> or
<A HREF="javascript:setLine(200)">
200 pixels</A><BR>
<IMG ID="redline" SRC="redpixel.gif" WIDTH="125"
HEIGHT="2">
</BODY>
</HTML>
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!
If you have a hot tip and we publish it, we'll pay you. However, due to accounting overhead we no longer pay $10 for a single tip submission. You must accumulate 10 acceptable tips to receive payment. Be sure to include a clear explanation of what the technique does and why it's useful. If it includes code, limit it to 20 lines if possible. Submit your tip here.