javascript jQuery 移动:ui-helper-hidden-accessible
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14300161/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
jQuery mobile : ui-helper-hidden-accessible
提问by bguiz
In my html code:
在我的 html 代码中:
<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
在DOM中,经过jQUEry mobile处理后,插入了如下元素
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
In between my search input
and my hidden input
.
在我的搜索input
和我的隐藏之间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.
发生这种情况时,我注意到这个跨度(类为“ ui-helper-hidden-accessible
”)的内容更新为隐藏输入的值。
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
调查,我发现: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?
有没有办法禁止 jQuery 在我的表单中创建这个元素?
回答by ThdK
Hide the class on focus:
隐藏焦点类:
$( ".selector" ).autocomplete({
focus: function (event, ui) {
$(".ui-helper-hidden-accessible").hide();
event.preventDefault();
}
});
回答by Manish Kundu
You can try this.
你可以试试这个。
.ui-helper-hidden-accessible { display:none; }
回答by sgeddes
Not sure if you can disable what jQuery Mobile is doing, but if I'm understanding your needs, have you tried something like just hiding the element?
不确定您是否可以禁用 jQuery Mobile 正在执行的操作,但如果我了解您的需求,您是否尝试过仅隐藏元素之类的操作?
$(".ui-helper-hidden-accessible").hide();
Hope this helps.
希望这可以帮助。
回答by Amira.B
Try this :
试试这个 :
$(".ui-helper-hidden-accessible").remove();