开发者

Changing Iframe Width/Height in Javascript Based on Anchor Point

开发者 https://www.devze.com 2023-04-06 18:56 出处:网络
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/h

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 eas开发者_Python百科y 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消