有没有办法将我的 UI 主题滚轮主题应用到我的 jquery 移动网站?
我已经使用修改后的 jQuery UI 主题滚筒主题构建了一个标准站点。我正在尝试将相同的主题应用到我的 jQuery 移动网站。看来许多 css 类不匹配。
.ui-btn <-- in mobile
.ui-button <-- in theme roller
有没有一个工具可以帮助将这两者匹配起来?
I have already built a standard site using a modified jQuery UI theme roller theme. I am trying to apply the same theme to my jQuery mobile site. It seems many of the css classes don't match up.
.ui-btn <-- in mobile
.ui-button <-- in theme roller
Is there a tool that helps match the two of these up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更新:在这里:
我知道 jQM 正在开发主题滚轮还有:
相关:
UPDATE: It's here:
I know that jQM is working on a Theme Roller as well:
Related:
你可以破解一个解决方案;当两个 CSS 类具有相同的目的但名称不同时,您可以转到 ThemeRoller CSS 并搜索“ui-button”的实例并修改它,以便(例如)一行显示:
变成
但该死的,这是一个丑陋的黑客,不是真正的解决方案。如果规则更复杂,您就不能只进行搜索和替换。整个事情维护起来也会很烦人。修改任一 JavaScript 的基础也是如此;你可以将所有添加“ui-btn”的 DOM 操作更改为添加“ui-button”,但这是维护的噩梦。
jQuery UI Mobile ThemeRoller 即将发布。您可以等待并制作一个模仿旧主题的新主题。我觉得这是一条必经之路。否则,如果不能等待,我个人现在只会将所有样式从 ThemeRoller 迁移到 Mobile 样式表。这是体力劳动,但更适合未来。
You could hack a solution into place; when two CSS classes have the same purpose but different names, you could go to the ThemeRoller CSS and search for instances of "ui-button" and modify it so that (for example) a line says:
becomes
But damn that's an ugly hack, not a real solution. And if the rules are more complex, you can't just do a search-and-replace. The whole thing would be annoying to maintain, too. Ditto for modifying the base of either JavaScript; you could change all the DOM manipulations that add "ui-btn" to add "ui-button" instead, but it's a maintenance nightmare.
There's a jQuery UI Mobile ThemeRoller that's to be released soon. You could just wait for that and make a new theme that mimics your old one. Strikes me as the way to go. Otherwise, if it can't wait I would personally just migrate any styles from ThemeRoller to the Mobile stylesheet for now. It's manual labor, but is a teeny bit more future-proof.
您已经正确地发现两个框架中的类名不相同。您可以编写一些 JavaScript 来搜索特定的 jQuery Mobile 类并添加与该元素对应的 jQuery UI 类。
例子:
You have correctly discovered that the class names are not the same in the two frameworks. You could write some JavaScript that searches for specific jQuery Mobile classes and adds the jQuery UI classes that correspond to that element.
Example: