JQuery Mobile 1.4.5

编程入门 行业动态 更新时间:2024-10-23 20:31:36
JQuery Mobile 1.4.5 - ui-mini被主题css覆盖(JQuery Mobile 1.4.5 - ui-mini overridden by theme css)

我正在从JQM 1.2.1更新一个站点到1.4.5,并且我似乎无法获得按钮来将ui-mini类的样式以适当的顺序应用于依赖关系(据我所知)。

//default JQM CSS: <link href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> //custom theme from ThemeRoller: <link href="https://dev.domain.com/css/themes_145/theme_145.min.css" /> //JQuery and JQM JS: <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

保持事情的简单性,只需要准系统CDN文件和我上面的自定义主题,以及一个内部带有单个按钮的页面div:

<div data-role="page" data-theme="a"> <a class="ui-btn ui-mini ui-icon-arrow-r ui-corner-all ui-btn-inline ui-btn-icon-left">BUTTON</a> </div>

经过检查,我发现由ui-mini类提供的缩小的字体大小和填充正在被自定义主题css覆盖,这很奇怪,因为如果我在JQM css之前移动主题css,主题本身将被覆盖(正如我所预料的那样),但在其他任何情况下,ui-mini样式都不适用。 自定义主题新鲜从Themeroller下载。

我是否滥用定制主题? 这个设置在1.2.1中起到了很大的作用,我没有看到这个版本中特定部分的变化。

这是一个演示问题的小提琴。

我被困在这里。 任何人都可以看到我错在哪里?

I'm updating a site from JQM 1.2.1 to 1.4.5, and I can't seem to get buttons to apply the styles for the class ui-mini with the dependencies in the proper order (as far as I'm aware).

//default JQM CSS: <link href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> //custom theme from ThemeRoller: <link href="https://dev.domain.com/css/themes_145/theme_145.min.css" /> //JQuery and JQM JS: <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

Keeping things simple as can be, just the barebones CDN files and my custom theme above, and a page div with a single button inside:

<div data-role="page" data-theme="a"> <a class="ui-btn ui-mini ui-icon-arrow-r ui-corner-all ui-btn-inline ui-btn-icon-left">BUTTON</a> </div>

Upon inspection, I see that the reduced font sizes and padding afforded by the ui-mini class are being overridden by the custom theme css, which is weird since, if I move the theme css before the JQM css, the theme itself is overridden (as I would have expected), but in any other case the ui-mini styles are not applied. The custom theme is freshly downloaded from Themeroller.

Am I misusing the custom theme somehow? This setup worked like a charm in 1.2.1, and I'm not seeing how that particular part has changed in this version.

Here's a fiddle demonstrating the issue.

I'm stumped here. Anyone see where I've got it wrong?

最满意答案

好的,我的结构完全错误。 必须回到美乐器上的说明并单独加载结构和图标包。

<link rel="stylesheet" href="css/themes/my-custom-theme.css" /> <link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" /> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

Okay, I had the structure entirely wrong. Had to go back to the instructions on themeroller and load the structure and icon pack separately.

<link rel="stylesheet" href="css/themes/my-custom-theme.css" /> <link rel="stylesheet" href="css/themes/jquery.mobile.icons.min.css" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" /> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

更多推荐

ui-mini,JQM,主题,I'm,电脑培训,计算机培训,IT培训"/> <meta name="descr

本文发布于:2023-08-05 19:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1437788.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:JQuery   Mobile

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!