4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: mawenzi on August 03, 2005, 04:11:37 PM

Title: restore the row_bg_number/-color by using a onmouseover-effect
Post by: mawenzi on August 03, 2005, 04:11:37 PM
hi all,

I want to restore the $row_bg_number after using a onmouseover-effect for a row of a list.
I already tried some out, but however I got no result.

at present I use the following, but of course it do not restore the bgcolor:
Code: [Select]
...
$count = 0;
$bgcounter = 0;
while ($row = $site_db->fetch_array($res)){
   if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $list .= "<tr class=\"listrow".$row_bg_number."\" onmouseover=\"this.style.backgroundColor='#ffcccc'\" onmouseout=\"this.style.backgroundColor='#ffffff'\">\n";
    }
...

Which code can I use for onmouseout to restore the bgcolor of the row ( class=\"listrow".$row_bg_number."\" ) ?
Code: [Select]
...
onmouseout=\"this.style. ?---???---? \">\n";
...

thanks in advance
mawenzi
Title: Re: restore the row_bg_number/-color by using a onmouseover-effect
Post by: V@no on August 04, 2005, 12:15:18 AM
wouldnt be easier just swap the class out? like this:
Code: [Select]
      $list .= "<tr class=\"listrow".$row_bg_number."\" onmouseover=\"this.className='listrow".$row_bg_number."a'\" onmouseout=\"this.className='listrow".$row_bg_number."'\">\n";and add a two new classes for "mouseover":
listrow1a and listrow2a
with this method u can add more then background color change ;)
Title: Re: restore the row_bg_number/-color by using a onmouseover-effect
Post by: mawenzi on August 04, 2005, 01:13:07 AM
hi V@no,

this / your method with two new classes for "onmouseover" works absolut perfectly ...  :D
thanks for your solution ( Большое спасибо ...  :wink: ) !

mawenzi