开发者

Floating element position on resize (jQuery/CSS)

I have a hidden layer. When I click on an image the div appears over the image. However, if while the div is showing I resize the page, the the image will shift with the rest of the page elements but the div remains in the same place where it appeared. Is there a way to make it stay relative to the image?

$(".myBox").css({"position":"absolute","wid开发者_C百科th":"400px"});


If I understand what you mean, which I think that I do, then you should just put position: relative; on your image.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜