Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(window).scroll(function() {
- var windscroll = $(window).scrollTop();
- if (windscroll >= 100) {
- $('.scrollMe').each(function(i) {
- if ($(this).position().top <= windscroll - 20) {
- $('sidebar-nav a.active').removeClass('active');
- $('sidebar-nav a').eq(i).addClass('active');
- }
- });
- } else {
- $('sidebar-nav').removeClass('fixed');
- $('sidebar-nav a.active').removeClass('active');
- $('sidebar-nav a:first').addClass('active');
- }
- }).scroll();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement