Placeholder attribute on text input with iOS 6 from landscape to portrait

依然范特西╮ 提交于 2019-12-04 05:46:17

I found this problem. and fix it.

(URL : http://mooki83.tistory.com/2656550 (in korean))

testURL : http://mooki83.da.to/m/testios6.html

javascript :

/* Optimized PLACEHOLDER for iOS6 - Mooki ( http://mooki83.tistory.com ) */


$(document).ready(function(){
    $(window).bind("orientationchange.fm_optimizeInput", fm_optimizeInput);
});

function fm_optimizeInput(){
    $("input[placeholder],textarea[placeholder]").each(function(){
        var tmpText = $(this).attr("placeholder");
        if ( tmpText != "" ) {
            $(this).attr("placeholder", "").attr("placeholder", tmpText);
        }
    })
}

Applying "overflow: hidden;" on the containing element solved this issue for me.

PoseLab

CSS fix:

body>div {
    overflow-y: auto;
}

Non js answer

Add overflow:hidden to parent element and it will work like a charm

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