Closed levipadre closed 10 years ago
The responsiveness is defined in the CSS, the plugin supports this functionality but doesn't resize elements proportionally for you. What are you trying to do?
I would like the place a text over the image: This is your example:
<div class = 'responsiveHeight'>
<div class = 'inner'>
<div class = 'iosSlider'>
<div class = 'slider'>
<img src = 'http://placehold.it/400x400/ff00cc/' />
<img src = 'http://placehold.it/300x400/ffcc00/' />
<img src = 'http://placehold.it/200x400/ccff00/' />
<img src = 'http://placehold.it/400x400/cc00ff/' />
</div>
</div>
</div>
</div>
and I would like to change to this:
<div class = 'responsiveHeight'>
<div class = 'inner'>
<div class = 'iosSlider'>
<div class = 'slider'>
<div class= 'item' >
<span>Title 1</span>
<img src = 'http://placehold.it/400x400/ff00cc/' />
</div>
<div class= 'item' >
<span>Title 2</span>
<img src = 'http://placehold.it/300x400/ffcc00/' />
</div>
<div class= 'item' >
<span>Title 3</span>
<img src = 'http://placehold.it/200x400/ccff00/' />
</div>
<div class= 'item' >
<span>Title 4</span>
<img src = 'http://placehold.it/400x400/cc00ff/' />
</div>
</div>
</div>
</div>
</div>
I understand now. Yes, this is purely a CSS change. I'm not going to go into detail about general CSS issues here but you would follow precisely the same setup as any other responsive implementation.
Take the CSS applied to the img and apply it to the item elements. Then apply width/height 100% to your img elements. Positioning the span to overlap the img element is trivial (position, top/left offset, z-index).
Side note: you will likely run into issues with the item elements not being able to determine the variable width of the images within. So you may need to initialize in a $(window).load() in stead of a $(document).ready() to avoid the load timing issue.
Hi, How can I use the slider with container and keep the responsive width and height function? (in your examples: /9-Full-Width-Responsive-Height/3-variable-width) Something like that:
Just because I need to use another elements around the image (link, title).
Thanks,