admin管理员组文章数量:1308536
For example in this case
I just don't want the class ui-shadow
in the element and without overriding the css.
I tried data-shadow="false"
but it doesn't hide the shadow. is there any other attribute to do this?
For example in this case
I just don't want the class ui-shadow
in the element and without overriding the css.
I tried data-shadow="false"
but it doesn't hide the shadow. is there any other attribute to do this?
- 2 Ugly solution would be .removeClass("ui-shadow"). – Naning Commented Nov 3, 2011 at 9:33
2 Answers
Reset to default 8I'm not sure you can remove just one class the jQM adds without the use of jQuery or rolling your own theme.
For native elements you have the option to set the attribute like this:
data-role="none"
Docs:
- http://jquerymobile./demos/1.0rc2/docs/forms/forms-all-native.html
You could roll your own theme with the new jQM Theme Roller:
- http://jquerymobile./themeroller/
Or (Not sure if this is the best solution as it will probably break something) remove the CSS for ui-shadow
but I wouldn't opt for this.
Last use jQuery and remove the class
$('$element_id').removeClass('ui-shadow');
// this might need a refresh as well
$('#page_id').trigger('create');
Since I see it's a list you could refresh like this as well
$('ul').listview('refresh');
You must apply the data-shadow="false"
to the modal container (the element which has the data-role="popup"
attribute).
Example:
<a href="#modal-foo" data-rel="popup">Trigger</a>
<div id="modal-foo" data-role="popup" data-shadow="false">
Crazy modal stuff!
</div>
本文标签: javascriptIn jquery mobile how to prevent to add some specific classes to elementsStack Overflow
版权声明:本文标题:javascript - In jquery mobile how to prevent to add some specific classes to elements? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741833600a2400082.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论