Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
486 stars 113 forks source link

Too much height at bottom after rendered #87

Open namgivu opened 8 years ago

namgivu commented 8 years ago

Your code is awesome and very helpful to me. I love it and thank you so much!

Though I would have one small issue - the height of each output page get too much height at the bottom after rendered by calling .dragend().

I guest the height of page container is the total height of all pages inside it and .dragend() not resize its height.

Is this a bug or I'm doing something wrong?

p.s.

Snapshot before calling .dragend() image

After rendered image

dominicgan commented 8 years ago

I have the same issue as you, and I've got a hacky fix for this.

Setting the value of height in _setPageDimentions (line 522) to a null string results in no css height value being assigned to the parent container, which means the parent container will take the height of the tallest panel.

The only problem you might have with this is if whitespace at the bottom of panels that are much shorter than the rest. See my codepen for an exaggerated example:

https://codepen.io/dominicgan/full/KgVgBV/