views:

113

answers:

2
+1  Q: 

iFrame Question

I have a website that has a huge background image. I need to put a flash player at the top of the website, and I just realized that each page they click on is a new page, and thus restarts the Flash player. So I would like to put that flash player in an iframe so it will continue to play throughout the user surfing.

But my issue is will the iframe cover the background image and not be underneath? Or will the background image of the page (not iframe) go nicely underneath the iframe and no one will be the wiser of my methods? Any help would be greatly appreciated.

+2  A: 

Firstly what you want to do is put your individual pages contents into an iframe (not the flash video) as this is what you want to update. You want the flash to be on the actual parent page so it always remains the same. (or put both in seperate iframes and only update the content iframe).

In regards to your question about the iframes background you can make it transparent so that the background is still visible through it.

To do this set the ALLOWTRANSPARENCY property to true on your iframe e.g.

<iframe width="100%" height="500px" name="content" src="home.html" frameborder=0 allowtransparency="true"></iframe>

And then in the pages which are going to be contained in the iframe set the body's background to be transparent:

<body style="background-color:transparent">
HenryRat
Right... putting the flash in an iframe (as the iframe element would exist on the page itself) would continue the problem.
Mark Hurd
Sorry, but this is an incredibly filthy solution. This is web development thinking in 1996-style. Loads of messy code on the front end, practically impossible to maintain the layout and design (especially if its used with a CMS or blog engine), and ridiciolus restrictions on what's actually achievable of a visual design.
Arve Systad
rats. my idea didn't work. each time the user clicks on a new page the iframe refreshes, and as a result removes my entire iframe theory :(
HollerTrain
I'm not arguing that it is the best solution, there are much better solutions just as you suggested below, although these have drawbacks themselves. Iframes aren't like ie6, they don't break everything, they may limit expansion etc but it depends on what is wanted from the client/user and what level of freedom is required from the website. Iframes may be old, but they can still do the job.
HenryRat
A: 

Iframes are bad, and take with them all the shitty stuff about frames (google "why frames are bad" if you want some reading).

What you should be looking at is some AJAX-techniques. JavaScript frameworks like Dojo and jQuery have lots of functionality you could check out. This will enable users to do things like vote, add to favourites or comment while the movie is playing - pretty much like Youtube.

It all depends a little on what you've got running underneath your HTML-pages though. Could you provide some more information about that?

Arve Systad
I am running a Wordpress website, with a ton of tweaks. Huge rotating backgrounds, custom AJAX scroller for WP posts, and the flash player. You can view it here (www.mibsolutionsllc.com/proc_dev) if my explanation leaves you wanting more. I am seeking an alternative to the iframe now, a way where my flash will continue without restarting each page :(
HollerTrain