the img hide,in jquery1.9.0,but normal in 1.7.2

the img hide,in jquery1.9.0,but normal in 1.7.2

<style>
.attion{ width:450px; height:200px; overflow:hidden; border:1px solid #000; padding:25px;}
</style>
<script>
/*$(function(){
    $('img').each(function(){
        var ww = $(this).width();
        var hh = $(this).height();
        if(ww>450){
            $(this).width(450);
            $(this).height(450 * hh / ww);
        }   
        $(this).toggle(function(){
            $(this).parent('.attion').css('height','auto')   
        },function(){
            $(this).parent('.attion').css('height','300px')   
            });
    });   
})*/
function resize(obj){
    var ww = $(obj).width();
        var hh = $(obj).height();
        if(ww>450){
            $(obj).width(450);
            $(obj).height(450 * hh / ww);
        }   
        $(obj).toggle(function(){
            $(obj).parent('.attion').css('height','auto')   
        },function(){
            $(obj).parent('.attion').css('height','300px')   
        });
}
</script>
<div class="attion">
    <img onload="resize(this)" src="http://image.d6315.com/Image/2013/01/29/large_dd12d45e8b454c1e997afae7f4c8dadb.jpg" />
</div>
when i use the 1.7.2,the img can resize ,but it hide with jquery 1.9.0,i tried with onload and each。