jQuery手机:ui-helper-hidden-accessible [英] jQuery mobile : ui-helper-hidden-accessible

查看:404
本文介绍了jQuery手机:ui-helper-hidden-accessible的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的html代码中:

 < div data-role =fieldcontainid =containsdivclass =no-field-separator> 
< label for =field1class =ui-hidden-accessible>至< / label>
< input type =searchname =field1id =field1autocorrect =offautocapitalize =offautocomplete =offplaceholder =Field#1? value =/>
< input type =hiddenid =field1valname =field1val/>
< / div>

在DOM中,由jQUery mobile处理后,插入了follwing元素。 b
$ b

 < span role =statusaria-live =politeclass =ui-helper-hidden-可访问的>< /跨度> 

在我的搜索 input 和我隐藏的 input



当用户键入我的搜索输入时,我会做一些操作,并更新隐藏字段。



在这种情况下,我注意到这个跨度(类为 ui-helper-hidden-accessible $ b

我不确定发生了什么,或者是由什么触发的。

>

调查发现:
http://forum.jquery.com/topic/ui-helper-hidden-accessible-change



这个目的字段实际上是隐藏但仍然可以访问,但是,这似乎并非如此 - 它在浏览器中呈现为可见。



一种禁止jQuery在我的表单中创建此元素的方法?

  $(.selector =h2_lin>解决方案

).autocomplete({
focus:function(event,ui){
$(。ui-helper-hidden-accessible)。hide();
event.preventDefault();
}
});


In my html code:

<div data-role="fieldcontain" id="containdiv" class="no-field-separator">
    <label for="field1" class="ui-hidden-accessible">To</label>
    <input type="search" name="field1" id="field1" autocorrect="off" autocapitalize="off" autocomplete="off" placeholder="Field #1?" value="" />
    <input type="hidden" id="field1val" name="field1val"/>
</div>

In the DOM, after being processed by jQUery mobile, has inserted the follwing element

<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>

In between my search input and my hidden input.

As the user types in my search input, I do some stuff, and update the value of the hidden field with it.

As this happens, I notice that this span (with class "ui-helper-hidden-accessible") has its content updated with the value of the hidden input.

I am not sure what is happening, or what this is triggered by.

Investigating, I have found that: http://forum.jquery.com/topic/ui-helper-hidden-accessible-change

The purpose of this field is actually for it to be "hidden but still accessible", however, this does not appear to be the case - it renders as visible within the browser.

Is there a way to disable jQuery from creating this element within my form?

解决方案

Hide the class on focus:

$( ".selector" ).autocomplete({
focus: function (event, ui) {
                $(".ui-helper-hidden-accessible").hide();
                event.preventDefault();
            }
});

这篇关于jQuery手机:ui-helper-hidden-accessible的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆