私がここで話しているページをチェックしてください: http://willy-ward.com/fashion
基本的に、ユーザーがブラウザのサイズを変更して最大化したときに、写真を現在の縦横比に保つ方法がわかりません。
私はCSSを少しいじっていますが、正しく理解できないようです。それはかなり簡単なことだと確信しています。その URL をチェックして、ブラウザ ウィンドウのサイズ変更によって写真がどのように影響を受けるかを確認してください。高さ 100% と幅の自動が正しく機能していないようですか?
別の問題として、このページの画像の下に要素がないにもかかわらず、画像の下に余分な余白があります。そこで少し戸惑います。
質問が雄弁でなかったらすみません、疲れるにつれて私の英語力は少し落ちます。
助けてくれてありがとう!
これが私が現在持っているコードです:
jQuery(document).ready(function() {
jQuery(".photoStrip").width(0);
jQuery(".photoContainer img").load(function(){
jQuery(this).css({'visibility':'hidden','display':'block'});
var newWidth = jQuery(this).width();
jQuery(this).css({'visibility':'visible','display':'none'});
jQuery(".photoStrip").width(function(index, width){
return width + newWidth + 20;
});
jQuery(this).parent().css({
'width' : newWidth
});
jQuery(this).fadeIn(800);
}).each(function(){
if(this.complete) jQuery(this).trigger("load");
});
jQuery(window).bind("resize", function(){
jQuery(".photoStrip").width(0);
jQuery(".photoContainer").each(function(){
var newWidth = jQuery("img", this).width();
jQuery(this).css({
'width' : newWidth
});
jQuery(".photoStrip").width(function(index, width){
return width + newWidth + 20;
});
});
});
});