开发者

Flash in hidden div, load only when div is shown

开发者 https://www.devze.com 2023-03-15 16:34 出处:网络
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 javasc

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

精彩评论

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