Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #475884

    Hi there,

    I would like to change the style of a selected ID tag. When an anchor tag is selected with an ID, the page scrolls to the corresponding ID section. This is a great feature, and I would like to make changes to the style of the selected ID tag in order to indicate that it is selected and/or the section is being viewed.

    I pasted a link to the page I’m working on with this feature I want to implement in the private content. The green texts to the side with the checkmarks contain ID tags.

    Thanks

    #476055

    Hey cthai!

    Your talking about the custom buttons you have setup on the left it looks like. There wouldn’t be a point for this because they do not scroll down with the page.

    I haven’t tested it out but you could try adding them to line 81 in the /enfold/js/avia.js file. That is the script we use for the main menu.

    Regards,
    Elliott

    #476318

    Hey Elliot,

    I was able to get the left side column stick to the top when the page scrolls down. Now I am following your instruction about the avia.js file. I pasted a link to the screenshot I took of what I see on line 81. I also want to mention that the ID tags are not menus, but coded HTML links that I added in avia builder. Will adjusting the main menu on line 81 have an affect on these links? On the other hand, having the main menu selected on a certain page is also beneficial and something I had noticed.

    Thanks

    • This reply was modified 9 years, 4 months ago by cthai.
    #476573

    Hey!

    It looks like it worked. Good job. :)

    You could just add a new line beneath it like so to target your custom links.

    $('body').avia_scrollspy({target:'.main_menu .menu li > a'});
    $('body').avia_scrollspy({target:'.customLinks'});
    

    Best regards,
    Elliott

    #476846

    Thanks Elliot, I am unsure how these lines work and what their function is. I’m also unsure how they relate with allowing us to style a selected Target ID. Could you please explain?

    Thank you

    #477329

    Hi!

    They are adding certain links to the “scrollspy” script we have included with the theme. When these links are clicked on they will do a “smooth scroll” to the anchors and also highlight the link, etc etc.

    For the example in my previous post you could just add a class of “customLinks” to each link you want to use scrollspy with.

    Cheers!
    Elliott

    #480538

    Hi Elliot, thank you for the explanation. I am still unsure how this “scrollspy” script relates to each link, so I do not know how to work and implement it. Also not sure if this affects what we’re trying to do, but I am using another plugin for sticky side column, called “Sticky Menu (or Anything!) on Scroll”. Perhaps a step by step instruction would be helpful, though I’m sure this is something really simple that I’m not understanding.

    I pasted the URL of the page I’m working on in the private content area.

    Thanks!

    #481492

    Hi!

    When I click on the links it scrolls to the correct area in a smooth manner so it appears to be working. It’s not doing it on your end?

    Best regards,
    Elliott

    #481875

    Hi Elliot, the scrolling works smoothly, and I am trying to add a background color change to the link that is selected. Could I target it with CSS somehow?

    Thanks

    #482717

    Hey!

    Maybe something like this in the bottom of your functions.php file.

    add_action( 'wp_head', 'enfold_customization_header_scripts' );
    function enfold_customization_header_scripts() {
    ?>
    <script type = "text/javascript">
    jQuery('.steps a').click(function(){
    jQuery('.steps a').removeClass('active');
    jQuery(this).addClass('active');
    });
    </script>
    <?php
    }
    

    Cheers!
    Elliott

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.