Posted: 02/07/2006, 6:53 AM |
|
Based on: http://forums.yessoftware.com/posts.php?post_id=68752
Louis and Benjamin (Me too )
the function:
function VISION_TO_ALTERNATE ()
{
// www.vision.to
global $Tpl;
$highlight = "";
global $isAltRow;
$RowClass = "Row";
if($isAltRow)
{
$RowClass = "AltRow";
}
$isAltRow = (!$isAltRow);
$Tpl->SetVar("RowClass",$RowClass);
if(defined("USE_GRID_MOUSEOVER") && USE_GRID_MOUSEOVER==1)
{
if($RowClass == "Row")
{
$highlight = "onmouseover='this.className=\"RowHL\"' onmouseout='this.className=\"Row\"'";
}
else
{
$highlight = "onmouseover='this.className=\"RowHL\"' onmouseout='this.className=\"AltRow\"'";
}
}
$Tpl->SetVar("highlight",$highlight);
}
How to use it ? [Before show Row event]
//Custom Code @208-2A29BDB7
// -------------------------
// Write your own code here.
VISION_TO_ALTERNATE ();
// -------------------------
//End Custom Code
HTML editing:
<!-- BEGIN Row -->
<tr class="Row {RowClass}" {highlight}>
<td><a href="{role_Src}">{role}</a> </td>
<td style="TEXT-ALIGN: center">{active} </td>
<td style="TEXT-ALIGN: right">{display_order} </td>
</tr>
<!-- END Row -->
Note there are two classes (or more allowed by css).
<tr class="Row {RowClass}" {highlight}>
but can be used as:
<tr class="{RowClass}" {highlight}>
Note: there is THIRD style added for onmouse over
.RowHL td {
padding: 2px;
border-top: 1px solid #7c7c7c; border-right: 1px solid #7c7c7c;
vertical-align: top;
background-color: #FFFFC5;
color: #0000ff;
}
.RowHL a:link {
color: #000000;
}
.RowHL a:visited {
color: #000000;
}
.RowHL a:hover, .RowH a:active {
color: #000000;
}
enjoy
_________________
Regards
feha
www.vision.to
feedpixel.com |