Image resize of items jQuery

前端 未结 2 1159
眼角桃花
眼角桃花 2021-01-24 04:28

I have managed to fit automatically the images of the gallery per row depending if it´s horizontal (one image per row) or vertical (two images per row).

The problem now

2条回答
  •  悲&欢浪女
    2021-01-24 04:50

    This would be better to solve with CSS. Just set the img width to 100% and it will expand contract with the size of its parent. In the example below .container takes up 25% of the window and the img takes up 100% of that. You can use firebug to change the width of the container and see the difference.

    
    
    
        
    
    
    
        

提交回复
热议问题