2014-02-10 60 views

回答

1

它應該工作!

$(document).ready(){ 
    var h = $(window).height(); 
    if (h < 755) 
    { 
     $('.img.your-image-class').css("max-height",h + "px") 
    } 
} 
+0

搖滾!這很好。謝謝! – akhunaton

+1

無需使用JavaScript,當問題可以在純CSS解決 - 只是說''! ,P –

1

你可以嘗試

img.your-image-class { 
    height: 100%; //automatically retains aspect ratio 
    max-height: 755px; //don't let it get bigger than this (755px is its current height I checked your link 
} 
相關問題