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.
精彩评论