Skip to content

Instantly share code, notes, and snippets.

@ozknozsrt
Created May 31, 2018 09:10
Show Gist options
  • Save ozknozsrt/b78e1a2865bc2c68a69caa843fba1dd6 to your computer and use it in GitHub Desktop.
Save ozknozsrt/b78e1a2865bc2c68a69caa843fba1dd6 to your computer and use it in GitHub Desktop.
$(".acctrigger").click(function() {
var target = $(this).attr('href');
$('.acc-page').removeClass('active');
$('.acctrigger').removeClass('active');
$(target).addClass('active');
var target = $(this).attr('href');
$(this).addClass('active');
return false;
});
var slideIndex = 0;
showSlides();
function showSlides() {
var i;
var slides = document.getElementsByClassName("acc-page");
slideIndex++;
if (slideIndex > slides.length) {
slideIndex = 1
}
for (i = 0; i < slides.length; i++) {
slides[i].className = slides[i].className.replace(" active", "");
}
slides[slideIndex - 1].className += " active";
setTimeout(showSlides, 4000); // Change image every 2 seconds
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment