Divi Builder Error Cannot Read Property 'removeclass' of Undefined

When you're designing a fixed global header, you lot might want to shrink the header'due south height when your visitors are scrolling. It helps reduce the space the global header takes up in your visitors' viewport height. In this tutorial, we'll guide yous through that process. Nosotros'll first by edifice the menu, so we'll add some JQuery and CSS code to trigger the event. You lot'll be able to download the JSON file for complimentary likewise!

Permit'due south get to it.

Preview

Before we swoop into the tutorial, let's take a quick look at the outcome across unlike screen sizes.

Desktop

shrink global header height

Mobile

shrink global header height

Download The Global Header Template for Free

To lay your hands on the free global header template, you volition first demand to download it using the push beneath. To gain access to the download yous will demand to subscribe to our Divi Daily email list by using the form below. As a new subscriber, you will receive even more Divi goodness and a free Divi Layout pack every Monday! If you're already on the listing, simply enter your email accost below and click download. You will not be "resubscribed" or receive extra emails.

Yous have successfully subscribed. Delight bank check your email address to ostend your subscription and get access to gratis weekly Divi layout packs!

Subscribe To Our Youtube Channel

1. Go to Divi Theme Builder & Add New Template

Go to Divi Theme Architect

Kickoff by going to the Divi Theme Builder.

shrink global header height

Commencement Edifice Global Header

Then, click on 'Build Global Header' and select 'Build Global Header'.

shrink global header height

2. Start Building Global Header

Department Settings

Background Color

Once you're inside the template editor, you'll notice a section. Open the department and modify the background color into white.

  • Background Color: #FFFFFF

shrink global header height

Sizing

Move on to the module'due south design tab and change the width.

  • Width: 100%

shrink global header height

Spacing

Alter the department's top and lesser padding also.

  • Elevation Padding: 2vw
  • Bottom Padding: 2vw

shrink global header height

Box Shadow

And carve up the folio content from the global header past adding a subtle box shadow to the section next.

  • Box Shadow Blur Strength: 50px
  • Shadow Colour: rgba(0,0,0,0.13)

shrink global header height

CSS ID

And then, add a CSS ID to the section. After on the tutorial, we'll apply this CSS ID to create the shrinking global header effect on scroll.

  • CSS ID: department-padding

shrink global header height

Main Chemical element

Motility on to the advanced tab, go to the Custom CSS settings and brand the department stock-still past adding two lines of CSS code to the section'due south master chemical element.

position: fixed; height: 0;

shrink global header height

Z Index

To brand sure the section remains on tiptop of all folio and post content, we'll increment the section's z alphabetize too.

  • Z Index: 99999

shrink global header height

Add New Row

Cavalcade Construction

Once you've completed the column settings, go on by adding a new row using the following column structure:

shrink global header height

Sizing

Without adding whatever modules nonetheless, open up the row settings and modify the sizing appropriately:

  • Use Custom Gutter Width: Yeah
  • Gutter Width: 1
  • Equalize Column Heights: Yes
  • Max Width: 100%

shrink global header height

Spacing

Remove the row's default acme and bottom padding next.

  • Top Padding: 0px
  • Bottom Padding: 0px

shrink global header height

CSS ID

So, get to the avant-garde tab and add a CSS ID to the row. We'll demand this CSS ID afterwards on the tutorial to brand the shrinking effect work.

  • CSS ID: row-width

shrink global header height

Master Chemical element

Last but not least, to brand certain all columns remain next to each other on smaller screen sizes, and to center all column content, we'll add 2 lines of CSS code to the row's main element.

display: flex; align-items: center;

shrink global header height

Add together Image Module to Column one

Upload Logo

Fourth dimension to add together modules, starting with an Image Module in column 1. Upload a logo with a transparent background.

shrink global header height

Sizing

Change the module's width next.

  • Width: 5vw (Desktop), 9vw (Tablet), 13vw (Phone)

shrink global header height

Add Menu Module to Cavalcade 2

Select Menu

Motility on to the second cavalcade and insert a Menu Module. Select a menu of your option.

shrink global header height

Remove Background Color

Remove the module's background colour next.

shrink global header height

Layout

Move on to the module's design tab and change the layout as well.

  • Style: Centered
  • Dropdown Menu Direction: Downwardly

shrink global header height

Menu Text

Then, open up the menu text settings and make some changes.

  • Menu Font: Rubik
  • Carte du jour Text Colour: #000000
  • Bill of fare Text Size: 0.9vw (Desktop), 2vw (Tablet), 3vw (Phone)

shrink global header height

Dropdown Menu

Change the dropdown carte du jour settings too.

  • Dropdown Menu Background Color: #ffffff
  • Dropdown Menu Line Color: #2970fa

shrink global header height

Icons

And complete the module's settings by changing the hamburger carte du jour icon color in the icons settings.

  • Hamburger Menu Icon Color: #2970fa

shrink global header height

Add Push Module to Cavalcade 3

Add Copy

On to the side by side and last column. Add a Push Module with some copy of your choice.

shrink global header height

Alignment

Change the module's alignment next.

  • Button Alignment: Correct

shrink global header height

Push Settings

Fashion the button accordingly:

  • Utilize Custom Styles For Button: Yes
  • Button Text Size: 0.8vw (Desktop), 1.5vw (Tablet), 2vw (Phone)
  • Button Text Color: #ffffff
  • Button Groundwork Colour: #2970fa
  • Push Border Width: 0px

shrink global header height

  • Button Edge Radius: 0px
  • Button Letter Spacing: 1px
  • Push Font: Rubik
  • Button Font Fashion: Uppercase

shrink global header height

Spacing

And add some custom padding values across different screen sizes.

  • Peak Padding: 0.8vw (Desktop), one.8vw (Tablet), 2.5vw (Telephone)
  • Bottom Padding: 0.8vw (Desktop), ane.8vw (Tablet), ii.5vw (Phone)
  • Left Padding: ane.5vw (Desktop), 3vw (Tablet), 4vw (Telephone)
  • Correct Padding: ane.5vw (Desktop), 3vw (Tablet), 4vw (Phone)

shrink global header height

Box Shadow

Consummate the module's settings past adding a subtle box shadow.

  • Box Shadow Vertical Position: 20px
  • Box Shadow Blur Strength: 30px
  • Shadow Color: rgba(41,112,250,0.2)

shrink global header height

Add together Code Module to Column 2

Insert JQuery & CSS Lawmaking

The next and last part of this tutorial handles the shrinking effect, using the two CSS IDs we've assigned to our department and row. Add a Code Module to column ii with the following lines of JQuery and CSS lawmaking. Make sure you put the JQuery code between script tags and the CSS code between style tags.

jQuery(function($){   $(window).scroll(function() {       if ($(document).scrollTop() > 50) {         $('#section-padding').addClass('reduce-section-padding');         $('#row-width').addClass('increase-row-width');     } else {        $('#section-padding').removeClass('reduce-section-padding');        $('#department-padding').addClass('slow-transition');        $('#row-width').removeClass('increase-row-width');        $('#row-width').addClass('slow-transition');     }   }); });
.reduce-section-padding { transition: all 0.9s ease-out 0s; padding-top: 0px !important; padding-bottom: 0px !important; }  .increment-row-width { transition: all 0.9s ease-out 0s; width: 100% !important; }  .slow-transition { transition: all 0.9s ease-out 0s; }  #main-content { margin-top: 5vw; }

shrink global header height

three. Save Builder Changes & View Effect

Once you've added the code, you can save all the changes y'all've fabricated to the global header and view the outcome on your website!

shrink global header height

shrink global header height

Preview

Now that we've gone through all the steps, let'due south take a concluding look at the outcome across dissimilar screen sizes.

Desktop

shrink global header height

Mobile

shrink global header height

Final Thoughts

In this post, nosotros've shown you how to create a shrinking global header using Divi'southward Theme Builder. Shrinking headers are a bully way to save space on your company'due south viewport acme. We've recreated the design from scratch and added some custom custom code to trigger the shrinking effect. You were able to download the JSON file for gratuitous as well! If yous accept whatsoever questions or suggestions, feel costless to leave a comment in the comment department below!

If y'all're eager to larn more about Divi and get more Divi freebies, brand sure you subscribe to our email newsletter and YouTube channel so you'll always be one of the first people to know and become benefits from this free content.

garciacluat1982.blogspot.com

Source: https://www.elegantthemes.com/blog/divi-resources/how-to-shrink-your-global-headers-size-when-scrolling-with-divis-theme-builder

0 Response to "Divi Builder Error Cannot Read Property 'removeclass' of Undefined"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel