SwipeView
SwipeView copied to clipboard
No height because of #swipeview-masterpage position absolute
I've seen that wrapper are 100% height and width. https://github.com/cubiq/SwipeView/blob/65c560f3926a1ca696a42768f85d5db1c6d4c18f/src/swipeview.js#L82
The wrapper's content, i.e., masterpages, are absolute. https://github.com/cubiq/SwipeView/blob/65c560f3926a1ca696a42768f85d5db1c6d4c18f/src/swipeview.js#L91
In my use case, I put some images set with width and height (like 100px) within #masterpages, and the wrapper's height is not stretched (0px maybe) in HTML, All the content I put are not visible. I need to specify the wrapper height manually. That's inconvenient.
A quick fix for this may be:
div.style.cssText = cssVendor + 'transform:translateZ(0);position:absolute;top:0;height:100%;width:100%;left:' + i*100 + '%';
+ //overwrite absolute
+ if (i == -1) {
+ div.style.cssText = div.style.cssText + ';position:relative;'
+ }
if (!div.dataset) div.dataset = {};
add below line 82