是否可以在没有完整框架的情况下拥有 JQuery Mobile 选择菜单?
我正在尝试使用 JQuery Mobile 选择菜单,而不必使用完整的框架并遇到问题。
我宁愿不使用完整的 jquery 移动库,因为它会调整我的整个页面和所有控件、其上的链接并将样式应用于页面标记。这会导致整个页面的外观和感觉进行调整。我正在使用自适应网页设计来调整页面控件,并且当最大宽度达到 680 时,我已经能够成功应用文本框的 JQuery Mobile 外观和感觉,这看起来很棒,但在应用相同样式时我的选择框看起来很糟糕。具体来说,由于圆边,下拉箭头在右侧被截断。如果可能的话,我希望具有与应用于选择菜单的文本框相同的外观,并控制 CSS 文件中的所有内容,但如果有一个用于选择菜单的精简 .js 库,那也将是一个可行的选择。
是否有人成功地仅使用 CSS 将 JQuery Mobile 外观应用于选择框?有没有人使用过狭窄的 JQuery Mobile 库,它允许您仅选择菜单,而不需要整个 JQuery Mobile .js 库或样式表?
任何帮助将不胜感激!提前致谢。
我确实设法获得了一些 CSS,看起来它可能是我需要的内容的开始,但下拉菜单是不可见的,尽管它是可单击的,并且在您选择它时会显示选项。我认为这可能与 JQM 运行以应用选择下拉样式的 javascript 相关。下面是 CSS,也许我遗漏了一些东西。
box-sizing: border-box;-webkit-box-align: center;border: 1px solid;
border-image: initial;white-space: pre;-webkit-rtl-ordering: logical;
color: black;background-color: white;cursor: pointer;
-webkit-appearance: button;left: 0;top: 0;
width: 100%;min-height: 1.5em;min-height: 100%;height: 3em;
max-height: 100%;opacity: 0;-ms-filter: "alpha(opacity=0)";filter: alpha(opacity=0);
z-index: 2;cursor:pointer;-webkit-appearance:button;left:0;top:0;width:100%;min-height:1.5em;min-height:100%;height:3em;max-height:100%;opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);z-index:2
I am attempting to use a JQuery Mobile select menu without having to use the full framework and running into problems.
I would prefer to not use the full jquery mobile library because it adjusts my entire page and all controls, links on it and applies style's to the page tag. This causes the look and feel to be adjusted for the whole page. I am using adaptive web design to adjust the pages controls and have been able to successfully apply the JQuery Mobile look and feel for the text boxes when the max-width hits 680, this looks great but my select boxes look bad when applying those same styles. Specifically the drop down arrow is chopped off on the right because of the rounded edges. If possible I would love to have the same look as the text boxes applied to the select menu's and control everything in the CSS file but if there is a trimmed down .js library for select menu's that would be a viable option too.
Has anyone successfully applied the JQuery Mobile look and feel for select boxes with just CSS? Has anyone used a narrow JQuery Mobile library that allows you to target just select menu's and doesn't require the entire JQuery Mobile .js library or style sheets?
Any help will be greatly appreciated! Thanks in advance.
I did manage to get some CSS that looks like it might be the start of what I need but the drop down is invisible, though it is clickable and shows the options when you select it. I think this might be tied to the javascript that JQM is running to apply the select drop down style. Below is the CSS though, maybe I'm just missing something.
box-sizing: border-box;-webkit-box-align: center;border: 1px solid;
border-image: initial;white-space: pre;-webkit-rtl-ordering: logical;
color: black;background-color: white;cursor: pointer;
-webkit-appearance: button;left: 0;top: 0;
width: 100%;min-height: 1.5em;min-height: 100%;height: 3em;
max-height: 100%;opacity: 0;-ms-filter: "alpha(opacity=0)";filter: alpha(opacity=0);
z-index: 2;cursor:pointer;-webkit-appearance:button;left:0;top:0;width:100%;min-height:1.5em;min-height:100%;height:3em;max-height:100%;opacity:0;-ms-filter:"alpha(opacity=0)";filter:alpha(opacity=0);z-index:2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道在 RC1 的发行说明中,他们已经解耦了 jQM 并正在开发下载生成器
不确定这是否已经发布
I know in the Release Notes for RC1 they had decoupled jQM and were working on a Download Builder
Not sure if this is release as of yet
我设法仅使用 CSS 就可以实现此功能(如下)。该功能已在 IE9、Chrome、FF 和 Safari 上运行并经过测试。我想我应该在这里发布回复,以防其他人遇到这个问题。当我使用自适应网页设计并在浏览器达到某个阈值时调整我的文本字段(和选择)时,这对我来说效果很好,以便在平板电脑或手机上查看时具有更移动的外观和感觉。
I managed to get this working using just CSS (below). This is working and tested on IE9, Chrome, FF and Safari. I thought I would post the response here in case there is anyone else that is up against this issue. This worked well for me when using adaptive web design and adjusting my text fields (and selects) when the browser hit a certain threshold so that it had a more mobile look and feel when viewed on a tablet or phone.
您能否复制 JQM 发挥其魔力后添加的 CSS 和 HTML?如果将这些属性复制到页面中,那么您将获得所需的显示,而框架不会覆盖您的页面。
Could you just copy the CSS and HTML that it added after JQM does its magic? If you copy those properties into your page then you would have the display you want without the framework overtaking your page.