Here is the link:

Long story short, I need an swf file to display full screen underneath an html nav bar.

But...

The link above works fine except that since the nav bar is above the swf displaying the swf at 100% causes the controls for the swf to be below the browsers boundary causing a user to scroll down to use the controls, which is unacceptable.

I have tried displaying the swf at lesser percentages than 100% but that does not please my client either.

So i need the nav bar to be on top of the swf, have the swf fill the whole screen, (expect the part being occupied by the nav bar), and not have to scroll down to use the swf controls.

Any help would be much appreciated!

Dani AI

Generated

A practical, modern way to solve this is to treat the nav as a fixed-height top bar and make the SWF container fill the remaining viewport. That combines the useful parts of answers here: ’s idea to use the window height, ’s iframe suggestion (same layout rules apply), and ’s z-index layering — but do it with a robust layout so the Flash controls never drop below the browser viewport. Also set the SWF wmode to opaque/transparent so HTML can sit above the plugin.

Example (CSS + JS fallback):

html, body { height:100%; margin:0; }
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px; /* replace with your nav height */
  z-index: 9999;
}
#flash-wrap {
  position: fixed;
  top: 60px; /* same as nav height */
  right: 0;
  bottom: 0;
  left: 0;
}
#flash-wrap object, #flash-wrap embed { width:100%; height:100%; }
function resizeFlash(){
  var navH = document.querySelector('nav').offsetHeight || 0;
  document.getElementById('flash-wrap').style.height = (window.innerHeight - navH) + 'px';
}
window.addEventListener('resize', resizeFlash);
resizeFlash();

Notes and gotchas: percent heights tied to body can be flaky (as pointed out); prefer 100vh/calc(100vh - Xpx) or the resize JS fallback for broad compatibility. Make sure to remove default body margins and to set the SWF wmode param so the nav actually appears above Flash. Finally, Flash is end-of-life in modern browsers — consider replacing the SWF with HTML5 alternatives or an emulator like Ruffle (see Adobe’s Flash EOL and MDN docs on calc()/viewport units for details).

Recommended Answers

All 5 Replies

You could use a script to get the the users window height then make an iframe or div that will take up a certain percentage of that size dynamically. or maybe load the page already scrolled down to the bottom (although it would hide the menu then).

Use IFrame.

<!--snipped for brevity -->
</head>
<body>
<div id="nav" style='top:0; position:absolute; z-index:100;'>
<ul>
<li><a href="">Home</a> | </li>
<li><a href="">Home</a> | </li>
<li><a href="">Home</a> | </li>
<li><a href="">Home</a> | </li>
<li><a href="">Home</a> | </li>
<li><a href="">Home</a> | </li>
<li><a href="">Home</a></li>
</ul>
</div>
<object style='top:0; z-index:0; position:absolute;' 
<!--snipped for brevity -->

both the menu.div and the flash.object start at window top
the menu is 100 layers on top of the flash, 1 or 10 would do equally well

The problem is that you are trying to do what is impossible, for all practical purposes.

The Internet is NOT designed to make something fit the browser window. It is a waste of time trying to do so.

100% height refers to the container, but browsers do not agree on what the container height is if the body tag is the container. Most browsers use the height of the content, not the height of the browser display pane.

Remember that the browser display pane has no set size. The following affect it:

- Screen resolution
- Monitor Aspect ratio (4x3, or 16x9)
- Which browser the user has
- Is the window restored down?
- Which toolbars the user has displayed
- Toolbar add-ons the user has installed

Have you tried just putting the swf in another div?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.