Note that there are some explanatory texts on larger screens.

plurals
  1. POchange behavior of CSS -transition property
    text
    copied!<p>I'm using CSS transition property, to animate webpage. Basically what I got so far is: when I am in the home page ( <code>class="content"</code> only ) and I click on 'About Me' link (<code>class="secondary"</code>), about me page false down in the good way, but if I than go to another link with <code>class="secondary"</code>, 'About Me' page will first go up and than another page will false down. And I don't want this behavior. I want another page with <code>class="secondary"</code> just false in front of the previous one. </p> <p>I was trying to do my best on <a href="http://jsfiddle.net/FMRBf/2/" rel="nofollow">http://jsfiddle.net/FMRBf/2</a></p> <h1>HTML</h1> <pre><code> &lt;li&gt;&lt;a href="#home" id="nav-home"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#another-page" id="nav-portfolio"&gt;Portfolio&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#about" id="nav-about"&gt;About Me&lt;/a&gt;&lt;/li&gt; &lt;/br&gt; &lt;div id="home" class="content"&gt; &lt;h2&gt;Home&lt;/h2&gt; &lt;/div&gt; &lt;div id="about" class="secondary"&gt; &lt;div class="content"&gt; &lt;h2&gt;About Me&lt;/h2&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="another-page" class="secondary"&gt; &lt;div class="content"&gt; &lt;h2&gt;Another Secondary Page&lt;/h2&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <h1>CSS</h1> <pre><code>.content { background-color: rgba(255,233,0,0.8); height: 100%; margin-top: 5%; } .secondary { min-width: 100%; height: 98%; background: #000; position: absolute; z-index: 2; overflow-y: auto; overflow-x: hidden; margin-top: -100%; -webkit-transition: all .8s ease-in; -moz-transition: all .8s ease-in; -o-transition: all .8s ease-in; transition: all .8s ease-in; } .secondary:target { margin-top: 0px; background-color: rgba(255,233,0,1); } </code></pre>
 

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