I want to take an icon from the jQuery Themeroller and implement it as a button. Then, when I click the icon, it toggles between one color and another color. This is in Ruby on Rails. How should I do this?
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.
This is front-end code, so it’s pretty much all JS/jQuery, what you’re trying to accomplish has nothing to do with Rails.
The icons are separate classes, for example .jquery-ui-wrench.
One way to do it is:
And then somewhere:
Including, as per comment
Once you’ve downloaded your custom theme + jQuery UI from the site, extract the .js files into your
public/javascripts, then the css stylesheet intopublic/stylesheets, and the images intopublic/images. Edit the css file and replace all occurances ofimageswith/images. (This is to ensure it points to the images folder correctly)Then simply include the stylesheet and javascript file in your layout, and you should be able to start using it.