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

Posted on February 13, 2017 by in Divi Resources | 36 comments

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

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.


  1. This is awesome. Thanks divi fam!

  2. Really Nice.

  3. really nice…
    thanks 😉

  4. Awsome! I love it!

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

  6. Lovely and very useful.

  7. Very nice – thanks for sharing this one.

  8. 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 🙁

  9. 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!

  10. 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”

  11. Thanks Andy


  12. 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?

  13. awesome thx dude

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

    • Very awsome! I love it!

  15. Cool feature, thanks for sharing! 🙂

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

  17. 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,

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

  19. 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?

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

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

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

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

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

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

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

  26. Can make menu drop like that ?

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

488,929 Customers Are Already Building Amazing Websites With Divi. Join The Most Empowered WordPress Community On The Web

We offer a 30 Day Money Back Guarantee, so joining is Risk-Free!

Sign Up Today

Pin It on Pinterest