• I’ve currently got a one-page WP site with a menu that scrolls to each section defined by it’s corresponding anchor tag. I’m having trouble changing the style of each specific menu item when clicking on or scrolling through that section, and would also like to have a static text box that changes content based on the section in view.

    Any help would be greatly appreciated ??

    Cheers,
    Sam

Viewing 5 replies - 1 through 5 (of 5 total)
  • your sites url please

    Thread Starter samomatt

    (@samomatt)

    Ah sorry it’s not a live site so don’t have a URL :/

    I pretty much just have a normal menu with the link pointing to their corresponding anchor tags e.g #about, #features, #contact etc, and next to the menu I have a div with the ID “quote”, and want the contents of quote to change when passing through each section.

    Hopefully that’s of any help

    Thanks

    Thread Starter samomatt

    (@samomatt)

    I should also mention the sections are individual posts looped together, so I was thinking if I had a custom field called ‘quote’ for each post I could somehow tell the DIV to display the input from each post when that anchor has been reached?

    Thread Starter samomatt

    (@samomatt)

    I’ve found this which is exactly what I’m after in terms of the quote box, but have no idea how to implement it to my site.

    https://jsfiddle.net/Nsubt/

    In my header.php I have this and want the content from <?php the_field(‘quote’); ?> from each individual post to come up in the quote div when that post is on screen.

    <div class="quote"></div>
    
    <nav>
    <?php html5blank_nav(); ?>
    </nav>
    • This reply was modified 7 years, 3 months ago by samomatt.
    Thread Starter samomatt

    (@samomatt)

    figure if I can work that out then changing the menu style should be kinda similar

    • This reply was modified 7 years, 3 months ago by samomatt.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change Style and Content by Anchor Div’ is closed to new replies.