I can't imagine img width and height in another css class. If you could just give me a hint, that would be nice! Here is my code:
$('.Main_hover').each(function() { var $this = $(this); var w = $this.find('img').width(); var h = $this.find('img').height(); $(".fusion-button-wrapper").css('height', h); $(".fusion-button-wrapper").css('width', w); });
Of course, this is wrapped around a document.
Here is the HTML where I want to take the width and height of the image:
<div class="imageframe-align-center"> <span class="fusion-imageframe imageframe-none imageframe-1 hover-type-none Main_hover"> <a class="fusion-no-lightbox" href="http://lowette.devel.growcreativity.be/portfolio-items/dummy3/" target="_self"> <img src="http://lowette.devel.growcreativity.be/wp-content/uploads/2016/01/lowette_blok1_1.png" alt="Blok1_1" class="img-responsive"> </a> </span> </div>
And here is the div class where I want to specify the width and height:
<div class="fusion-button-wrapper"></div>
source share