I have the following html:
code
<div data-role="navbar">
<ul>
<li><a href="#" id="cb" class="UnPressedButton" name="a" onclick="clickme()">Categories</a>
<li><a href="#" id="ah" class="PressedButton">All Hacks</a></li>
<li><a href="#" id="mh" class="UnPressedButton">My Hacks</a></li>
</ul>
<>
<!-- /navbar -->
/code
CSS:
pre
.PressedButton{
height:25px;
font-size: 1em !important;
font-family: Helvetica, Arial, sans-serif !important/{global-font-family}/;
background: #eeeeee !important;
border-bottom-color: green !important;
color: #c32c2c !important;
text-shadow: 0
0px
0
#000000
!important;
box-shadow: 0px -6px 0px 0px green inset !important;
}
.UnPressedButton {
height:25px;
font-size: 1em !important;
font-family: Helvetica, Arial, sans-serif !important/{global-font-family}/;
background: #eeeeee !important;
color: #c32c2c !important;
text-shadow: 0
0px
0
#000000
!important;
}
/pre
When I click "bc" button, it runs the following:
pre
function clickme() {
$("#cb").addClass('PressedButton');
$("#ah").addClass('UnPressedButton');
Apperyio( "panel_72" ).panel( "open" );
}
/pre
So I expect to change the appearance of the button "bc" to be same like "ah" button, and "ah" to be like "bc" before click. However, when I click, nothing happens. After I click somewhere else, 'PressedButton' applies to "bc", but 'UnPressedButton' does not apply to "ah". Why is that?
Thanks,