Note that there are some explanatory texts on larger screens.

plurals
  1. POShift up div and fade in on option selection
    text
    copied!<p>Here's a <a href="http://jsfiddle.net/QFLEG/" rel="nofollow">jsfiddle</a> that I found. </p> <p><strong>HTML</strong></p> <pre><code>&lt;div class="container"&gt; &lt;header&gt; &lt;ul class="sidenav"&gt; &lt;li&gt;&lt;h2&gt;&lt;a data-region="nav-1" href="#"&gt;&lt;span class="title"&gt;About&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;/li&gt; &lt;li&gt;&lt;h2&gt;&lt;a data-region="nav-2" href="#"&gt;&lt;span class="title"&gt;Services&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/header&gt; &lt;div id="nav-1" class="infozone z1"&gt;&lt;p&gt;Hello I'm box 1.&lt;/p&gt;&lt;/div&gt; &lt;div id="nav-2" class="infozone z2"&gt;&lt;p&gt;Hello I'm box 2.&lt;/p&gt;&lt;/div&gt; </code></pre> <p></p> <p><strong>CSS</strong></p> <pre><code>.infozone{ float:left; position:absolute; height:400px; width:800px; display:none; } .z1 { background-color: blue; } .z2 { background-color: red; } </code></pre> <p><strong>JS</strong></p> <pre><code>$('.sidenav a').click(function(){ $('.infozone').fadeOut(550); var region = $(this).attr('data-region'); $('#' + region).fadeIn(550); }) </code></pre> <p>What I'm trying to do is...</p> <ol> <li>Instead of regular links, they will be &lt; option >s</li> <li>If a user chooses a certain option, the div that's related to that option will fade in while moving up 5px. If there was a div that faded in before, that div would fade out while moving down 5px.</li> </ol> <p>Here is an updated <a href="http://jsfiddle.net/kFe5g/" rel="nofollow">jsfiddle</a>. Unfortunately, the <code>div's</code> are not fading in/out, and on top of that, I'm not really sure how to add the "moving up/down" effect.</p> <p>Any help is appreciated! </p>
 

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