0

How to retrieve the Image height and width from the IMG tag using jQuery and use this value in div style. example

<div class=center > &nbsp;</div>
<img src="source.png" width="100" height="200" />
<div class="bottom">&nbsp &nbsp &nbsp</div>

I want to use the height of the Image and and apply to the DIV. enter code here and

I have an image on the left and text on the right. Like two column pillars I want the image to appear at the center of the page when reviewing the text.

I tried Location: fixed But after that, sometimes, when I reset the IE window to a small size, this image is positioned in the same position, and it moves out of content content when I'm moving I want this image to be scrolled but must remain in the content. It should not move beyond the original content range.

Thank you for helping me

fixatd
  • 1,394
  • 1
  • 11
  • 19
  • 1
    Hi and welcome to SO. This have probably been answered here: https://stackoverflow.com/questions/623172/how-to-get-image-size-height-width-using-javascript - take a look. If your question is still not answered, edit your question to why your question is different. Cheers – Jonas Praem Jan 18 '19 at 13:37
  • @Jonas, I think this answer is more useful regarding the OP's question: https://stackoverflow.com/questions/9725024/get-original-dimensions-of-resized-html-image-element/9725059 – thibpat Jan 18 '19 at 13:38

0 Answers0