1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, 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

jquery change size of text box when module visible

Discussion in 'Free Divi Community Forum' started by Lee Cookson, Feb 21, 2024.

  1. Lee Cookson

    Lee Cookson New Member

    Hey Folks,

    I'm working on single page portfolio site. I want to have a sidebar navigation menu, where the 'button' (I'm actually using text modules) will expand when that section becomes visible (either by scrolling, or clicking the 'button' which uses an anchor link). Screenshot 2024-02-21 171339.png

    I'm currently using a code module in the same column as the 'buttons'. I was able to achieve the desired effect with the following:
    Code:
    Log In or Sign Up to view this code.
    However, this relies on specific px distances. I want the change in height to be triggered by modules being 25% visible, so I tried to use waypoint, but it's not working:

    Code:
    Log In or Sign Up to view this code.
    Any help you can provide would be much appreciated!

    -LC
     
    1. PRO MEMBER PERKS Divi Ultimate Footer Plugin - Custom global Divi footer (20 premade styles) + Revealing footer effect:Learn More
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    What about checking the div position by using .offset().top:
    Code:
    Log In or Sign Up to view this code.
     
  3. Lee Cookson

    Lee Cookson New Member

    Thanks so much for your help! It's much appreciated. I have still have a lot to learn. I like what you've suggested here and it makes sense to me, but unfortunately it does not seem to work. Any thoughts?
     
    1. PRO MEMBER PERKS Divi Ultimate Footer Plugin - Custom global Divi footer (20 premade styles) + Revealing footer effect:Learn More