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?

Share Improve this question edited Nov 3, 2011 at 9:31 Reporter 3,9485 gold badges35 silver badges49 bronze badges asked Nov 3, 2011 at 9:26 Jitendra VyasJitendra Vyas 153k240 gold badges586 silver badges867 bronze badges 1
  • 2 Ugly solution would be .removeClass("ui-shadow"). – Naning Commented Nov 3, 2011 at 9:33
Add a ment  | 

2 Answers 2

Reset to default 8

I'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