1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Divi Javascript Element.height value always null

Discussion in 'Free Divi Community Forum' started by shark6991, Apr 16, 2020.

  1. shark6991

    shark6991 New Member

    Hi!
    I visit the header height in js but the value always null what i do wrong ?
    I give "header" ID the section.

    <script>
    var header = jQuery("#header").height();

    jQuery(window).scroll(function() {
    if( jQuery(window).scrollTop() > header ) {
    alert(header+" px hello");
    }
    });
    </script>
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade team carousel design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    Instead of #header, use #main-header or header