Author Topic: restore the row_bg_number/-color by using a onmouseover-effect  (Read 4614 times)

0 Members and 1 Guest are viewing this topic.

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
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
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: restore the row_bg_number/-color by using a onmouseover-effect
« Reply #1 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 ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mawenzi

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: restore the row_bg_number/-color by using a onmouseover-effect
« Reply #2 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
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...