JQuery Mobile - Position a input button next to an input text area

前端 未结 4 1656
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-12 07:58

I am trying to get a inputtext area and a submit button attached just to the right of it. Ideally, the two together will use 100% of the width and

4条回答
  •  再見小時候
    2021-01-12 08:27

    I found a new answer for those of you that are looking at this thread.

    I find it much better in terms of integration with jQuery Mobile. However, it could be vulnerable to upgrades in jQuery Mobile since it relies on how the icon image file is organized.

    I simply added this CSS rule :

    .ui-icon-searchfield:after {background-position: -252px !important;}
    

    And the icon magically turns into a data-icon="check". Exactly what I was looking for! You can pick whatever icon you want by changing the offset and looking into images/icons-18-white.png for the icon mapping.

    Of course you will want to refine the selector so you only target the input boxes you want to change.

    Enjoy the hack.

提交回复
热议问题