Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $(document).ready(function() {
- function customHeaderFixed(){
- $waypoint_selector = $('#main-content');
- $introDesktopHeight = $('.intro-desktop').height();
- $adminBar = $('#wpadminbar');
- if ($adminBar.length) {
- $introDesktopHeight = $introDesktopHeight - $adminBar.height();
- }
- $fullWidthMenu = $('.main_menu');
- $waypoint_selector.waypoint( {
- handler : function( direction ) {
- if ( direction === 'down' ) {
- $fullWidthMenu.addClass( 'wpc-fixed-menu' );
- $('body').addClass('wpc-scrolled');
- $('#about').css('padding-top', ($fullWidthMenu.height() + $adminBar.height() - 20));
- if ( $(window).width() <= 980 ) {
- $('#about').css('padding-top', ($fullWidthMenu.height() + $adminBar.height() - 20));
- $('#joinus').css('padding-top', ($fullWidthMenu.height() + $adminBar.height()));
- $('#visitus').css('padding-top', ($fullWidthMenu.height() + $adminBar.height()));
- $('#contactus').css('padding-top', ($fullWidthMenu.height() + $adminBar.height()));
- }
- } else {
- $fullWidthMenu.removeClass( 'wpc-fixed-menu' );
- $('body').removeClass('wpc-scrolled');
- $('#about').css('padding-top', 20);
- }
- },
- offset: -$introDesktopHeight
- } );
- }
- setTimeout(customHeaderFixed, 100);
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment