Tagged: enfold, fullwidth submenu
-
AuthorPosts
-
February 10, 2020 at 1:23 pm #1183032
I have an issue with the ENFOLD submenu element. On mobile, this element does not stick and floats over the copy when I scroll. This blocks the content. It is sticky when I am on a tablet or desktop.
My client wants to have the submenu stick just below the full-width slider image of all main menu pages: ADMISSION, ACADEMICS, FAITH, CAMPUS LIFE and GIVING.
If this is not possible, can I block the submenu on mobile and create something else to perform the same function at the top of these pages?
Thanks,
TamiFebruary 10, 2020 at 8:05 pm #1183209Hey Tami,
Could you please attach a mockup of what you’re trying to achieve?
You are using another menu plugin, not the Enfold’s menus. You might check the plugins docs on how to adjust it.
Best regards,
VictoriaFebruary 10, 2020 at 10:43 pm #1183294Here is the Enfold Fullwidth Submenu
- element on our GIVING page, mobile view. When I click from the Max Mega Menu into the page, the Fullwidth Submenu element is directly below the header image. I want it to stay there even after I scroll down the page.
Currently the Fullwidth Submenu element is moving down the page as I scroll. And if I click any of the links on this element it positions itself on top of the content that the viewer should be seeing, rather than just above the content that the viewer wants to see.
Here’s a video of the issue.
Fullwidth Submenu Mobile is NOT StickyFebruary 11, 2020 at 2:50 pm #1183517Hi ndaeagles,
Best regards,
VictoriaFebruary 11, 2020 at 3:55 pm #1183560The site is functioning now. Please retry.
February 11, 2020 at 9:46 pm #1183674Hi ndaeagles,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
@media only screen and (max-width: 767px) { #top .av-submenu-container.av-sticky-submenu { position: relative !important; } }
If you need further assistance please let us know.
Best regards,
VictoriaFebruary 12, 2020 at 3:43 am #1183730I tested this code on Android Samsung S7, Samsung S9+, iPhone 6s, version13.3.1, and a new iPhone 11.
– The iPhone 11 had the menu at the top of the page and it did not float over the page content. The iPhone 6 worked in the same way except for the GIVING page. On the GIVING page the menu floated over the content.
– The Samsungs had the menu at the top.
On all phones
– When scrolling from the top of the pages (Admissions, Academics, Faith, Campus Life, GIving) the fullwidth submenu jumps down about 50 pixels to the bottom of the blue area that is behind/below the Fullwidth Submenu. Please see video link.
General Question: Does this type of code change require me to toggle the Performance/Compression settings?
February 12, 2020 at 8:46 pm #1183991This is much closer to where I need it to be. To re-state my description of remaining issues …
On all phones
– When scrolling from the top of the pages (Admissions, Academics, Faith, Campus Life, Giving) the fullwidth submenu JUMPS DOWN about 50 pixels to the bottom of the blue area that is behind/below the Fullwidth Submenu. Please see video link provided above.1. What is making the fullwidth submenu element jump down?
2. What is this blue area? That should not be there.
February 13, 2020 at 4:31 pm #1184201Please advise on the jump and the blue area, as noted above. Thank you Victoria for assisting me with this.
I adopted this website when the client severed ties with the developer. I am new to Enfold and not a coder so I am very appreciative of your coding skills.February 16, 2020 at 2:08 am #1184899Hi,
Sorry for the late reply, I have taken a look at your “giving” page on both desktop and mobile. The fullwidth sub-menu is not designed to be sticky for mobile, that’s why it’s disabled by default. There have been modifications to try to achieve this and is why you are getting the jumping and it is breaking away from the “sticky_placeholder” the “blue area”.
I tried recreating your page and found that without modifications the sub-menu can stick to the top with this javascript at the end of your functions.php file in Appearance > Editor:function custom_script(){ ?> <script> (function($){ $(document).ready(function(){ var scroll_start = 0; var startchange = $('#sub_menu1'); var offset = startchange.offset(); if (startchange.length){ $(document).scroll(function() { scroll_start = $(this).scrollTop(); if(scroll_start > offset.top) { document.getElementById('sub_menu1').classList.add('sticky-top'); } else { document.getElementById('sub_menu1').classList.remove('sticky-top'); } }); } }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
and this css:
.sticky-top { position:fixed!important; top:0!important; z-index:10000!important; }
please see the screencast in the Private Content area.
I’m not sure where the modifications are on your site, but if you can remove them then this should work for you on Enfold v4.7.3
It looks like you are using v4.5.7, so that could be another factor.Best regards,
MikeFebruary 17, 2020 at 8:32 am #1185124Thank you Mike. I’m going to get back to this in a day or two. I am not the original developer and am not a strong coder so I do not have confidence that I can remove the customization without fouling the good stuff.
February 17, 2020 at 12:29 pm #1185186Hi,
We will leave this open while you look into this. A couple of places to look would be if your child theme has a /shortcodes/menu/ folder in it, you could rename to something else via FTP as a test, “/menu-old/”
and if your custom css has any reference to “sticky_placeholder” or “sub_menu1”, you could comment out to test.
Also check your child theme functions.php.Best regards,
MikeFebruary 17, 2020 at 4:48 pm #1185284Mike,
I have seen other tickets where you have provided support. Your instructions are so clear and it means the world to users. THANK YOU!
TamiFebruary 18, 2020 at 4:49 am #1185520Hi Tami,
Thanks for the kind feedback, I have passed it on to Mike :-)
Best regards,
RikardFebruary 24, 2020 at 8:43 pm #1187493Do you recommend editing the code within the WP framework? Another site designer/coder indicated that “The theme editor can have trouble updating active theme files in some server environments” and recommended uploading the code changes using FTP.
February 25, 2020 at 11:28 am #1187649Hi,
There are some cases where editing files in WordPress > Appearance > Editor returns an error where it says “please use FTP” This is a safety tool, and in such case please use FTP.Best regards,
MikeOctober 4, 2020 at 4:28 pm #1250417so will this work to make the full width menu sticky on mobile?
if not is there a way to hide this menu on mobile?October 4, 2020 at 9:58 pm #1250497Hi,
To hide the sub-menu on mobile please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:@media only screen and (max-width: 767px) { #sub_menu1 { display:none !important; } }
After applying the css, please clear your browser cache and check.
Best regards,
MikeOctober 4, 2020 at 11:55 pm #1250503That worked great, Thank you!
I did have an issue
I tried to add your code above to my php file and also the css to try and get the sub menu to be sticky on mobile.
It did not work
When I removed that code from he PHP file and the css it broke my down arrows throughout the sitePHP:
function custom_script(){
?>
<script>
(function($){
$(document).ready(function(){
var scroll_start = 0;
var startchange = $(‘#sub_menu1’);
var offset = startchange.offset();
if (startchange.length){
$(document).scroll(function() {
scroll_start = $(this).scrollTop();
if(scroll_start > offset.top) {
document.getElementById(‘sub_menu1’).classList.add(‘sticky-top’);
} else {
document.getElementById(‘sub_menu1’).classList.remove(‘sticky-top’);
}
});
}
});
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘custom_script’);CSS:
.sticky-top {
position:fixed!important;
top:0!important;
z-index:10000!important;
}October 5, 2020 at 12:25 pm #1250575Hi,
I see that you are using Enfold v4.4.1, please update to v4.7.6.3Best regards,
MikeOctober 5, 2020 at 9:36 pm #1250652Thanks Mike!
October 6, 2020 at 7:05 am #1250718Hey mnydish,
I’m glad this was resolved for you.
Best regards,
Jordan Shannon -
AuthorPosts
- You must be logged in to reply to this topic.