Created
July 15, 2016 06:03
-
-
Save webdawe/c42855877ab4361d82e9974a8a36b675 to your computer and use it in GitHub Desktop.
Webdawe Tabs
This file contains 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
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