I'm totaly confused with this piece of code. When I just load the page imgWidth1 and imgHeight1 are both equal to "0" But when I resize my window, the code works and imgWidth1 and imgHeight1 have the same value as the image dimension.
All help is welcome, thanks.
var imgWidth1 = $("#image-hover-0").outerWidth();
var imgHeight1 = $("#image-hover-0").outerHeight();
$("#hover-img-0").css("width", imgWidth1 + "px");
$("#hover-img-0").css("height", imgHeight1 + "px");
$("#hover-img-0").css("line-height", imgHeight1 + "px");
$(window).resize(function() {
var imgWidth = $("#image-hover-0").outerWidth();
var imgHeight = $("#image-hover-0").outerHeight();
$("#hover-img-0").css("width", imgWidth + "px");
$("#hover-img-0").css("height", imgHeight + "px");
$("#hover-img-0").css("line-height", imgHeight + "px");
});