我如何停止jQuery手机应用样式到我的特定表单元素 [英] How can i stop jQuery mobile to apply styles to my specific form elements

查看:92
本文介绍了我如何停止jQuery手机应用样式到我的特定表单元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以指示jQuery Mobile不对我的输入框进行设置和提交按钮。我对我的自定义CSS很好。 jQuery移动脚本正在对我的所有元素应用自己的样式。



一个解决方法,我试图覆盖我的自定义css中的那些元素。有没有其他功能,我可以做到这一点?

  $。ignoreStyles(button,text); jQuery Mobile会忽略

的元素。


解决方案

> data-role 属性设置为 none 。因此,您只需将这些属性添加到您的标记中:

 < input type =textname =foodata -role =none/> 
< button type =buttonid =bardata-role =none> Button< / button>


Is it possible to instruct jQuery Mobile to not style my Input box and submit button. I am good with my custom CSS. jQuery mobile script is applying its own style to all my elements.

the one workaround i tried is overriding those elements in my custom css. Is there any other functions available where i can do this ? some thing like this

$.ignoreStyles("button,text");

解决方案

jQuery Mobile will ignore elements whose data-role attributes are set to none. Therefore, you can simply add these attributes to your markup:

<input type="text" name="foo" data-role="none" />
<button type="button" id="bar" data-role="none">Button</button>

这篇关于我如何停止jQuery手机应用样式到我的特定表单元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆