开发者

Resize Image inside DIV with Jquery

开发者 https://www.devze.com 2023-04-11 18:41 出处:网络
I need help with this situation... i´m trying to develop a banner rotator (full width), but i didn´t find any solution to strech/resize a slide image (indide a div) 100% width and maintain the aspec

I need help with this situation... i´m trying to develop a banner rotator (full width), but i didn´t find any solution to strech/resize a slide image (indide a div) 100% width and maintain the aspect ratio. I want to do it with jQuery... does anyone knows a JQuery plugin that solves this situation!!

I Want something sililar of this , but applied to a class, because i don´t want this to all images!!!

Please check below an example of my code. Many thanks in advance!! :)

<!-- START BANNER WRAPPER -->
<div id="banner-wrapper">
<div id="banner-full-width">
<div id="main-slider">

  <div class="slide">
    <div class="image">
      <img src="" /> <!-- This is the image i want to fit inside of 100% width div -->
    </div>

    <div class="info">...</div>
  </div>

</开发者_开发知识库div>
</div>
</div>
<!-- END BANNER WRAPPER -->


How about good ol' CSS?

.image img {
    width:100%;
    height:auto;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号