我的页面中有这段代码:
<form class="store_product_form" name="" method="post" action="http://www.mydomain.etc...">
<div style="margin:0;padding:0;display:inline">
<input type="hidden" value="135" name="entry_id">
<input type="hidden" value="collezione/unica/C13/portapenne" name="return_url">
<input type="hidden" value="1" name="site_id">
<inpu type="hidden" value="4194b647df2a6b56a8086303d43eac678c8d49cb" name="XID">
</div>
other stuff here...
</form>
输入通过 css 隐藏:
input[type="hidden"] {
-moz-appearance: none;
-moz-binding: none;
-moz-user-focus: ignore;
border: 0 none;
cursor: auto;
display: none !important;
padding: 0;
}
仅在 IE8 上显示包含 div,尽管它的内容不显示。但它最终会在页面中占据一席之地,这并不好。
不幸的是,我无法修改代码,因为它是在页面呈现时由 CMS 注入的。
我在网上冲浪并阅读了有关 IE8 :hidden 和 :visible bug 的信息:http: //forum.jquery.com/topic/hidden-visible-broken-in-ie8
于是我尝试通过js修改代码,注入一些代码使容器div隐藏,但是IE8似乎没有响应:
$(".store_product_form div input:hidden").parent().attr("style", "margin:0;padding:0;display:none;");
关于如何解决这个问题的任何想法?
谢谢!卡罗