某些三星设备上没有触发事件

时间:2014-08-05 08:25:21

标签: jquery html css3 samsung-mobile

我正面临三星设备上文本字段的jQuery问题。其中一个问题是我在文本字段中不断输入文本有时jQuery不能在Galaxy Tab和Galaxy S3等三星设备中工作。

<div class="holder">Email Address </div>
<input type="text" class="form-control" id="email" name="email" maxlength="45" value="" >
.holder {
    position: absolute;
    padding:4% ; 
    color: #7f8184;
    font-size:1.813em;
    font-style:italic;
    cursor: -webkit-zoom-in;
    cursor:-webkit-zoom-out;
    cursor:-webkit-zoom-grab;
    cursor:-webkit-zoom-grabbing ;
} 
$("form input").each(function() {
    if ($(this).val()) {
        $(this).prev('.holder').hide();
    } else {
        $(this).prev('.holder').show();
    }
    $(this).on('input', function() {
        if ($(this).val() || $(this).text().length > 0) {
            $(this).prev('.holder').hide();
        } else {
            $(this).prev('.holder').show();
        }
    });
    $(".holder").click(function() {
        $(this).next().focus();
    });
});

Fiddle

我注意到的主要问题是在运行javascript时,会发生奇怪的事情。例如,在表单提交上,我想要占位符。通常,一个简单的jquery完成了这项工作并在桌面浏览器上运行良好,包括移动Chrome浏览器,但不在股票浏览器(三星默认浏览器)中。输入一些字符后,浏览器就会停止所有javascript处理。 任何人都面临这个问题...

1 个答案:

答案 0 :(得分:0)

我更新到http://code.jquery.com/jquery-1.11.1.min.js后 我的问题解决了