Skip to content

Instantly share code, notes, and snippets.

@wibawasuyadnya
Created July 15, 2022 10:54
Show Gist options
  • Save wibawasuyadnya/800dd77939ee9246b99ff51294e4650d to your computer and use it in GitHub Desktop.
Save wibawasuyadnya/800dd77939ee9246b99ff51294e4650d to your computer and use it in GitHub Desktop.
var $ = jQuery;
$(document).ready(function(){
//default
$('.text-details').hide();
$('.text-details.active').show();
//after click
$(".tabmenu").on("click", function(){
var dataId = $(this).attr("data-tab");
//for text
$('.text-details').fadeOut(0).removeClass('active');
$('#text-'+dataId).fadeIn(400).addClass('active');
//for tab
$('.tabmenu').removeClass('active');
$(this).addClass('active');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment