-
AuthorPosts
-
February 20, 2019 at 5:49 pm #1069577
Hi @Mike,
following the beginning of our discussion, I’ve started a separate thread.My website is http://www.newpointdeview.com/blog-en/. For the moment I’ve /*suspended*/ your css code in the Quick CSS, but kept the script in the functions.php. So the code does work, but there are some adjustments I can’t do on my own:
1. The breadcrumb went to the top : picture
2. The header (without topbar) remains sticky in the middle of the screen : picture
3. And is it possible to reproduce the same sliding effect of the header while scrolling on mobile and iPad, like on the big screens ? With the given code the header behaviour is jerky.February 25, 2019 at 11:11 am #1071219is there anyone ?
February 26, 2019 at 4:31 am #1071612Hi,
Sorry for the late reply, I didn’t see your post.
So I took a look at the header being in the middle of the page, and added some css to the script to account for this, I also added some css to the script to fix the breadcrumbs.
So I have moved all of the css to the script for better control, but for now it only works on screens up to 550px, it will have to be adjusted for above that (tablets), but we’ll see if we can get it to work for mobiles first.
I also added a transition so that it won’t be jerky.
Here’s the script:function custom_script(){ ?> <script> (function ($) { $(window).scroll(function() { var width = $(window).width(), height = $(window).height(); var scroll = $(window).scrollTop(); if ((width <= 550)) { if (scroll >= 100) { $("#header_meta").css({'height': '0','min-height': '0','transition': 'height 1s ease-out','overflow': 'hidden'}); $(".responsive #top #wrap_all #header").css({'top': '-10px','position': 'fixed'}); $("#main .title_container").css({'margin-top': '10px','position': 'fixed','z-index': '50'}); } else { $("#header_meta").css({'height': '61px','min-height': '61px'}); $(".responsive #top #wrap_all #header").css({'top': '10px','position': 'fixed'}); $("#main .title_container").css({'margin-top': '100px','position': 'fixed','z-index': '50'}); } } else {} }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
Give it a try and let me know what you think.
Best regards,
MikeFebruary 26, 2019 at 11:43 am #1071719Hi @Mike
the transition is nice and smoth.
The appearing issues are the following:
1. the breadcrumbs do not disappear entirely, a piece remains visible under the header : picture
2. while returning to the top of the page, here’s the situation (picture) :
— 1) two spaces appears abouve and under “OBSERVING & ANALYZING MANKIND”
— 2) the breadcrumb doesn’t come back
— 3) and the title doesn’t come back neitherPS: for the moment I’ve “closed” the script with /**/ before you come back to it
February 26, 2019 at 2:44 pm #1071808Hi,
Thanks for the screenshots, did you want the title and breadcrumbs to disappear on scroll? I thought it was just the topbar to hide. In my tests the title and breadcrumbs are visible below the header, Please see the screenshot in Private Content area.
It seems there is a visible difference between Chrome mobile test and iPhone, unfortunately I don’t have a iPhone.Best regards,
MikeFebruary 26, 2019 at 3:52 pm #1071849Hi again,
what you see in Chrome’s Device Toolbar is different from the real mobile device (dont ask me why). The screenshots I gave you today are from my Galaxy 6. I’ve checked the behaviour of the header with breadcrumb on my mobile in Chrome, Samsung explorer, Opera and Firefox. I’ve also checked on an iPhone. The result is absolutely the same, as on my screenshots.In the Chrome’s Device Toolbar I can also see the header + breadcrumb, but this is not the case on a real mobile device.
As to my preference, I would need only the header, without topbar and breadcrumb. In order to keep the name of the website and an easy access to the main menu and ajax search buton (in the header).
February 28, 2019 at 6:55 am #1072506March 1, 2019 at 12:33 am #1072800March 1, 2019 at 1:58 pm #1073181Hi,
Thank you for the images, I will see what else I can adjust. Thank you for your patience.Best regards,
MikeMarch 7, 2019 at 11:32 pm #1076134Hi @Mike,
did you manage to figure out the right adjustments ?
March 8, 2019 at 6:28 am #1076232Hi,
I believe I got the title bar to show fully on the scroll back. When you test please clear the WP Rocket cache also.Best regards,
MikeMarch 8, 2019 at 10:35 am #1076281Hello,
here’s the screenshot of a freshly downloaded page and this is after having came back to the top after scrolling.
I think if you download both pictures on your PC and interchange them consequenlty you’ll easily see the changes (spaces appearing, the title not coming back, etc.)March 12, 2019 at 3:04 am #1077608Hi,
Ok, thanks, I tried to update the “scroll up” height, go ahead and check it out.
As you are testing you can adjust it by looking for this line in the script:$("#main .title_container").css({'height': '71','margin-top': '200px','position': 'fixed','z-index': '50'});
and adjust the “200px”, the only issue that I can see is that some of your breadcrumbs are much larger than others, so as you adjust the area to accommodate large breadcrumbs, it will also add more empty space to page that have small breadcrumbs. So it’s just a matter of finding a happy medium.
Best regards,
MikeMarch 14, 2019 at 4:18 pm #1078740Hi,
I’ve deleted the breadcrumbs in Enfold’s settings. So there’s no more this problem.
But there is still the same problem: when the page is downloaded (here’s the picture) everything seems to be ok, but after scrolling down it’s impossible to come back to the same view (picture). The title of the page is hidden behind the Header, and the header is shifted from the top of the page.
i think this is not the matter of CSS.At the same page I’ve also detected this anomaly: on iPad in the posts ONLY (not in the pages) the landscape view deforms the header (picture). The portrait view is ok.
March 15, 2019 at 4:59 am #1078991Hi,
I see what you mean, it seems that my attempt at creating this effect was not a good solution and it’s going to be a bigger job that I thought it would be. Unfortunately it is exceeding the scope of what we are going to be able to provide here. If you wish to pursue this we can recommend the freelancers at Codeable for their expertise.Best regards,
MikeMarch 15, 2019 at 10:51 am #1079060)))))
This is smth I’ve also realized yesterday, so it’s ok. I’ll see later if I launch this coding works on my website or not.But can you help with the iPad issue ? Because this one is indepenent of the header code we tried to apply, it appeard even before.
— posts ONLY (not pages) the landscape view deforms the header (picture). The portrait view is ok.March 16, 2019 at 3:44 am #1079325Hi,
In your merged child theme css the header is set to 90% width, instead of 100%
Although I couldn’t find it in any of your css..responsive.html_boxed.html_header_sticky #header { max-width: 90%; }
Perhaps it is in the css of one of your other languages?
I was able to override it with this css in the WordPress > Customize > Additional CSS field:.responsive.html_boxed.html_header_sticky #header { max-width: 100% !important; }
Please check your site after you clear your browser cache to ensure that my fix didn’t affect the header for other pages or posts or in another language.
Best regards,
MikeMarch 18, 2019 at 12:13 pm #1079847Thank you, it works now.
Let’s close this thread
March 19, 2019 at 2:28 am #1080167Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘stick the header on mobile & iPad’ is closed to new replies.