Encountering an issue here. I have 4 HTML elements structured like this:
<!-- Light Color Scheme - Header False and Show Faces True -->
<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"></div>
Although they are in various variations. For instance, one could have header true and show faces true with a unique class ".h-t_dsf-t". My goal is for the JavaScript to determine which one is active and which one isn't, allowing only one element to have the .visible class at a time while others have the .invisible class.
Thank you in advance!
My JavaScript focuses on the Show Faces Button(currently, .sf-no.click doesn't contain any content yet, but it will in the future. Right now, I'm focusing on getting it to work for the yes button first.)
// 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 &&& 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 &&& 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 &&& 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 &&& 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');
}
);
});