Note that there are some explanatory texts on larger screens.

plurals
  1. POhide divs and highlighting selected thumbnail to active
    primarykey
    data
    text
    <p>I'm creating a team members page and I used this thread to help me out a little.</p> <p><a href="https://stackoverflow.com/questions/16463560/fade-out-fade-in-of-list-items">Fade Out/Fade In of List Items</a></p> <p>I have everything working as I want except I can't figure out how to make the other people in my gallery stay active (red border) and hide the other description of the team members on page load. ( On page load scroll down to see what I mean. )</p> <p>Here is the code I'm working with.</p> <p><strong>HTML</strong></p> <pre><code>&lt;div class="grid_6"&gt; &lt;div id="staffDirectory"&gt; &lt;ul class="team list-image clearfix"&gt; &lt;li class="selectedMember"&gt; &lt;img src="images/team/head1.jpg" class="max-img headshots" /&gt; &lt;/li&gt; &lt;li&gt;&lt;img src="images/team/head2.jpg" class="max-img headshots" /&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="images/team/head3.jpg" class="max-img headshots" /&gt;&lt;/li&gt; ... &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt;&lt;!--End 6--&gt; &lt;div class="grid_6"&gt; &lt;div id="staffMember"&gt; &lt;ul&gt; &lt;li class="staffSelected"&gt; &lt;div class="box white-bg"&gt; &lt;img src="images/team/head1.jpg" class="headshots-red" /&gt; &lt;h2 class="red3-tx bold"&gt;John Doe 1&lt;/h2&gt; &lt;h3 class="blue4-tx" style="font-weight:400; font-style:italic;"&gt;Position: Manager&lt;/h3&gt; &lt;p class="blue3-tx"&gt;text&lt;/p&gt; &lt;/div&gt; &lt;/li&gt; ... &lt;/ul&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>#staffDirectory ul li { opacity: 0.9; } #staffDirectory li:hover{ opacity: 1; } .selectedMember { opacity: 1.0 !important; } .staffSelected { display: inherit; } #staffMember li:not(.staffSelected) { display: none; } .team li{ display:inline-block; float:left; margin-bottom: 10px; margin-right: 8%; width:28%; cursor: pointer; } .headshots{ border:5px solid #034A68; } .headshots:hover{ border:5px solid #981B1E; } .headshots:active{ border:5px solid #981B1E; } .headshots-red{ border:5px solid #981B1E; margin-bottom:25px; height: auto; width: 98%; } </code></pre> <p><strong>JS</strong></p> <pre><code> &lt;script&gt; $(document).ready(function() { $("#staffDirectory ul li").click(function() { var index = $("#staffDirectory ul li").index(this); var newMember = null; newMember = $("#staffMember ul li").get(index); $(".staffSelected").fadeOut(500); setTimeout(function() { $(newMember).fadeIn(500).addClass('staffSelected'); }, 500); }); }); &lt;/script&gt; </code></pre> <p>Sorry for the code dumb, just not sure where the problem is. Any help would be appreciated. Thank you.</p> <p><strong>EDIT!!! WORKING VERSION</strong> Here is the completed working version of this employee gallery. Thank you to the people that helped me out. Hope someone else can find this useful. <a href="http://codepen.io/daugaard47/pen/ctHru" rel="nofollow noreferrer">http://codepen.io/daugaard47/pen/ctHru</a></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.
 

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