Stop Divi Theme Header Shrinking On Scroll

Codemazon | Stop Divi Theme Header Shrinking On Scroll

The default DIVI THEME header has an effect like if we scroll down the header gets shrinked. Developers spent much of their time to fix or remove this shrinking effect. So, I just found a fix for the same and I am going to share it in this article. Please follow the below steps and if you follow the steps correctly you will see that the scrolling effects gets fixed or remove

Here are the steps starts :

  1. Go to plugins, Download and activate this plugin : Custom CSS & JS
  2. Create a new js file, name it of your choice
  3. Write this jQuery code snippet to the js file :

jQuery(document).ready(function( $ ){
(function(){
// Override the addClass to prevent fixed header class from being added
var addclass = jQuery.fn.addClass;
jQuery.fn.addClass = function(){
var result = addclass.apply(this, arguments);
jQuery(‘#main-header’).removeClass(‘et-fixed-header’);
return result;
}
})();
jQuery(function($){
$(‘#main-header’).removeClass(‘et-fixed-header’);
});
});

  1. Click on the Update button and save the file.
  2. Now when you scroll down you will see that the shrinking header effect gets removed. THANKS HAPPY CODING !! …
By admin

Leave a Reply

Your email address will not be published. Required fields are marked *