Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is my script disrupting the onmouseover effect?

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
0
0
US
I have a table like so

Code:
<tr class="datarow1" onmouseover="this.className='datarowhover';" onmouseout="this.className='datarow1';" id="row2">
<td onclick="xajax_pos('EDITIH','2');">2</td>
<td onclick="xajax_pos('EDITIH','2');"></td>
<td onclick="xajax_pos('EDITIH','2');"></td>
<td onclick="xajax_pos('EDITIH','2');"></td>
<td onclick="xajax_pos('EDITIH','2');"></td>
<td style="text-align: center"><img src="images/trash.gif" alt="DEL" title="REMOVE THIS VENDOR!" onclick="remVendor('row2','1');" /></td>
</tr>

The onclick triggers
Code:
function remVendor(rowid,count) {
document.getElementById(rowid).style.background='#FF0000';
action=confirm('You have chosen to remove this vendor!\n\nPlease click OK to remove - CANCEL if otherwise.\n\n');
if(count == 1) { document.getElementById(rowid).style.background='#FFFF66'; }
else { document.getElementById(rowid).style.background='#FFF'; }
}

For now, as you may notice, I am doing nothing more than resetting the background color of the row after the confirm action. My problem is that the hover effect is lost as if the row's onmouseover effect is no longer there.

What am I doing wrong? I feel that this is a very simple mistake but I have been looking at it for too long to see it.

Thank you all in advance for your assistance!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
What styles do the 'datarowhover' and 'datarow1' classes apply? If they apply backgorund colours, these will be trumped by the style being set (inline style rules have a higher specificity).

Dan


Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top