...

View Full Version : Can I size a div to make it bigger than its content?



Collywobbles
05-20-2007, 11:44 AM
Hi.

I have a page with a flash movie in it.

http://www.thunderin.co.uk/shaun/v3/

I have used this forum article to embed the movie.

http://blog.deconcept.com/swfobject/

And, hooray, it works fine. BUT! If a user has flash turned off or has refused to allow IE7 to run the movie, or a popup blocker or some other 'protection' has stopped it running then the div enclosing the flash movie collapses to the size of the warning text only. Understandable, but this changes the layout.

So either:

1. I need to be able to set the size of the div so that it shows a bordered box dimentioned to the size of the movie, with less text inside it than would normally make it the size I want... (comprende? :) )

2. I use another element to attach the flash movie to which I can resize as above. Which?

3. Something else.

I have asked in...

http://board.flashkit.com/board/forumdisplay.php?f=29

...but with little result. As initially it's a 'size the div' question I thought this might be a good forum.

Can anyone help me?

Many thanks.

Mike.

_Aerospace_Eng_
05-20-2007, 07:17 PM
Judging from your question I'm guessing you didn't design the site yourself because setting the size of the div using CSS works fine and if you had done the site yourself you would know how to do this. Add this to your stylesheet

#flashcontent1 {
width:200px;
height:275px;
}

Collywobbles
05-20-2007, 09:03 PM
Hi and thanks.


Judging from your question I'm guessing you didn't design the site yourself

Wrong guess. See sig, newbie learning it says. As a 'top coder' or whatever you seem to have forgotten what it's like not knowing it all.


because setting the size of the div using CSS works fine and if you had done the site yourself you would know how to do this. Add this to your stylesheet

#flashcontent1 {
width:200px;
height:275px;
}

I have tried that or similar in the past and all thats happened is the div has sized itself to the text inside it. Obviously, I did something wrong. I'll do it again.

Thanks anyway, it's nice to know how things should be.

Collywobbles
05-20-2007, 09:09 PM
Just been back to my stylesheet. I already have this in it...


#flashcontent1
{
float: right;
width: 200px;
height: 275px;
margin-left: 10px;
margin-bottom: 10px;
}

And it shrinks if the movie doesn't play. Whats the difference between that and...


width:200px;
height:275px;

Thanks.

koyama
05-20-2007, 09:25 PM
If a user has flash turned off or has refused to allow IE7 to run the movie, or a popup blocker or some other 'protection' has stopped it running then the div enclosing the flash movie collapses to the size of the warning text only. Understandable, but this changes the layout.
Hmm... I'm not sure about what you mean? For instance, when I disable JavaScript the Flash movie does not run, but the #flashcontent1 stays the same height. It doesn't collapse to the size of the text as you say? What am I missing? I tried Firefox 2 and IE6.

Collywobbles
05-20-2007, 09:56 PM
DONT YOU JUST HATE THAT?!?

I've just been back and switched off javascript and as you say, the div is holding. Sigh.

Earlier I was getting a warning bar across the top of the viewport on loading the site. If I disallowed the 'possibly dangerous content' or whatever it said, I would get the text in the left column fill the area to the right.

Apart from stopping javascript, I wonder what else the anti popup systems keep from being rendered? This is FF2.

Oh well. As is often my case, it's a non issue now. Lets see if I run into a further problem. I'm sure I shall. :)

Thanks for taking your time to look at this.

Mike.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum