我正在从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
发布评论