Note that there are some explanatory texts on larger screens.

plurals
  1. POIf has class then remove class and add class
    text
    copied!<p>Having an issue here. This should be working... I have 4 elements in html that look like this</p> <pre><code> &lt;!-- Light Color Scheme - Header False and Show Faces True --&gt; &lt;div class="fb-like-box h-f_dsf-t visible" data-href="http://www.facebook.com/pages/Alpine-Adaptive-Scholarship-Program/344942928870040?fref=ts" data-width="292" data-show-faces="true" data-stream="true" data-header="false" colorscheme="light"&gt;&lt;/div&gt; </code></pre> <p>Although they are in different variations. So one could be header true and show faces true and the unique class would be ".h-t_dsf-t". The javascript should pick between them and tell which one is active and which one isn't. So only one has the .visible class at a time and the others have a .invisible class.</p> <p>Thanks in advance!</p> <p>My Javascript For The Show Faces Button <strong><em>(note .sf-no.click doesn't have anything in it yet but it will in the future I was just trying to get it to work for the yes button first.)</em></strong></p> <pre><code>// Show Faces $(document).ready(function() { $('.sf-yes').click( function() { $('.sf-yes').removeClass('btn-not-active btn-active').addClass('btn-active'); $('.sf-no').removeClass('btn-not-active btn-active').addClass('btn-not-active'); // Show Faces Yes &amp;&amp;&amp; Show Header No if ($('.sf-yes.sh-no').hasClass('.btn-active')) { $('.h-f_dsf-t').removeClass('.invisible').addClass('.visible'); $('.visible').removeClass('.visible').addClass('.invisible'); } // Show Faces Yes &amp;&amp;&amp; Show Header Yes if ($('.sf-yes.sh-yes').hasClass('.btn-active')) { $('.visible').removeClass('.visible').addClass('.invisible'); $('.h-t_dsf-t').removeClass('.invisible').addClass('.visible'); } // Show Faces No &amp;&amp;&amp; Show Header Yes if ($('.sf-no.sh-yes').hasClass('.btn-active')) { $('.visible').removeClass('.visible').addClass('.invisible'); $('.h-t_dsf-f').removeClass('.invisible').addClass('.visible'); } // Show Faces No &amp;&amp;&amp; Show Header No if ($('.sf-no.sh-no').hasClass('.btn-active')) { $('.visible').removeClass('.visible').addClass('.invisible'); $('.h-f_dsf-f').removeClass('.invisible').addClass('.visible'); } } ); $('.sf-no').click( function() { $('.sf-no').removeClass('btn-not-active btn-active').addClass('btn-active'); $('.sf-yes').removeClass('btn-not-active btn-active').addClass('btn-not-active'); } ); }); </code></pre>
 

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