Comments (9)
Sorry, this was never explicitly accounted for! However, it should respond
well to having the height set via js:
$('.your-slideshow').css({ height: 200 });
On Monday, April 1, 2013, o-l-e wrote:
Hi, and compliments on a nice simple slider.
I am trying to make the slider responsive, with variable sized content.
Everything works well, but the height is really tricky.
Is it possible to somehow "make the slider the height of tallest image"?
It seems the slider needs a set height in the css, which is a bit tricky
when the width (also css) is set to for example 100%.Hope you understand the question :)
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.
from swipeshow.
Hm, this is still a bit tricky.
The ideal idea would be to allow for the slides to be 100% width, while the height of the slider would be resized according to either a. the active slide, or b. the tallest slide of the slides in each individual slider.
I think the first option would be the best.
What do you think, is this achievable?
Sort of something like this thing: http://webbies.dk/assets/files/SudoSlider/package/demos/autoheight.html
Thing is i am trying to make a blog-type page with several sliders mixed with blocks of text and with variable height.
from swipeshow.
Sounds like something you can do with this:
$(".your-slideshow").swipeshow({
onactivate: function(current, i, previous, j) {
// `current` refers to the current `.slide` that is active.
// `this` refers to the `.your-slideshow` we started with on line 1.
$(this).css({ height: $(current).height(), transition: 'height 300ms ease' });
}
});
...I haven't tested out the code, but something like that should work.
from swipeshow.
From a design perspective, I'd ask you to reconsider, though. Seems like an annoying effect :)
from swipeshow.
Hi there, and sorry for the late reply.
I have not had time to try it out, but i will let you know how it turned out :)
from swipeshow.
Hi again,
i have tried out your suggestion, but i simply can't get it to work.
Do you have any other suggestions by any chance?
As i explained earlier i am trying to create a one page type website, with multiple sliders with variable heights.
Thanks for any advice :)
from swipeshow.
Try adding .find('img')
:
$(".your-slideshow").swipeshow({
onactivate: function(current, i, previous, j) {
$(this).css({ height: $(current).find('.img').height(), transition: 'height 300ms ease' });
}
});
from swipeshow.
@o-l-e I was just recently able to finally overcome this by assinging 'height' to 'auto', and then assigning psuedo elements to maintain a certain aspect ratio.
You can find the (hack?) on CSS Tricks, plus LESS/SCSS mixins.
https://css-tricks.com/snippets/sass/maintain-aspect-ratio-mixin/
Let me know if this worked for you, hoping it wasn't just a fluke of some other element I have mixed in.
from swipeshow.
Sorry @OneMohrTime i didn't end up pursuing this any further, so i ended up using another slider. But thanks so much for your input, and hope somebody else finds it useful :)
from swipeshow.
Related Issues (20)
- Compatibility HOT 5
- Youtube videos disappearing or gets cut on mouse hover HOT 3
- Best way to dynamically add li items to the slideshow?
- Testing for transitions returns true in IE7 and IE8 HOT 2
- onactivate to get attribute of current active slider?
- On click go to next slide HOT 5
- Stop slideshow after hover HOT 1
- width: 100% HOT 1
- Problem with swipe on Samsung s4 cell/mobile in Chrome HOT 4
- Swipeshow doesn't work on Nexus 4 HOT 2
- doesn't allow vertical scrolling of long content HOT 3
- Height 100% HOT 1
- Touch swipe not functioning in iOS (iPhone, iPad) - with fix
- "counter" that shows current image-index and total index HOT 2
- Android native browser issues; unpredictable behavior HOT 1
- Support for vertical sliders HOT 1
- swipeshow().next() swipes 2 slides at once
- How to get current slide index ?
- Reverse interaction direction
- Videos and audio not working on swipeshow
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swipeshow.