-
AuthorPosts
-
July 20, 2015 at 3:43 pm #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
July 20, 2015 at 7:35 pm #476055Hey 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,
ElliottJuly 21, 2015 at 7:03 am #476318Hey 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.
July 21, 2015 at 3:50 pm #476573Hey!
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,
ElliottJuly 22, 2015 at 5:11 am #476846Thanks 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
July 22, 2015 at 8:42 pm #477329Hi!
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!
ElliottJuly 30, 2015 at 7:14 am #480538Hi 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!
July 31, 2015 at 5:40 pm #481492Hi!
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,
ElliottAugust 3, 2015 at 6:04 am #481875Hi 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
August 4, 2015 at 2:54 pm #482717Hey!
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 -
AuthorPosts
- You must be logged in to reply to this topic.