jquery - How to set<Input> submit button to size of text -


i'm using jquery mobile , have form submit button. unfortunately, after doing research learned jquery mobile's data-inline attribute doesn't work input elements. want submit button size of text. firefox must take care of this, because button size want be. however, ie sets width of button size of container. way style submit button size of text , no larger? tried doing:

$('#element').css('display','inline') 

that didn't work, though.

thanks help!

here demo of <input type="button" /> element correctly goes "inline" when add data-inline="true" attribute (this tested in ie8/ie9): http://jsfiddle.net/evtef/

to fix in ie7 need add "inline hack":

.ui-btn-inline {     *display : inline !important;     zoom     : 1; } 

the property prefixed asterisk (*) not read ie8/ie9 or other modern browsers read ie7. zoom : 1 has added element gets haslayout css (which cannot manually added element).

here demo of above fix: http://jsfiddle.net/evtef/1/

bonus round

you can fix issue in ie6 need specify height element. specify height ie6 , no other browsers can similar asterisk hack ie7:

.ui-btn-inline {     *display : inline !important;     zoom     : 1;     _height  : 30px; } 

even ie7 disregard underscore (_) prefixed property ie6 use property declaration.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -