Getting image height

Getting image height

I need to get image height without using .attr and add it to div style. I got something like that but it's not working.

  1. <img alt="photo-current" src="images/galleries/1/photo_1.jpg" id="photo-current"/>

  1. <script type="text/javascript">
    jQuery(document).ready(function($) {
    $("#photo-current").load(function() {
    var imageHeight = $(this).height();
    });
    $('div#slideshow').css({'height' : imageHeight});
    });
    </script>