Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require([
- 'jquery',
- ], function ($) {
- $(document).ready(function(){
- var altura = $('.page-header').offset().top;
- var altura2 = $('.nav-sections').offset().top;
- $(window).on('scroll', function(){
- if ( $(window).scrollTop() > altura ){
- if($('#ticker').length() > 0) {
- $('.page-header').addClass('menu-fixed');
- } else {
- $('.page-header').addClass('menu-fixed-ticker'); // CREATE LA CLASE Y SACALE EL TOP 45px
- }
- }else {
- $('.page-header').removeClass('menu-fixed');
- }
- if ( $(window).scrollTop() > altura ){
- if($('#ticker').length() > 0) {
- $('.nav-sections').addClass('nav-fixed');
- } else {
- $('.nav-sections').addClass('nav-fixed-ticker'); //CREATE LA CLASE Y PONELE UN TOP 115PX
- }
- } else {
- $('.nav-sections').removeClass('nav-fixed');
- }
- if ( $(window).scrollTop() > altura ){
- $('.widget').addClass('widget-fixed');
- } else {
- $('.widget').removeClass('widget-fixed');
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement