jQuery(function(){
    $('img').each(function(){
        var max = 0;
        if (navigator.userAgent.indexOf('iPhone') > 0) {
            max = 280; // iPhoneの最大幅
        } else if (navigator.userAgent.indexOf('iPad') > 0 ) {
            max = 768; // iPadの最大幅
        } else if (navigator.userAgent.indexOf('iPod') > 0 ) {
            max = 280; // iPodの最大幅
        } else if (navigator.userAgent.indexOf('Android') > 0) {
            max = 280; // Androidの最大幅
        }
        var w = $(this).width();
        var h = $(this).height();
        if (max != 0 && w > max) {
            $(this).width(max).height(Math.round((max/w)*h));
        }
    });
});

