Easy loading of flash objects

I am using the lazy-load jQuery plugin to delay loading bottom-images on a large web page. This works great. Now I would like to apply the same technique to a large Flash object, which is also below. I don't think the lazy-loading plugin manages things that are not images (at least until it looks like this). I may have to do it myself. In this case, how to determine when the area containing the Flash object becomes visible?

Edit: I think I can hack something using the jQuery dimensions plugin and tracking divcontaining the Flash object.

Edit2: Okay, I opened up generosity on this. If someone can get to him before I have the opportunity to play with this on the weekend, +250 to you. :)

+3
source share
5 answers

If the memory serves me correctly, setting this parameter wmodeof the flash object in the DOM to not opaquedo this. There's a bit about the various settings wmode here.

+2
source

hm, , jquery prugin, , , , - , Flash-, onload , onload , -, ( , jquery-plungin , onload ).

EDIT: , onload img- , (?) ( ) - , , ...

0

, - ---- - , . in-view "" ( / div), , Flash.

0

, lazyLoad script, , lazyLoad "src", Flash ().

lazyLoad src , "src". , "".

():

/* Save original only if it is not defined in HTML. */
if (undefined == $(self).attr("original")) {
   $(self).attr("original", $(self).attr("src") || $(self).attr("data") || $(self).find("embed").attr("src") );
}

, , , .

0

, , . :

  • , , , .
  • , , , - ""

So, for lazy loading, I just reused or destroyed functions that determine whether this element is present in the view or not. Connect to the scroll event, and if something should appear, you embed SWF with swfobject. That should do it.

Also look at the lazy source download plugin , it's really not complicated.

0
source

Source: https://habr.com/ru/post/1740616/


All Articles