selected Button not changing style

Hi,

I got a button with my own baseStyle and I want it to change the color when I hover it and when I click on it.

The hover is working perfectly but when I click the button nothing happens,
I figured out in the docs that SC would add the suffix “selected” to the Style, but as is I said it doesn’t happen.

here is my code:

<HTML><HEAD> 
<SCRIPT>var isomorphicDir="isomorphic/";</SCRIPT> 
<SCRIPT SRC=isomorphic/system/modules/ISC_Core.js></SCRIPT>
<SCRIPT SRC=isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
<SCRIPT SRC=isomorphic/system/modules/ISC_Containers.js></SCRIPT>
<SCRIPT SRC=isomorphic/system/modules/ISC_Grids.js></SCRIPT>
<SCRIPT SRC=isomorphic/system/modules/ISC_Forms.js></SCRIPT>
<SCRIPT SRC=isomorphic/system/modules/ISC_DataBinding.js></SCRIPT> 
<SCRIPT SRC=isomorphic/skins/BlackOps/load_skin.js></SCRIPT> 
<STYLE>
.menuTop{
color:white;
background-color:black;
}
.menuTopOver, .menuTopSelected, .menuTopSelectedOver, .menuTopDown
{
color:white;
background-color:blue;
}

</style>
</HEAD>

<body><script type="text/javascript">
isc.Button.create({
height:30,
baseStyle:"menuTop",
showFocusedAsOver:true,
showFocused:true,
canFocus:true,
showRollOver:true,
title:"test"})
</SCRIPT>
</body>

I hope you can tell my how I could achieve this

Chris

The default button in BlackOps has a CSS background image set which provides the gradient. Set background-image:none; in your CSS if you want to get rid of it.

Hi Isomorphic,
thanks for your very fast reply

Sorry, but this doesn’t work either, I’m not using an IButton which would use the BlackOps, I’m using a normal button with my own css, so I’m not seeing any of the BlackOps gradient.
I just see a black button with white text and when i hover it it turns into a blue button, this works perfect, but what I want now is that it stays blue when I have clicked it.
I thought with the click I would select the button so the menuTopSelected css style would be applied but it doesn’t.

What I’m trying to get is a similiar behaviour like the “stretch button” in this example just with a normal Button instead of an IButton

Chris

That’s not the Selected state you’re seeing, that’s the Focused state. A button enters Focused state when it has keyboard focus (eg at that moment hitting “Enter” will trigger it) and showFocused is true.

Selected state is distinct and means the button is the currently selected member of a radioGroup (or setSelected() has been manually called). A Selected button is not necessary Focused and vice versa.

You just need to rename your styles to use “Focused” where you currently have “Selected”.