-
19 Jul 2012 1:18 AM #1
Answered: Changing an image on button click
Answered: Changing an image on button click
Hi,
How to change an image on button click i am using this code for a button
The image on button is displayed properly but when i press the button i want to change the image of the button which is not happening even though i use pressedCls can anyone give an idea about that.Code:xtype:"button", html: '<img src="resources/images/fb_icon.png" />', pressedCls:'btnAction', pressedDelay: 100, width:35, height:35, // height:290, // iconAlign:top, //iconMask:true, //iconCls:'fb_icon', itemId:'btnFacebook', handler:this.onfacebookButtonTap, scope:this
Thanks
Ram
-
Best Answer Posted by bluemvj
Thanks man got it working using this below code
Code:.backCls{ background: url('../images/back.png') !important; background-repeat: no-repeat; background-size: 65px 65px; height: 65px; width: 65px; } .backCls.x-button-pressing{ background: url('../images/back_active.png') !important; background-repeat: no-repeat; background-size: 65px 65px; height: 65px; width: 65px; }
-
19 Jul 2012 1:43 AM #2Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
HI!
you may try to use !important in your css class.
sample:-
if above doesn't work, paste your btnAction CSS Class here.Code:.sampleClass{ background: XXXXXX !important; }sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
19 Jul 2012 2:04 AM #3
Thanks man got it working using this below code
Code:.backCls{ background: url('../images/back.png') !important; background-repeat: no-repeat; background-size: 65px 65px; height: 65px; width: 65px; } .backCls.x-button-pressing{ background: url('../images/back_active.png') !important; background-repeat: no-repeat; background-size: 65px 65px; height: 65px; width: 65px; }


Reply With Quote