Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  <div class="et-divi-sticky-header">
    <div class="row">
      <h1>Sticky Header with Toggle Tab</h1>
    <div class="row">
      <div class="menu">
        <a href="#">Home</a>
        <a href="#">About</a>
        <a href="#">Shop</a>
        <a href="#">Blog</a>
        <a href="#">Contact</a>
      <div class="et-divi-sticky-toggle">
        <div class="et-pb-icon">^</div>
  <div class="section">
    <h2>Scroll Down<br>v</h2>
  <script src="" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>


                * {
  box-style: border-box;
  margin: 0;
  padding: 0;
  font-family: "Lato";

div {
  display: block;

body {
  min-height: 200vh;
  background: #1a3066;

.row {
  padding: 3vh 2vw;

.menu {
  display: flex;
  align-items: center;

.menu a {
  font-size: 16px;
  font-size: clamp(13px,3vw,20px);
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.1em;
  color: #1a3066;
  padding: 0.5em 1em;

.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255,255,255,0.3);

.et-divi-sticky-toggle {
  visibility: hidden;
  opacity: 0;
  transition: all 400ms;
  position: absolute;
  bottom: 0;
  right: 20px;
  height: 45px;
  width: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0%) translateY(100%);
  background: #ffffff;
  font-size: 30px;

.et-divi-sticky-toggle:hover {
  cursor: pointer;
} {
  visibility: visible;
  opacity: 1;

.et-divi-sticky-header {
  background: #ffffff;
  position: fixed;
  top: 0;
  width: 100%;
  transition: all 400ms !important;
} {
  transform: translateX(0%) translateY(-100%) !important;

.et-divi-sticky-toggle .et-pb-icon {
  margin-bottom: 0px;
  transition: all 400ms;

.et-hide-sticky-header .et-divi-sticky-toggle .et-pb-icon {
  transform: rotateX(180deg);



                jQuery(document).ready(function ($) {
  // variables for header and toggle
  $stickyHeader = $(".et-divi-sticky-header");
  $stickyToggle = $(".et-divi-sticky-toggle");
  // attach scroll event handler function to window that
  // uses the windows scroll position (winScrollTop) and
  // the height of the header (headerHeight) to hide/show
  // toggle once the user scrolls beyond the header height.

  $(window).on("scroll", function () {
    winScrollTop = $(window).scrollTop();
    headerHeight = $stickyHeader.height();
    if (
      winScrollTop >= headerHeight &&
    ) {
    } else if (
      winScrollTop < headerHeight &&
    ) {
  // attach click event function on toggle tab that
  // toggles the "et-hide-sticky-header" class.

  $stickyToggle.on("click", function (e) {