Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #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.

    #1071219

    is there anyone ?

    #1071612

    Hi,
    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,
    Mike

    #1071719

    Hi @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 neither

    PS: for the moment I’ve “closed” the script with /**/ before you come back to it

    #1071808

    Hi,
    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,
    Mike

    #1071849

    Hi 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).

    #1072506

    Hi,
    Ok, I made some adjustments, give it a try now.

    Best regards,
    Mike

    #1072800

    Hi,

    it’s getting better )
    Here’s the shrinking version (picture). The menu button strangely become bluish.
    And here’s the “come back” version (picture), the title still doesn’t come back.

    Regards,

    #1073181

    Hi,
    Thank you for the images, I will see what else I can adjust. Thank you for your patience.

    Best regards,
    Mike

    #1076134

    Hi @Mike,

    did you manage to figure out the right adjustments ?

    #1076232

    Hi,
    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,
    Mike

    #1076281

    Hello,

    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.)

    #1077608

    Hi,
    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,
    Mike

    #1078740

    Hi,

    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.

    #1078991

    Hi,
    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,
    Mike

    #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.

    #1079325

    Hi,
    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,
    Mike

    #1079847

    Thank you, it works now.

    Let’s close this thread

    #1080167

    Hi,
    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

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘stick the header on mobile & iPad’ is closed to new replies.