Last active
February 26, 2019 13:43
-
-
Save ammardev/8170a616e9d052f5f3d757c944488eb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function changeTab(tabName) { | |
$('.tabstest .pmtab').removeClass('active'); | |
$('.tabcontent').removeClass('active'); | |
$('.tabstest .pmtab[data-tab='+ tabName + ']').addClass('active'); | |
$("#"+tabName).addClass('active'); | |
localStorage.setItem('current', tabName); | |
} | |
$(document).ready(function(){ | |
var current = localStorage.getItem('current'); | |
if(current) | |
changeTab(current); | |
$('.tabstest .pmtab').click(function(){ | |
changeTab($(this).attr('data-tab')); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment