Note that there are some explanatory texts on larger screens.

plurals
  1. PODelay in CSS :active selector taking effect
    primarykey
    data
    text
    <p>I'm having trouble getting my CSS 3 button to operate properly. You can view the button at <a href="http://nova-fusion.com/projects/strong/" rel="nofollow">one of my project pages</a>. The problem is that there's a second or so delay before the <code>:active</code> CSS selector takes effect, making the button move slightly and changing the shadow; it didn't do this before. Here's the Sass code:</p> <pre><code>@mixin transition($type, $time, $ease) { -webkit-transition: $type $time $ease; transition: $type $time $ease; } @mixin border-radius($length) { border-radius: $length; -webkit-border-radius: $length; -moz-border-radius: $length; } .project-download { color: #000300; background-color: #00910A; padding: 10px; position: relative; text-align: center; font-size: 24px; font-weight: bold; @include transition(background-color, 0.2s, linear); @include border-radius(10px); box-shadow: 1px 1px 0 0 #014D06, 2px 2px 0 0 #014D06, 3px 3px 0 0 #014D06, 4px 4px 0 0 #014D06, 5px 5px 5px 0 #000000; -webkit-box-shadow: 1px 1px 0 0 #014D06, 2px 2px 0 0 #014D06, 3px 3px 0 0 #014D06, 4px 4px 0 0 #014D06, 5px 5px 5px 0 #000000; -moz-box-shadow: 1px 1px 0 0 #014D06, 2px 2px 0 0 #014D06, 3px 3px 0 0 #014D06, 4px 4px 0 0 #014D06, 5px 5px 5px 0 #000000; &amp;:hover { background-color: #00B00C; } &amp;:active { box-shadow: 1px 1px 5px 0 #000000; -webkit-box-shadow: 1px 1px 5px 0 #000000; -moz-box-shadow: 1px 1px 5px 0 #000000; top: 4px; left: 4px; } } </code></pre> <p>which translates in CSS to:</p> <pre><code>.project-download { color: #000300; background-color: #00910A; padding: 10px; position: relative; text-align: center; font-size: 24px; font-weight: bold; box-shadow: 1px 1px 0 0 #014D06, 2px 2px 0 0 #014D06, 3px 3px 0 0 #014D06, 4px 4px 0 0 #014D06, 5px 5px 5px 0 #000000; -webkit-box-shadow: 1px 1px 0 0 #014D06, 2px 2px 0 0 #014D06, 3px 3px 0 0 #014D06, 4px 4px 0 0 #014D06, 5px 5px 5px 0 #000000; -moz-box-shadow: 1px 1px 0 0 #014D06, 2px 2px 0 0 #014D06, 3px 3px 0 0 #014D06, 4px 4px 0 0 #014D06, 5px 5px 5px 0 #000000; border-radius: 10px; -webkit-border-radius: 10px; -moz-border-radius: 10px; -webkit-transition: background-color 0.2s linear; transition: background-color 0.2s linear; } .project-download:active { box-shadow: 1px 1px 5px 0 #000000; -webkit-box-shadow: 1px 1px 5px 0 #000000; -moz-box-shadow: 1px 1px 5px 0 #000000; top: 4px; left: 4px; } .project-download:hover { background-color: #00B00C; } </code></pre> <p>I've searched Google a bit with no luck. Any ideas?</p> <p><strong>EDIT</strong>: I solved the problem that Clicky was causing by using this JavaScript function:</p> <pre><code>function removeLinkListeners() { var links = document.getElementsByTagName('a'); for (var i = 0; i &lt; links.length; i++) { if (links[i].classList.contains('project-download-link')) { links[i].removeEventListener('mousedown', clicky.outbound); } } } </code></pre> <p>And changing the initialisation script to this:</p> <pre><code>&lt;script type="text/javascript"&gt; try { clicky.init(234973); window.onload = removeLinkListeners; } catch(e) {} &lt;/script&gt; </code></pre>
    singulars
    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