4images Forum & Community
4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started 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:
...
$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."\" ) ?
...
onmouseout=\"this.style. ?---???---? \">\n";
...
thanks in advance
mawenzi
-
wouldnt be easier just swap the class out? like this:
$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 ;)
-
hi V@no,
this / your method with two new classes for "onmouseover" works absolut perfectly ... :D
thanks for your solution ( Большое спасибо ... :wink: ) !
mawenzi