Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Changing a Div's Style- margin-left in IE5.5
- From: javascript@xxxxxxxxxx (none)
- Subject: [Javascript] Changing a Div's Style- margin-left in IE5.5
- Date: Mon, 29 Jul 2002 09:16:07 -0500
What I want to do is move the div element which has the image of a red ball in it. I am trying to do so by changing the style's margin-left value to 100 points. I am using IE5.5. Simply stated, I do not know how to write the function moveBall. Will someone please write in the correct process for this funciton and give a few comments to explain what they did. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><title>Move a Ball Once in IE</title> <script type="text/javascript1.2"> <!-- function moveBall( ) { document.all['red'].style.margin-left="100pt"; } //--> </script> </head> <body> <div id="red" style="height:40px; width:40px; margin-left:10pt; margin-top:40pt"> <img src="Ball- red.jpg" height="40" width="40" id="redball" name="redball"> </div> <form> <input type="button" value="Move Ball" name="move" id="move" title="Move" onclick="moveBall( )"> </form> </body> </html>
- Follow-Ups:
- [Javascript] Changing a Div's Style- margin-left in IE5.5
- From: Peter Brunone
- [Javascript] Changing a Div's Style- margin-left in IE5.5
- Prev by Date: [Javascript] (no subject)
- Next by Date: [Javascript] Show and Hide Script
- Previous by thread: [Javascript] (no subject)
- Next by thread: [Javascript] Changing a Div's Style- margin-left in IE5.5
- Index(es):