Embedding Flash without messing up the HTML fall back

By Erland

Sometimes we need to insert a 100% Flash into a page. This little snippet shows you how you can achieve it without breaking the normal browser behavior (scrollbars etc) for users viewing the retro HTML fall back.

Prerequisites: jQuery and swfobject 2.

$(document).ready(function(){
    $("html, body, div#page").css({
        height: "100%",
        overflow: "hidden"
    });
    var flashvars = {};
    var params = {};
    var attributes = {};
    swfobject.embedSWF(
        "Scaffold.swf",
        "page",
        "100%",
        "100%",
        "9.0.28",
        "expressInstall.swf",
        flashvars,
        params,
        attributes
    );
});

Comments are closed.