jQuery Mobile:显式覆盖所有角的圆角
jQuery Mobile 通过添加类 ui-corner-all
自动圆化输入元素的所有角。我注意到,如果我在 Chrome 检查器中手动将此类更改为 ui-corner-left
,那么我会正确地在左侧(顶部和底部)仅获得圆角。当然,这可以通过一行 jQuery 轻松完成,例如
$('#myid').removeClass('ui-corner-all').addClass('ui-corner-left');
我的问题是,有没有一种方法可以指示 jQuery Mobile 立即应用此类,而无需在 JQM 完成工作后执行这段额外的代码?
jQuery Mobile automatically rounds all corners of input elements, by adding a class ui-corner-all
. I noticed that if I change this class manually to ui-corner-left
in Chrome inspector, then I correctly get only rounded corners on the left (top and bottom). This could of course easily be done with one line of jQuery, such as
$('#myid').removeClass('ui-corner-all').addClass('ui-corner-left');
My question is, is there a way I can instruct jQuery Mobile to apply this class straight away, without having to execute this extra bit of code after JQM has done it's work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
基本上可以应用以下内容,但您关心的是在没有额外代码执行的情况下运行,让我们看看我们是否有机会得到它,即使我正在寻找同样的问题,但以下是我的解决方案。
Basically following can be apply, but your concern is to run without extra code execution, lets see wheter we get chance to get it, even I'm looking same question, but following is my solution.
您可以通过在 index.html 文件中指定所需的 jquery mobile 类来覆盖默认值。一个很好的例子是,而不是:
它会自动插入这个
,然后添加你自己的类:
在firefox中,ui-corner-all类不会自动为我添加,也许你正在使用旧版本的jquery mobile并且需要升级。
如果您想在 javascript 文件中动态执行此操作:
});
就像重新重写 div 的内容一样,自动删除旧内容。如果您要在列表中显示大量信息,您可能需要使用
,然后在页面完全显示后隐藏该消息。
You can override the default value by specifying in your index.html file the jquery mobile class you want. A good example would be, instead of:
which would automatically insert this
you would then add your own class:
In firefox, the ui-corner-all class does not get automatically added for me, maybe you are using an older version of jquery mobile and need to upgrade.
If you want to do it dynamically in a javascript file:
});
as in re-write the contents of the div all over again, automatically erasing the old contents. If you will display a lot of information in your list you might want to use the
and then hide the message when your page has been fully displayed.
嘿,你可以这样做
hey Simply you can do like this