开发者

JQuery/Javascript to keep Absolutely Positioned div in place with browser zoom

开发者 https://www.devze.com 2023-03-26 12:06 出处:网络
Looking at this layout, I want to use jQuery/Javascript to put the Red Box, in the Gray Container u开发者_如何学JAVAnder the left small Blue Box whether zooming in or out with any browser.

Looking at this layout, I want to use jQuery/Javascript to put the Red Box, in the Gray Container u开发者_如何学JAVAnder the left small Blue Box whether zooming in or out with any browser.

I am trying to accomplish this by NOT putting the redbox #badplacement div inside the Gray Container's #outerwrapper div. Any idea how this can be accomplished?

(To start, I change the #badplacement css left to 243px, on normal browser zoom level, where it is under the small blue box.)

Fiddle: http://jsfiddle.net/Q56up/


Clone the outerwrapper div with css rules but without background and place it over the original (position:absolute, z-index:1). Put Red Box inside and position it relative.

0

精彩评论

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