在 <applet>
中用 width=0
标记和 height=0
小程序代码加载失败。我试图将 applet 放在一个隐藏的 div 中,但它还是无法加载 applet。现在我有一个解决方法,通过设置 width=1
来让它工作。和 height=1
.
有什么方法可以隐藏小程序并让它继续工作吗?
最佳答案
Is there any way to hide the applet and still get it to work?
是的,它通常出现在样式中。我预计您当前使用了错误的 CSS 来隐藏它。
不正确
This value causes an element to not appear in the formatting structure (i.e., in visual media the element generates no boxes and has no effect on layout). Descendant elements do not generate any boxes either; the element and its content are removed from the formatting structure entirely. ..
正确
The generated box is invisible (fully transparent, nothing is drawn), but still affects layout. Furthermore, descendants of the element will be visible if they have 'visibility: visible'.
关于java - Mac Safari 不会运行大小为零的小程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11740238/