Note that there are some explanatory texts on larger screens.

plurals
  1. POLinks/button disabled until another button is clicked
    primarykey
    data
    text
    <p>I am looking for a way to make all the menu items on the left be disabled.</p> <p>And on each of their divs, there is an Execute button and Next button. The next button needs to be disabled until the execute button is clicked.</p> <p>In addition to the next button becoming enabled, the next item in the menu needs to be enabled and clickable.</p> <p>Clicking the Next would go to the next item on the left menu also.</p> <p><strong>Javscript:</strong></p> <pre><code>// nav $(".nav-content").hide(); $("ul.nav li:first").addClass("active").show(); $(".nav-content:first").show(); // onclick event $("ul.nav li").click(function() { $("ul.nav li").removeClass("active"); $(this).addClass("active"); $(".nav-content").hide(); var activenav = $(this).find("a").attr("href"); $(activenav).show(); return false; }); </code></pre> <p><strong>HTML</strong></p> <pre><code>&lt;div id="wrap"&gt; &lt;ul class="nav"&gt; &lt;li&gt;&lt;a href="#step1"&gt;&lt;span&gt;1&lt;/span&gt; ONE&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#step2"&gt;&lt;span&gt;2&lt;/span&gt; TWO&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#step3"&gt;&lt;span&gt;3&lt;/span&gt; THREE&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="nav-container"&gt; &lt;div id="step1" class="nav-content"&gt; &lt;p&gt;ONE&lt;/p&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt; &lt;button class="execute" onclick=""&gt;Execute&lt;/button&gt; &lt;button class="next" onclick=""&gt;Next&lt;/button&gt; &lt;/div&gt; &lt;!-- /step1 --&gt; &lt;div id="step2" class="nav-content"&gt; &lt;p&gt;TWO&lt;/p&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt; &lt;button class="execute" onclick=""&gt;Execute&lt;/button&gt; &lt;button class="next" onclick=""&gt;Next&lt;/button&gt; &lt;/div&gt; &lt;!-- /step2 --&gt; &lt;div id="step3" class="nav-content"&gt; &lt;p&gt;THREE&lt;/p&gt; &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.&lt;/p&gt; &lt;button class="execute" onclick=""&gt;Execute&lt;/button&gt; &lt;button class="next" onclick=""&gt;Next&lt;/button&gt; &lt;/div&gt; &lt;!-- /step3 --&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>#wrap { width: 100%; } #wrap ul.nav { list-style: none; padding: 0; margin: 0; width: 250px; float: left; } #wrap ul.nav li { min-height: 60px; background-color: #2b6ed6; border-bottom: 1px solid #92b4ea; } #wrap ul.nav li span { position: relative; vertical-align: middle; margin-right: 5px; font-size: 40px; } #wrap ul.nav li a { color: #fff; display: block; padding: 20px 10px; text-decoration: none; line-height: 20px; position: relative; top: 0px; font-size: 99%; } #wrap .enabled { } #wrap .disabled { } #wrap ul.nav li a:focus { outline: none; } /*#wrap ul.nav li.active, */ #wrap ul.nav li.active a { color: #000; } #wrap ul.nav li.active a:after { left: 100%; border: solid transparent; content:" "; height: 0; width: 0; position: absolute; pointer-events: none; } #wrap ul.nav li.active a:after { border-color: rgba(136, 183, 213, 0); border-left-color: #2b6ed6; border-width: 30px; top: 50%; margin-top: -30px; } #wrap .nav-container { float: left; margin: 0; padding: 0; width: 60%; border-right: 1px solid #ccc; border-bottom:1px solid #ccc; } #wrap .nav-content { margin: 0; padding: 0; } #wrap .nav-content p { padding: 0 0 0 35px; } </code></pre> <p>I've also put this at <a href="http://jsfiddle.net/XVLaX/1/" rel="nofollow">http://jsfiddle.net/XVLaX/1/</a></p> <p>Thanks!</p>
    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