VinnyD
VinnyD

Reputation: 3550

Changing Iframe Width/Height in Javascript Based on Anchor Point

Ok, I deal with this all the time in flash but I'm kind of lost in how to accomplish this in Javascript and CSS. I have an iframe (which by definition doesn't have an overflow property) whose width/height i'm trying to modify. Is there an easy way to change this value relative to a certain anchor point? Basically I have an ad that has a contracted and expanded state. If the expanded state expands leftward or upward, how can i modify the width/height in such a way to display the entire contents of the ad?

Upvotes: 0

Views: 217

Answers (1)

gilly3
gilly3

Reputation: 91557

You can absolutely position your ad and anchor it with bottom and right:

.ad {
    position: absolute;
    bottom: 0;
    right: 0;
}

Then when you increase the height and width, it will expand upwards and leftwards.

Upvotes: 1

Related Questions