Note that there are some explanatory texts on larger screens.

plurals
  1. POStyled <input type="range"> made to redirect not working on touch devices
    primarykey
    data
    text
    <p>I'm trying to make a slider, which on reaching a specific value, redirects to another url. The code is <a href="http://jsfiddle.net/9vs2n/" rel="nofollow">http://jsfiddle.net/9vs2n/</a> <br/>HTML:-</p> <pre><code>&lt;div id="slide-wrap"&gt; &lt;div id="over"&gt; &lt;div id="overin"&gt;&lt;/div&gt; &lt;/div&gt; &lt;input type="range" id="in" class="slideToUnlock" value="0" max="100"&gt; &lt;/div&gt; </code></pre> <p><br/>CSS:-</p> <pre><code>body { color:white; background: #323232; margin:0; padding:0; } #over { width:80%; border:solid thick rgba(255, 255, 255, 0.5); margin:0 auto; padding:0; height:55px; display:block; position:relative; background:rgba(255, 255, 255, 0.75); border-bottom-left-radius:1em; border-top-right-radius:1em; } #overin { appearance:none; -webkit-appearance:none; -moz-appearance:none; background:#60a917; width:75px; height:55px; display:block; border-bottom-left-radius:1em; border-top-right-radius:1em; } #in { outline:none; -moz-appearance:none; -webkit-appearance:none; appearance:none; width:80%; margin:0 auto; margin-top:-55px; padding:0; height:55px; display:block; position:relative; background:rgba(0, 0, 0, 0); } #overin:before { color: white; position:relative; right:10px; top: -10px; width:99%; font-size: 56px; font-weight: bold; content:"&gt;"; display:inline-block; text-align:end; } #in::-webkit-slider-thumb { cursor:pointer; appearance:none; -webkit-appearance:none; -moz-appearance:none; background:rgba(0, 0, 0, 0); width:75px; height:55px; display:block; } #over:before { content:"slide to continue"; color: white; position: absolute; left: 100px; top: 10px; z-index: -1; font-size: 32px; } #slide-wrap { margin:10px auto; } </code></pre> <p><br/>JavaScript:-</p> <pre><code>document.getElementById('in').onmouseup = function () { var val = document.getElementById('in').value; if (val &gt;= 50) { window.location.href = "http://www.example.com/"; } else { this.value = 0; zero() } } document.getElementById('in').onmousemove = function () { enlarge(); } function enlarge() { if (document.getElementById('in').value &gt; 10) { document.getElementById('overin').style.width = document.getElementById('in').value + "%"; } } function zero() { document.getElementById('overin').style.width = '80px'; } setInterval(loop1(), 1); function loop1() { document.getElementById('over').style.width = document.getElementById('in').style.width; } </code></pre> <p>It works properly, but the problem is that it's not working on touch devices, i've tried it on ipad, please try and try to solve this. The page is available at <a href="https://dl.dropboxusercontent.com/u/99185097/donotdelete/index.html" rel="nofollow">https://dl.dropboxusercontent.com/u/99185097/donotdelete/index.html</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.
 

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