views:

22

answers:

1

I am using jQuery button in my project, I need to display primary button in orange color and secondary button in grey color; but for me both buttons are in the same color grey. I am using following code:

$(function() {

        $( "button, input:submit").button({ icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'} });

    });
+1  A: 

the "primary" and "secondary" arguments are for putting multiple icons on the same button.

To style different buttons differently, you'll need to call button() separately on them. Something like:

$('#main_button').button({icons: {primary:'ui-icon-gear'} });
$('#other_button').button({icons: {primary:'other-icon'} });

Edit: I don't see how you'd set the background color with the button() call. Maybe try something like this:

#other_button { background-color: orange;}
#other_button:hover { background-color: darker-orange;}
JasonWoof
its changing my button icons but i need to change my button background color
Elankeeran
my primary need to change to orange color and secondary button background color need to change to grey color
Elankeeran
wouldn't you do that with css?
JasonWoof
I've edited my answer to include some css pseudo-code
JasonWoof
it will change the font color not background color.
Elankeeran
@alan ,do you want to differentiate between mouseover and mouseout.
gov