Skip to content

Instantly share code, notes, and snippets.

@webdawe
Created July 15, 2016 06:03
Show Gist options
  • Save webdawe/c42855877ab4361d82e9974a8a36b675 to your computer and use it in GitHub Desktop.
Save webdawe/c42855877ab4361d82e9974a8a36b675 to your computer and use it in GitHub Desktop.
Webdawe Tabs
jQuery(document).ready(
function($)
{
$('.webdawe-tabs-link').click(
function()
{
//console.log($(this).attr('data-link'));
$('.webdawe-content-wrap').find('section' + '#' + $(this).attr('data-link')).addClass('content-current');
$('.webdawe-content-wrap').find('section' + '#' + $(this).attr('data-link')).siblings().removeClass('content-current');
$(this).parent().addClass('tab-current');
$(this).parent().siblings().removeClass('tab-current');
if($(document).width()< 769)
{
$('html, body').animate({
scrollTop: $('section' + '#' + $(this).attr('data-link')).offset().top
}, 2000);
}
return false;
}
);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment