Menu link to section not working
-
Following the instructions on the customize sidebar in Home Landing Page Section, I made a custom menu link to #section1 — however, it is not functioning at all when I click the menu, and will only open if I right click and open link in a new tab. Any help is appreciated!
-
Can you share website URL?
My url is http://dev-annualreport-wgbh.pantheon.io/chapter-1/
I have the menu for “Contents” linked to #section1, which should open to this page where is says “Link here”: http://dev-annualreport-wgbh.pantheon.io
I have previously been playing with just linking to an a name in my html, but neither has yielded any results so far. Any insight is appreciated, thanks!!
Actually now it’s linking to the chapter 1 page instead of “section 1” on the first page — I’ll revert it back to my a-name link so you can see what I was ideally hoping for
Hey beth_a_a,
The problem is in ../fullscreen-lite-child/js/custom_script.js file actually the code should be as follow
jQuery( ".toggleButton" ).click(function() { jQuery( ".storyOneExpanded" ).slideToggle( "slow" ); });and enqueue your script in the footer at this time your script is coming even before the core jQuery file loads. You can do so in child theme’s functions.php
function fullscreen_lite_child_enqueue(){ wp_enqueue_script('fullscreen-lite-child-custom-js',get_stylesheet_directory_uri().'/js/custom_script.js', array('jquery'), '1.0', true); } add_action('wp_enqueue_scripts', 'fullscreen_lite_child_enqueue');Let me know if it doesn’t works or mark ticket resolved otherwise.
Regards,
Tanay KhandelwalHi Tanay,
Thanks for the help!
This didn’t seem to affect the issue that I’m having — the jquery code that you fixed for me (thank you btw!) is for something that I haven’t built out yet, but I’m appreciative that your fix has made sure that it wasn’t part of the problem!
What’s mystifying me the most is that the “contents” link will open correctly if right clicked and opened in a new tab — but won’t open otherwise.
The topic ‘Menu link to section not working’ is closed to new replies.
