:: Home >>

Mouseover effects

Mouseover effects require special handling to be fast enough. There are two global functions available just for this purpose (see /lib/system/html.js):

function mouseover(element, name){...}
function mouseout(element, name){...}

The first one adds a CSS class selector 'name' to the HTML element, the second removes it.

To create mouseover effect you have to define a CSS class:

<style>
    .active-row-highlight {background-color: yellow}
    .active-row-highlight .active-row-cell {background-color: yellow}
</style>

and add the following script

var row = new Active.Templates.Row;
row.setEvent("onmouseover", "mouseover(this, 'active-row-highlight')");
row.setEvent("onmouseout", "mouseout(this, 'active-row-highlight')");
obj.setTemplate("row", row);

This is slightly different from normal syntax - where you supply a function as an event handler. Here instead of a function you provide a string which is simply assigned to HTML element "onmouseover" property and is evaluated on mouseover event.

See also

Mouseover effects for a single cell

Comments

7 Jun 07
bugs using the above code Siddharth (2)
8 Dec 06
use mouseover Marc Bezeredi (1)
10 Oct 05
Mouseover highlighting first column Brian. (4)
11 Sep 05
rowIndex with onmouseover Rafael Vieira (1)
8 Aug 05
Firefox problem with onmouseover effects Ricardo Guerra (2)
1 Jul 05
Mouseover effects AND images Brian Jahng (1)
16 Jun 05
row color on click Rich (3)
12 Jun 05
Mouseclick (3)
11 May 05
Mouse over Row Highlight bug or requested fix Paul (4)
26 Apr 05
Mouseover and empty cells Luca (1)
18 Apr 05
alternate row color w/onmouseover,onmouseout (4)
14 Apr 05
Onmouse Effect in VBscript and recordset WzBn (2)
12 Apr 05
Grid ROW-color rollover vs. selected Ernst (2)
4 Apr 05
onmouseover and selection and images (0)
10 Mar 05
Using Active.Templates.Image with onmouseover (1)
9 Mar 05
known error? heeko (0)
28 Feb 05
How do I add mouse over affect in php? And how do I add a link to the rows? Gershon NY (0)
29 Oct 04
Frozen column and mouseover/out Henry Ng (1)
9 Aug 04
Possible future bug sufcrusher (3)
8 Jul 04
Strange behavior when some cell is empty? Sudhaker Raj (8)

Comments will appear on this page and in the main forum.

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5