Return to Snippet

Revision: 37724
at December 16, 2010 04:19 by chrisaiv


Initial Code
<script type="text/javascript">
//<![CDATA[

var size = getViewportSize();	 
function getViewportSize() 
{ 
	var size = [0, 0]; 
	if (typeof window.innerWidth != "undefined") { 
		size = [window.innerWidth, window.innerHeight];
	} 
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
		size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; 
	}
	else {
		size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; 
	}
	return size; 
}
function createFullBrowserFlash() 
{
	swfobject.createCSS("html", "height:100%;");
	swfobject.createCSS("body", "height:100%;");
	swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:980px; min-height:553px;");
}	
function setHeight( h )
{
	if ( h < size[1] ) h = "100%";
	var el = document.getElementById("container");
	if ( h != "100%" ) el.style.height = h < 553 ? "553px" : h + "px";
	else el.style.height = "100%";
}

var flashvars = { };
var params = { "allowscriptaccess": "samedomain" };

swfobject.embedSWF("main.swf", "content", "100%", "100%", "9.0.0", false, flashvars, params);
if (swfobject.hasFlashPlayerVersion("9.0.0")) {
	swfobject.addDomLoadEvent( createFullBrowserFlash );
}
//]]>
</script>

Initial URL
http://blog.wezside.co.za/2008/10/fullscreen-flas.html

Initial Description
If you are trying to solving one or both of these problems:
+ If the window is resized to a smaller size that was designed for - a scrollbar would be nice.
+ If the content is larger than the original design - a scrollbar would be nice

Then use this code!

Initial Title
SWFObject: Full sreen flash with browser scrollbar

Initial Tags
javascript

Initial Language
JavaScript