I am coding a quiz module, which contains a radio button set, using jQuery UI. How do I change the color or the image of the button?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ideally, you will want to use Themeroller if you can get away with it. However, if you want something completely custom, for example with custom imaged backgrounds and custom icons, while still retaining the functionality of the jQuery UI button, you still can. It will just take more work in overriding the default jQuery UI CSS styles and creating some new ones.
For example:
The button on the right is a jQuery UI button styled with Themeroller, while the button on the left is still a jQuery UI button but with a custom icon and background. Here is what you need to do to accomplish a custom button:
Start with backgrounds and your icon images:
Here is the css you will need to create:
Then in your javascript when you create your button:
With this, your #button will look like the custom styled button the left. Of course you will have to adapt this code to fit your resources by specifying the correct images and dimensions.