Note that there are some explanatory texts on larger screens.

plurals
  1. POMoving two div elements at once
    text
    copied!<p>Not sure if I'm being too clear with the title. Sorry, it's late and I don't think I have a cleared mind.</p> <p>Anyway what I want this to do is..</p> <ol> <li>When the div(manager) is clicked, the div(managerp) appears.</li> <li>The div(manager) moves to the area the same time managerp moves there. Almost as though they move as one div element.</li> <li>On the next click managerp Fades out, and manager moves back to its original position.</li> </ol> <p>I'm able to do all of that, but it won't return to it's original position. I am a novice when it comes to jQuery, so this is where I ask for your help. </p> <p>EDIT: The div manager doesn't seem to return to the old position. I've tried editing the css through jQuery to get it to, but it doesn't seem to work. </p> <p>HTML : </p> <pre><code> &lt;div id="manager"&gt; &lt;span&gt;&amp;raquo;&lt;/span&gt; &lt;/div&gt; &lt;div id="managerp" style=""&gt; &lt;/div&gt; </code></pre> <p>No, I can't put managerp within manager, it doesn't seem to position itself as good as it should. </p> <p>jQuery : </p> <pre><code> $(document).ready(function() { $("#manager").click(function() { $("#manager").css({'margin-left' : '270px', 'border-left' : '0'}); $("#managerp").toggle("slow", function() { if ($("#managerp").is(':visible')) $("span").html("&amp;laquo;"); else $("span").html("&amp;raquo;"); }); }); }); </code></pre> <p>This should help you get the picture of what it's supposed to look like. (Sorry if I am giving way too much information)</p> <p><img src="https://i.stack.imgur.com/TZeEh.png" alt="One"> <img src="https://i.stack.imgur.com/1WVyA.png" alt="Two"></p> <p>Thank you for your help. If you need me to be more specific as to what it should be doing, just ask. </p> <p><img src="https://i.stack.imgur.com/8gOlP.png" alt="This is how it looks when it doesn&#39;t return correctly."></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