Crop Image Sides as Browser Width Decreases in Bootstrap Carousel

前端 未结 5 1485
醉话见心
醉话见心 2020-12-19 13:52

I have a carousel with background images similar to this site

I have images that I would like to stretch to 100% of the browser width. When the user shrinks the wid

5条回答
  •  天涯浪人
    2020-12-19 14:22

    When you say, "would like to stretch to 100% of the browser width" the images are relative to the current width of browser (viewport), so do you mean you want the images to be 100% of the initial browser width?

    Also, what would the image width be when the browser width increases? Do they stay at original 100% width or increase?

    I took a shot at what I think the expected behavior is. It requires jQuery to monitor the initial viewport width.

    Working demo: http://bootply.com/91957#

提交回复
热议问题