Hover to work with itemText (aka: Label)

Hello all! I’m evaluating smartclient ajax system for use within our organization and need some help on an app I’m working on.

I’m trying to get a label to perform a mouseOver event and change the background color but it doesn’t seem to be working. Here is the code + css I code below. Any help would be much appreciated.

–js code begin-----------------

isc.Label.create({
click:"
if (!window.HTMLPane2) {
var message = "Component ID \"HTMLPane2\", target of action \"Set URL\" does not exist";
isc.Log.logWarn(message);
if (isc.designTime) {
isc.say(message);
}
}
HTMLPane2.setContentsURL("http://192.0.0.16/ReportServer?%2FActivity+Sales%2FRolling12MonthCustType&rs:Command=Render\");
",
showContextMenu:null,
mouseUp:null,
title:“LinkByCustomerType”,
autoDraw:false,
contents:“Sales By Customer Type”,
styleName:“textItem”,
canHover:true,
hoverStyle:“textItem2”,
ID:“LinkByCustomerType”,
height:20
})

-----js code end------------------------

-----css-begin-------------------------
FYI: This change was made to the skins_styles.css file.

.textItem,
.textItemFocused,
.textItemDisabled,
.textItemError {
font-family:Verdana,Bitstream Vera Sans,sans-serif; font-size:11px; background-color:#ffffff;
padding:2px; border:1px solid #808080;
}

.textItem2 {
font-family:Verdana,Bitstream Vera Sans,sans-serif; font-size:11px; background-color:#ffff00;
padding:2px; border:1px solid #808080;

-----css-end-------------------------

As you can see all I want to do is change the background color of the label on a mouse over event. I’m using the label tool to create my nav menus under a section bar.

Thanks!

Hi Irving,

You should probably start with a Button rather than a Label. For both Buttons and Labels, style changes during rollover, mouseDown and other interactions is accomplished by adding suffixes to the baseStyle.

“hoverStyle” is completely different, and is for showing what is elsewhere called “tooltips”.

By default a Label does not react to rollover, because it sets showRollOver:false - this is one of a few reasons why you are probably better off starting with Button.