Note that there are some explanatory texts on larger screens.

plurals
  1. POanimate toggle only woking one way
    primarykey
    data
    text
    <p>what I am trying to do is on open, menu 1, showing 'Click me to start'. Menu 2, which currently says 'This is menu 2', just for building purposes, is hidden. Then, on first click, menu 1 hides and menu 2 shows, then toggles back on second click. The problem is that once menu 2 is showing and menu 1 is hidden, it won't toggle back.</p> <pre><code>&lt;div id="nav" class="nav"&gt; &lt;div id="whiteboardtext1" class="whiteboardtext1"&gt;&lt;p&gt;Click here to start&lt;/p&gt;&lt;/div&gt; &lt;div id="whiteboardtext2" class="whiteboardtext2"&gt;&lt;p&gt;this is menu number 2&lt;/p&gt;&lt;/div&gt; &lt;/div&gt;​ .nav{ width:700px; float:left; } .whiteboardtext1{ position:absolute; margin-top:110px; margin-left:215px; width:300px; height:100px; font-size:30px; font-family:whiteboard; text-align:center; border:1px solid #fff; cursor:pointer; } .whiteboardtext2{ z-index:1; position:absolute; margin-top:50px; margin-left:50px; width:650px; height:350px; font-size:30px; cursor:pointer; font-size:30px; font-family:whiteboard; text-align:center; border:1px solid #fff; cursor:pointer; } ​$(document).ready(function(){ $('#whiteboardtext2').hide(); $('#whiteboardtext1').toggle( function() { $('#whiteboardtext1').stop().animate({ 'opasity':'0' }, 'fast'); $('#whiteboardtext2').stop().animate({ 'opasity':'1' }, 'fast'); $('#whiteboardtext1').fadeOut(); $('#whiteboardtext2').fadeIn(); }, function() { $('#whiteboardtext1').stop().animate({ 'opasity':'1' }, 'fast'); $('#whiteboardtext2').stop().animate({ 'opasity':'0' }, 'fast'); $('#whiteboardtext2').fadeOut(); $('#whiteboardtext1').fadeIn(); }) }); </code></pre> <p>​</p> <p>I pretty sure the code is correct, but I just can't get it to work. </p> <p>If anyone can help, I would really appreciate it.</p> <p>Thank in advance</p> <p>me</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