jQuery CSS 主题滚轮
我想从 jQuery Themeroller 中获取一个图标并将其实现为按钮。然后,当我单击该图标时,它会在一种颜色和另一种颜色之间切换。这是在 Ruby on Rails 中。我该怎么做?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是前端代码,所以它几乎都是 JS/jQuery,你想要完成的事情与 Rails 无关。
这些图标是单独的类,例如 .jquery-ui-wrench。
一种方法是:
然后在某个地方:
包括,根据评论
从网站下载自定义主题 + jQuery UI 后,将 .js 文件提取到您的
public/ javascripts
,然后将 css 样式表放入public/stylesheets
,将图像放入public/images
。编辑 css 文件并将所有出现的images
替换为/images
。 (这是为了确保它正确指向图像文件夹)然后只需将样式表和 javascript 文件包含在您的布局中,您应该就可以开始使用它了。
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 ofimages
with/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.