I have the code below set to the icon image for a navigation button. How do I change this code when the button becomes active to insert another icon image? I am using jquery mobile. thanks
.nav-glyphish-example .ui-btn .ui-btn-inner {
padding-top: 40px !important;
}
.nav-glyphish-example .ui-btn .ui-icon {
width: 30px!important;
height: 30px!important;
margin-left: -15px !important;
box-shadow: none!important;
-moz-box-shadow: none!important;
-webkit-box-shadow: none!important;
-webkit-border-radius: 0 !important; border-radius: 0 !important;
}
#home .ui-icon {
background: url(glyphish/icons/icons-gray/983-calendarblue@2x.png) 50% 50% no-repeat;
background-size: 24px 22px;
}
You can change the css dynamically by javascript.
The code below adds a function to
mousedownevent of the elements matching the selector#home .ui-icon. and so you can change the backbround image on mousedown event.jquery
replace the
newurlwith your own url ( like glyphish/icons/icons-gray/983-calendarblue@2x.png ).