admin管理员组文章数量:1356246
I need to wait for a certain object to load while it is hidden. But what appears to be happening, is that it only loads without the display:none
;
I'm using jQuery, and I tried putting the .load
on the object to call a function when it loads, but seems that it will not load, because it's hidden.
Is there a way of 'forcing' the load of the Object, or, another way to 'hide' but still loading?
How to do it correcly:
use visibility: hidden
instead of display: none
as explained here: .html#VisibilityProperty
When the ‘display’ property is set to none, then the given element does not bee part of the rendering tree. With ‘visibility’ set to hidden, however, processing occurs as if the element were part of the rendering tree
I need to wait for a certain object to load while it is hidden. But what appears to be happening, is that it only loads without the display:none
;
I'm using jQuery, and I tried putting the .load
on the object to call a function when it loads, but seems that it will not load, because it's hidden.
Is there a way of 'forcing' the load of the Object, or, another way to 'hide' but still loading?
How to do it correcly:
use visibility: hidden
instead of display: none
as explained here: http://www.w3/TR/SVG/painting.html#VisibilityProperty
Share Improve this question edited Aug 5, 2012 at 4:52 Ivan Seidel asked Aug 5, 2012 at 4:23 Ivan SeidelIvan Seidel 2,3726 gold badges34 silver badges49 bronze badges 1When the ‘display’ property is set to none, then the given element does not bee part of the rendering tree. With ‘visibility’ set to hidden, however, processing occurs as if the element were part of the rendering tree
- 1 Good question. Now I'm curious as to the answer as well. – SomeKittens Commented Aug 5, 2012 at 4:25
3 Answers
Reset to default 3Load it off screen, style="position:absolute;left:100000px"
How to doit correcly:
use visibility: hidden
instead of display: none
as explained here: http://www.w3/TR/SVG/painting.html#VisibilityProperty
When the ‘display’ property is set to none, then the given element does not bee part of the rendering tree. With ‘visibility’ set to hidden, however, processing occurs as if the element were part of the rendering tree
thanks to @SomeKittens
It seems that an SVG will not be rendered if the element is set to display:none
. It's possible to load every element individually with JS as shown in this answer.
本文标签: javascriptHow to load HTML ltobjectgt SVG even when hiddenStack Overflow
版权声明:本文标题:javascript - How to load HTML <object> SVG even when hidden - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744028971a2578559.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论