:: Forum >>

Trouble with setClass and onmouseout

I have a object that I created and I want it to have a 'fly-over' behavior. So I set up an onmouseover event to change the class to one that provides a border. And I set up an event in onmouseout to change the class back to one that does not provide a border, which is also the default class for this object. Here are the two lines of code to handle the changes:

obj.setEvent('onmouseover', function(){ obj.setClass("swep", "buttonHover");obj.refresh()});
obj.setEvent('onmouseout', function(){ obj.setClass("swep", "button");obj.refresh()});


The onmouseover works fine and the object gets the border, but the onmouseout change doesn't work. I know it's getting called because I placed a windows.status="TEST" at the end of the function and that got hit and worked but the setClass did not take effect. What could be the problem? I tried putting this code in the creation of the new object and also as code after the object was created and both rendered the same results. Here are the CSS classes I am using, nothing special:

.aw-swep-button {
background-color : #B9CDE1;
text-align : center;
vertical-align : middle;
border : 0;
}

.aw-swep-buttonHover {
background-color : #B9CDE1;
text-align : center;
vertical-align : middle;
border-width : 2;
border-style : outset;
}


Thanks!
Jim Hunter
Wednesday, November 9, 2005

This topic is archived.


Back to support forum

Forum search