Note that there are some explanatory texts on larger screens.

plurals
  1. POA flip card with a scrolling element on each side using -webkit-overflow-scrolling: touch; on iOS 5
    primarykey
    data
    text
    <p>I have a problem creating a flip card with a scrolling element on each side with HTML, CSS and JS for Mobile Safari on iOS 5. </p> <p>If you scroll when the card is flipped or not flipped, the scrolling always happens on the element on the back. The scrolling never works on the front.</p> <p>I have the following code:</p> <p><strong>HTML</strong></p> <pre class="lang-html prettyprint-override"><code>&lt;ol id="front" onclick="flip();"&gt; &lt;li&gt;Front&lt;/li&gt; ... &lt;li&gt;Front&lt;/li&gt; &lt;/ol&gt; &lt;ol id="back" class="flipped" onclick="flip();"&gt; &lt;li&gt;Back&lt;/li&gt; ... &lt;li&gt;Back&lt;/li&gt; &lt;/ol&gt; </code></pre> <p><strong>JS</strong></p> <pre class="lang-js prettyprint-override"><code>function flip(){ var front = document.getElementById("front"); var back = document.getElementById("back"); if (front.className != "flipped") { front.className = "flipped"; back.className = ""; } else { front.className = ""; back.className = "flipped"; } } </code></pre> <p><strong>CSS</strong></p> <pre><code>#front, #back { position: absolute; width: 400px; height: 400px; overflow: scroll; -webkit-overflow-scrolling: touch; -webkit-backface-visibility: hidden; -webkit-transition: all 500ms linear; } #front.flipped { -webkit-transform: perspective(100px) rotateY(180deg); } #back.flipped { -webkit-transform: perspective(100px) rotateY(-180deg); } </code></pre> <p>Here's the code in action (try it with iOS 5): <a href="http://jsfiddle.net/sennevdb/bDh5b/embedded/result" rel="nofollow">http://jsfiddle.net/sennevdb/bDh5b/embedded/result</a></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.
    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