Note that there are some explanatory texts on larger screens.

plurals
  1. POResponsive swipe gallery
    primarykey
    data
    text
    <p>I'm working on a snippet for a swipe gallery for mobile. You can see it here <a href="http://codepen.io/piatra/full/Edtlq" rel="nofollow">http://codepen.io/piatra/full/Edtlq</a></p> <pre><code>[].forEach.call(slides, function(s){ s.style.width = mainContainer.offsetWidth + 'px'; }); </code></pre> <p>My problem: Because the content is made up of multiple panels they need to be on the same line to the right. The size of a panel should be 100% of the screen so you only see one panel at a time. But i cannot set the size of the panel in css to 100% because that would push each panel on its own row. </p> <p>Currently I am solving this in JS, <code>ontouchstart</code> I get the size of the main parent and set each slide to that width but I don't like this solution because when switching for landscape to portrait you have to touch the gallery for it to update, and even if I add an event lister to the change its still not a pretty solution.</p> <p>Can I achieve this effect in CSS only? A gallery of panels on the same row with the width variable based on the parent ? </p> <p>PS : Chrome dev tools > Emulate touch events</p> <p>PPS : Wrote down a simplified version <a href="http://codepen.io/piatra/pen/usaHo" rel="nofollow">http://codepen.io/piatra/pen/usaHo</a> Any improvement to this version is very much welcomed :)</p> <p>A nice example is <a href="http://csscience.com/responsiveslidercss3/" rel="nofollow">http://csscience.com/responsiveslidercss3/</a> but when adding a new panel you have to edit the CSS</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload