|
-
Jan 9th, 2004, 07:32 AM
#1
Thread Starter
Addicted Member
Dynamic Table and event handlers
Hi,
I am building a dynamic table using javascript and vbscript in a web page. The code goes something like this:
Code:
for x = 1 to 3
Set row = MyTable.insertrow()
for y = 1 to 3
set cell = row.insertcell()
cell.style.cursor = "hand"
cell.onmouseover = "javascript:this.style.backgroundColor='red';"
cell.onmouseout = "javascript:this.style.backgroundColor='White';"
next y
next x
What I want to happen is when you move over each of the cells in a table grid, the current one that the mouse is over changes color. But this code does not work?! Does anybody know why?
Thanks,
DJ
-
Jan 10th, 2004, 05:33 AM
#2
There should be on javascript: in the event handler. In addition, Mozilla doesn't support this sort of assignment. You need to use addEventHandler for Mozilla and assign to onmouseover for IE, and you'd best use a function object.
Ok, just noticed this is vbscript so obviously you don't care at all about Mozilla. So no help from me there.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|