Enlarging images with CSS (or jQuery) without moving everything else on the page

前端 未结 6 1874
暖寄归人
暖寄归人 2021-01-05 19:28

I have a dynamically generated set of images (with a comment near every image). I want to display every image with max-width and max-height of 48 px, but when the user is ho

6条回答
  •  梦毁少年i
    2021-01-05 20:33

    It'd use jQuery here for this:

    Basicly you have an absolute div which is hidden until you hover a img, then positions itself to where the img is and shows the same image, but bigger. The image increases from the center and won't affect the rest of the structure since it's absolute.

    I could add animation if you'd like.

提交回复
热议问题