[英]Shadowbox.js hides my select inputs
I'm sure I can't be the first person to have this problem, but I haven't had any luck finding the solution. 我敢肯定我不是第一个遇到这个问题的人,但是我没有运气找到解决方案。
I'm using Shadowbox in its simplest form; 我以最简单的形式使用Shadowbox ; just doing an image popup with a link like
只是做一个带有类似链接的图像弹出
Click <a href="myimage.png" rel="shadowbox">here</a> to view the image.
This works fine, but has one very odd side effect: When I click the link, all of the select inputs (ie drop-down boxes) of the form on my page disappear. 这很好用,但有一个非常奇怪的副作用:当我单击链接时,页面上表单的所有选择输入(即下拉框)都消失了。 A little snooping with Firebug reveals that the CSS is being modified to give the
<select>
tags the property visibility: hidden
. 通过对Firebug的一番窥探,我们发现CSS已被修改以使
<select>
标签具有visibility: hidden
。 When the image is dismissed, the inputs reappear. 取消图像后,将重新显示输入。
Not surprisingly, this happens consistently across browsers. 毫不奇怪,这在所有浏览器中都会一致发生。
Since the inputs all reappear, I could probably just leave things as they are. 由于所有输入都重新出现,我可能可以将它们保持原样。 However, if (for example) the image can't be loaded, and the script can't display it, the inputs stay invisible.
但是,例如,如果无法加载图像且脚本无法显示图像,则输入保持不可见。 Also, it looks strange and it's driving me batty.
另外,它看起来很奇怪,并且让我发疯。 :D
:d
Other factors that may or may not be relevant: 其他可能或可能不相关的因素:
class
attributes. class
属性。 They do have id
attributes that are generated by CakePHP, but these names are very specific to my application and very unlikely to cause any CSS collisions. id
属性,但是这些名称非常特定于我的应用程序,因此不太可能导致任何CSS冲突。 This is a semi-bug in shadowbox, most likely. 这很可能是shadowbox中的一个半bug。 The select tags are being hidden because in some versions of IE, they are rendered using windows native controls, and thus always appear "above" any other element with a z-index.
选择标记被隐藏,因为在某些版本的IE中,它们是使用Windows本机控件呈现的,因此始终显示在具有z-index的任何其他元素“上方”。 This obviously is a problem for ShadowBox, so the solution is to hide them while showing the box.
对于ShadowBox来说,这显然是一个问题,因此解决方案是在显示框时将其隐藏。 Shadowbox should clearly do this only for troublesome browsers, but I think they're taking a more generic approach of always hiding them.
Shadowbox显然应该只对有问题的浏览器执行此操作,但我认为它们正在采用一种更通用的方法来始终隐藏它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.