Adjust the placement of the fixed header waypoint or change its offset

Currently working on developing a Wordpress site with the Avada theme, my goal is to have a sticky header that starts immediately at the top of the page.

This is the website in progress:

The site I'm trying to emulate is synergymaids.com.

If you visit the second site, you'll notice that the "sticky header" kicks in right away. After some research, I discovered that this behavior is controlled by a section in the main.js file. Despite experimenting with various numbers, I haven't been able to adjust the height at which it activates.

Below is the relevant portion of the main.js file. It seems that modifying some CSS is also necessary, so here's a link to the CSS file: http://pastebin.com/pd3MUCLh

Any assistance regarding this issue would be greatly appreciated.

// init sticky header
jQuery.fn.init_sticky_header = function() {

    var sticky_mobile_menu_padding;

    var sticky_header_height = 65;
    var sticky_top = jQuery('.sticky-header').css('top');
    var sticky_start = sticky_top.replace('','') + 50;
    var logo = '.sticky-header .logo img.normal_logo';
    var not_logo = '.sticky-header .logo img.retina_logo';
    var orig_logo_height, orig_logo_width, logo_max_width, width_ratio, calc_width, calc_height,
        logo_height, logo_line_height, logo_width, logo_margin_top  = 0;

    var anchor_scrolling = 0;
    jQuery('.sticky-header').css('top', sticky_start+'px');
    jQuery('.init-sticky-header').waypoint(function(direction) {
        if(direction === "down") {
            ...
            
         }
    });
};

Answer №1

I undertook the challenge of designing a persistent fixed header for the Avada theme from scratch. It required some intricate css work, but I managed to pull it off successfully. If you're curious to see how I did it, check out the link provided below: https://github.com/mgp271/Avada-Theme-Fixed-Header

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Reverse lookup and deletion using Mongoose

Currently, I am attempting to perform a health check on the references within one of my collections. The goal is to verify if objects being referenced still exist, and if not, remove that particular _id from the array. Despite my efforts, I have not come ...

Setting up a specific print media query for the body element through JavaScript

I'm facing an issue with my web page that has a bootstrap modal which pops up when a button is clicked. I've added a print media query to print the content of the modal, but it's causing a problem. When I include the media query in the CSS, ...

Getting React Developer Tools to Function with Webpack

I recently followed a tutorial on how to expose React as a global variable in Webpack using the Expose module. Despite installing the Expose module and adding the appropriate loader configuration in the webpack.config.js file, I am still unable to access R ...

Display a persistent bar on the page until the user reaches a specified <div> element through scrolling

Looking to implement a sticky bar at the bottom of my page that fades out once the user scrolls to a specific div and then fades back in when scrolling up and the div is out of view. This bar should only appear if the user's screen size is not large ...

Compatibility discrepancies for object-fit: cover as per observations from Mozilla and caniuse

I'm curious about the browsers that support the CSS property object-fit: cover. My usual sources for checking compatibility are the Mozilla browser compatibility table and caniuse, but they sometimes provide conflicting information. For example, while ...

The local copy of Jquery.min.js is failing to trigger the window load function

Recently, I encountered an issue with the focus of tabs while working with jQuery. Initially, everything was fine when I included: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> in my JSP file. The wi ...

The Socket.io client establishes connections with multiple servers simultaneously

Imagine this scenario: I am using nodejs and socket.io, and a question comes to mind. What would happen if one client establishes connections with multiple servers like this: socket = io.connect('http://server1') //600k sockets already connecte ...

Having difficulty transferring navigation props between screens using react-navigation

Within my ContactList component, I have utilized a map to render various items. Each item includes a thumbnail and the desired functionality is that upon clicking on the thumbnail, the user should be directed to a new screen referred to as UserDetailsScree ...

What could be causing Jquery to malfunction with the CssClass Property of asp.net textboxes?

I need assistance with validating textboxes to only accept alphabets in an ASP.NET page using jQuery. Below is the code snippet: <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/j ...

Changing the Values of Variables in an npm Package within SvelteKit

I have been working on a SvelteKit component library where I define variables for components like background-color and font-family in a CSS file. Inside the ./dist/index.js file of my library, I export the CSS using `import './main.css'`. When in ...

Arrange TD's from various TR's underneath each other in a stack

Imagine we have a table that needs to be made responsive. <table> <tr> <td>Dog Image</td> <td>Cat Image</td> </tr> <tr> <td>Dog Text</td> <td>Cat Text</td> & ...

Receiving a Javascript Promise from a $.ajax request

Trying to convert a $.ajax() statement into an es6 Promise and return it as an es6 promise. The goal is to have an application layer with Create, Update, Delete calls to the Microsoft Dynamics Web API that return an es6 Promise for reuse across multiple pa ...

Learn how to assign an ID to a React component in order to access it using the document.getElementById() method

After going through multiple inquiries, my understanding led me to believe that simply setting the id as shown below would suffice: <MyComponent id="myId"/> However, upon invoking document.getElementById() on the specified id, I receive a null resu ...

Iterating through elements to set the width of a container

I am currently working on a function that dynamically adjusts the width of an element using JavaScript. Here is my JavaScript code: <script> $('.progress-fill span').each(function(){ var percent = $(this).html(); if(per ...

Is there a potential white-space issue with jQuery CSS in Internet Explorer versions 7 and 8

Recently, we encountered an unusual issue with jQuery and CSS while working on compatibility with IE7 and IE8. Our project involves animations and height measurements, and during the animations, we wanted to prevent text from wrapping. To achieve this, we ...

Is the xmlhttprequest timeout/abort feature not functioning as anticipated?

Check out this snippet of my AJAX function: /** * This function initiates an AJAX request * * @param url The URL to call (located in the /ajax/ directory) * @param data The data to send (will be serialized with JSON) * @param callback The fu ...

How can you deactivate the vue-router for specific routes? Is it possible to operate a single-page application backend while utilizing a non-single-page

I'm currently working on a website/webapp using Laravel 5.3 and Vue 2. Since SEO is crucial, I've decided to keep the frontend/crawlable part of the site in Laravel + Blade, with only minimal sections in Vue 2.0. This way, I can avoid using Ajax ...

What sets apart .js and .ts files in the development of a Selenium Protractor framework?

As a newcomer to Selenium Protractor, I noticed that many tutorial videos on YouTube utilize .js files for test scripts. However, the framework in my current project utilizes .ts files instead. I am seeking assistance in comprehending the variances betwe ...

Deleting an element from HTML using jQuery

In the midst of creating a system that allows users to construct their own navigation structure, I have encountered a stumbling block. The idea is that when a user lands on the site, they are presented with a list of available topics from which they can ch ...

The command `sequelize.sync({force:true}) is running into issues and the log output is coming up empty

I encountered a multitude of questions while working on this particular issue. None of them seemed to have the same problem, and after 20 straight hours of trying to solve it, I'm feeling quite stressed. So, I apologize if I missed a similar issue. Th ...