Hi,
there are different ways of doing this.
I think this is the most clear one for you now.
<layer ... onover="set(css, data:css_txt_hover);" onout="set(css, data:css_txt);" />
So you make another <data thing that contains the looks you like when hovering and call it onover.
Something like this could also work,
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<font
base="font-family:Helvetica;text-align:center;"
size="16"
size_hover="20"
color="000000"
color_hover="ff0000"
/>
<layer name="txt" keep="true" type="text" align="center" html="hover me" css="calc:font.base + 'font-size:' + font.size + 'px;color:#' + font.color +';'" vcenter="true" padding="10 20" onover="DressTxt(over);" onout="DressTxt(out);" />
<action name="DressTxt">
if(%1 == over,
set(layer[get(name)].css,calc:font.base + 'font-size:' + font.size_hover + 'px;color:#' + font.color_hover +';');
,
set(layer[get(name)].css, calc:font.base + 'font-size:' + font.size + 'px;color:#' + font.color +';');
);
</action>
|
There are more ways to Rome though, i would say it all depends on your structure and wishes.
Hope it helps,
Tuur