How to Add a Floating Action Menu to Divi with the Code Module

Posted on February 13, 2017 by 36 Comments

How to Add a Floating Action Menu to Divi with the Code Module
Blog / Divi Resources / How to Add a Floating Action Menu to Divi with the Code Module
Play Button

Hey Divi Nation! I’m back with another pen to share with you all that will add a Floating Action Menu to your Divi website. I’m going to show you two different ways to implement it on your site. The first is taking advantage of Divi’s Code Module, something I’m hoping to encourage more of this year, and the second is using Divi’s Theme Options.

Let’s get into it!

How to Add a Floating Action Menu to a Divi Post or Page with the Code Module

Subscribe To Our Youtube Channel

How to Add the Codepen


Here is how to add the above pen into a single post or page of your Divi website:

Fist, make sure you have created a free account and logged in. It takes less than a minute and you’re up and running. So don’t worry, it’s painless. Once you’re logged in on your own account navigate to the pen I’ve created for this tutorial, the floating action menu.

Press “command + s” to save the pen under your own account. You should see the name change under “a pen by” in the top left corner, to your name. Now that you’ve copied the pen to your account you can edit it.

In the html panel, start by locating this line of code:

<img alt="Andy Tran" src="" />

Editing this line will change the profile image. Change the alt text to your name and change the src link to your own Gravatar image. You can also use the image link of a photo you’ve uploaded to your WordPress website by navigating to your media library, editing the photo, and then copying that image’s link into the src space indicated above.

Next we’re going to change the name next to the profile image by editing this line of html:

<h2 class="at-floating-navigation__title">Andy Tran</h2>

Simply swap out “Andy Tran” for your own name.

Next, we’re going to change the link for the text, “view profile” by changing the link in this line of code:

<a href="">View Profile</a>

Once that is complete we can move on to changing the links for the menu items Settings, Help Desk, and Log Out.

<a class="at-floating-navigation__item" href="">Settings</a>
    <a class="at-floating-navigation__item" href="">Help Desk</a>
    <a class="at-floating-navigation__item" href="">Log Out</a>

For that matter, you can also change the menu items themselves by changing the words “Settings”, “Help Desk”, and “Log Out” to whatever you want.

When all of your edits have been made, hit “command + s” again to save. Then copy the page url and head over to the codepen generator I created to compile this code into a single easily paste-able block of code.


Paste the url into the url field there and click the blue “Generate” button. Right away you’ll see the code block below and the blue button will now say “Copy Code”. Click the blue button again to copy the code block to your clipboard.

We’re now ready to add the action menu we’ve created to our desired Divi post or page. Add a code module to the post or page you’d like your floating action menu to appear on. It doesn’t matter where the code module is located.


Open up the code module and paste in the code you’ve copied from the codepen generator. Save changes and update the post or page when complete.


Then, go ahead and check out the result!


How to Add a Floating Action Menu Site Wide


If you would like your new floating action menu to appear across your entire site instead of a single page or post, right-click deactivate your new code module and navigate in your WordPress Admin to Divi > Theme Options > Integration.

Paste the code you copied from the code generator into the section called “Add Code to the < head > of your blog”. Save your changes and check out the floating action menu now appearing on every page of your Divi website.

Wrapping Up

Well that’s all for this tutorial. If you have any questions about it let me know in the comments below. Likewise, if you have any requests for code module tutorials or what’s possible with the code module you can leave those too.

Divi Anniversary Sale

It's The Divi Anniversary Sale! Save Big For A Limited Time 👇

Save big on Divi and Divi products for a limited time.

Access The Sale
Divi Anniversary
Premade Layouts

Check Out These Related Posts

Get a Free Wellness Layout Pack for Divi

Get a Free Wellness Layout Pack for Divi

Posted on March 20, 2023 in Divi Resources

Hey Divi Nation! Thanks for joining us for the next installment of our weekly Divi Design Initiative; where each week, we give away a brand new Layout Pack for Divi. This time around, the design team has created a beautiful Wellness Layout Pack that’ll help you get your next Wellness website up...

View Full Post
Divi Plugin Highlight: Divi Gravity Forms

Divi Plugin Highlight: Divi Gravity Forms

Posted on March 19, 2023 in Divi Resources

Divi Gravity Forms is a plugin for the Divi Builder that allows you to customize your Gravity Form from the Divi Builder. The plugin adds a new module to the Divi Builder with options to change the design of every aspect of the form. If you are a Gravity Form user, this plugin will help integrate...

View Full Post


  1. This is awesome. Thanks divi fam!

  2. Really Nice.

  3. really nice…
    thanks 😉

  4. Thanks for sharing

  5. Awsome! I love it!

  6. Very nice, is it possible to show the menu only when scrolling down???

  7. Looks great! Will definitely try this.

  8. Lovely and very useful.

  9. Very nice – thanks for sharing this one.

  10. Nice post! I’ll try out the code module.

  11. I am trying to add this floating action menu my website but not every this I do this site does not remain Responsive. Please Help 🙁

  12. Thanks for delivering regulary great stuff!
    There are a lot of bloggers out there wich sometimes are posting good things but you are constantly showing that you are passionat about what you are doing, keep going!

  13. Very awesome!
    How can I set a different image and name for every account?
    I would like that every one can see their own information if logged in, or if logged out a simple “login button”

  14. Thanks Andy


  15. I tried creating my own and also tried just copying your original and can’t get it to work in any browser. Does it only work for Gavatar Profiles? Is there a delay before it pops up? Does it require scrolling down the page?. Is there a setting to control when it pops up or if it always pops up? Does is require a browser to allow popups?

    • Your test works for me Robert?

  16. awesome thx dude

  17. How cool is that? Will need to give this a go.
    Thanks 🙂

    • Very awsome! I love it!

  18. Cool feature, thanks for sharing! 🙂

  19. Hide the menu, but the links are still on the page, even if hidden.

  20. Love it!! I have moved it to the top but I can’t succeed in have the box open downwards. Anybody have any ideas?

    • Hi Steffen,
      try to modifing the snippet:
      .at-floating-navigation__menu {
      transform: translateY(-10px);
      opacity: 1;

      to this:
      .at-floating-navigation__menu {
      transform: translateY(320px); /* custom as you want */
      opacity: 1;

      See You,

  21. Looking nice! I have to understand the code session!

  22. Beautiful…
    I just added some modifies of your code, Andy.

    1- Now, when you close the “Module” the links are hiding.
    – The code to modify

    &__menu {

    /* Add this */
    display: none;

    .at-floating-navigation__menu {

    /* Add this */
    display: block;

    2- Some Hover effects, on the list of Items and Button.
    – The code

    /* Add this */
    &__item:hover{ color: #CE3532; }
    &__button:hover{ color: #CE3532; }

    3- You can Removethe js code:


    CodePen Link at:

    Thank you for sharing,

    • This was awesome! thanks so much for sharing, would anyone know how to modify the code so the floating action menu starts in the open window position?

  23. Cool!
    How do we change the color of the floating circle? I’m guessing we need to add some CSS to the main element?

  24. Love it!

  25. Cool! Thanks for this! – I’d also like to know what you use to create your animated GIF’s for your post image 🙂

  26. The best investment of my life… i have a major crush on Divi! Thanks guys for all the hard work.

  27. That is really great, thank you so much!!

    How can I make the menu to be open by default though..?

  28. The CodePen Code Module Generator doesn’t seem to be working.

  29. Hi, where is de code module now?…

  30. Can make menu drop like that ?

  31. This is great 🙂 Now if we want to make this a modal pop up? Next tutorial maybe? Or can someone help please?

Leave A Reply

Comments are reviewed and must adhere to our comments policy.

👋 It's The Divi
Anniversary Sale!
Get The Deal
Before It's Gone!
Join To Download Today