JQM (jQueryMobile) Mobile Tooltip under input element CSS positioning

China☆狼群 提交于 2019-12-23 05:40:57

问题


SO I have a tooltip which is a hidden div that toggles below the input elements. On focus I display the tooltip and hide on blur.

The problem is when in landscape or displaying on a tablet device the tooltip is left under the label element which looks out of place.

But is portrait the label is on top of the input element and the tooltip is below. This functions and looks as expected (like I want).

Live Example: http://jsfiddle.net/jtnmC/3/

Question:

So in landscape how do I align the tooltip so it lines up/displays under the input element and not its label? And also not mess up the portrait positioning?

<div>
    <label for="telephone">
        Phone Number*
    </label>
    <input type="text" name="telephone" id="telephone" required placeholder="Telephone#">
    <div name="telephone_tooltip" class="tooltip">
        Valid format
        <strong>
        <span>999-999-9999</span>
        </strong>. Please include the area code.
    </div>
</div>

回答1:


Fixed this by adding a margin:

Live Example: http://jsfiddle.net/jtnmC/12/



来源:https://stackoverflow.com/questions/5755952/jqm-jquerymobile-mobile-tooltip-under-input-element-css-positioning

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!