2012-04-28 17 views
0

jQuery mobileを使ってサイトを作っていて、何らかの理由で同じ行にテキストボックスとボタンを置くことができません。 グリッドを使用してJquery mobile styling issue

<div data-role="footer" data-position="fixed"> 
      <input type="text" placeholder="Your Message" id="usermsg" /><input type="button" value="Send!" id="submitmsg" /> 
</div> 
+0

ボタンのスペースを確保するためにテキストボックスのサイズを変更しようとしましたが、それが機能しませんでした。 –

+0

Nevermind。私はそれを考え出した。 –

答えて

0

これを行うには正しい方法です。

<label for="points">Textbox and a Button on the same line.</label> 
    <div data-role="footer" data-position="fixed"> 
    <div class="ui-grid-a"> 
     <div class="ui-block-a"> 
      <input type="text" data-inline="true" placeholder="Your Message" id="usermsg" /> 
     </div> 
    <div class="ui-block-b"> 
      <input type="button" value="Send!" id="submitmsg" data-inline="true"/> 
    </div> 
    </div> 

グリッドサイズを変更したい場合は、単にそれにCSSを追加します。例えば。 class="ui-block-a myField" また、AJAXナビゲーションのために、JQuery MobileでIDを使用することを避けることをお勧めしました。代わりにクラスを使用することをお勧めします。