开发者

Flash in hidden div, load only when div is shown

I have a flash file that is in a div that is hidden when the page is loaded with the css property display:none. The div with the flash content is then 开发者_C百科shown at a later stage through javascript.

When will the flash file load? Ideally, I only want it to load when the div is shown.


What i would do is load the flash file only if the div is visible, what you can also do is create a <noscript> tag around the flash file so when javascript is disabled it will still display.

if($(div).is(":visible")){

    $(this).load("flash.swf");

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜