I have two images, the first image can be any size and I'd like the second image, right beside it to be the same height as the first image. I wrote the following code:
<script>
$(function() {
$("#first").load(function() {
var imgheight = $(this).height();
$("#first_papers").css("height", imgheight);
});
});
</script>
The above code works fine. The problem is that when I visit another page on the site and then return to the main page the function doesn't seem to be called. What happens insteadis that the second image is appearing at its full height instead of the shorter height of the first image.
Any ideas on how to fix this?