Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #887079

    I created a one page site with a sticky header/menu. The development version is here: https://foodlablimburg.marcbijl.nl

    In Mac desktop browsers (Firefox, Chrome, Safari), the navigation works nice. Also after resizing the browser window to e.g. 1024×768 (which is the iPad resolution) or even smaller.

    However, on a tablet (iPad with Safari), the menu links cause the content to partly disappear behind the sticky header. Result: H2 titles are not visible.

    How to solve this issue?

    #887244

    Hey Marc,

    Did you try to activate the mobile menu for tablets as well under Enfold->Main Menu?

    Best regards,
    Rikard

    #887277

    Hi @Rikard, thnx for the reply!

    No I didn’t. Actually there’s no need to activate mobile menu for tablets, since the regular menu looks good on tablets (the menu has only 5 very small items).

    I checked the Enfold one page demo’s (portfolio and restaurant) on an iPad too, and see the sticky navigation causes the content to disappear partly behind the header as well; however since the heading texts have quite a top-margin, it doesn’t really hurt (it’s not really an issue).

    https://kriesi.at/themes/enfold-restaurant-one-page
    https://kriesi.at/themes/enfold-one-page-portfolio

    That said: how comes the issue only happens on the iPad? Is there a solution/workaround? For example, moving the content a bit down (adding a top margin at the navigation anchors) or something…

    • This reply was modified 7 years ago by Marc Bijl.
    #887412

    Hi Marc Bijl,

    Here is a thread for you to consider

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #887798

    Hi @victoria_d and @rikard,

    I got suggested to look at two other threads; however, the first one (https://kriesi.at/support/topic/anchor-issue-with-sticky-header-on-ipad/) has not been updated since July, and at the second one @ismael asked me to continue here, at my own thread (https://kriesi.at/support/topic/anchors-in-navigation-icons-on-ipad/#post-887700).

    So can please anyone look at my issue?

    As said: I checked the Enfold one page demo’s (portfolio and restaurant) on an iPad too, and see the sticky navigation causes the content to disappear partly behind the header as well; however since the heading texts have quite a top-margin, it doesn’t really hurt (it’s not really an issue). But the anchor definitely is behind the sticky header.

    https://kriesi.at/themes/enfold-restaurant-one-page
    https://kriesi.at/themes/enfold-one-page-portfolio

    #888710

    Hi,

    We are very sorry for the late response.

    This is the code that we provided in the previous thread in order to fix the anchor on iPad view.

    // custom script
    add_action( 'wp_footer', 'ava_custom_script' );
    function ava_custom_script() {
    ?>
    <script type="text/javascript">
    (function($) {
      function a() {
          $('#top #header .av-main-nav > li').on('click touchstart', 'a', function(e) {
              if( $(window).innerWidth >= 1025 ) return;
              var anchor, loc, cur, hash, tab, parent, pos;
              anchor = $(this).attr('href');
              hash = anchor.substring(anchor.indexOf('#')).replace(/\#/g, '');
              anchor = $('.avia-section[id='+ hash +']');
              pos = anchor.offset();
    	
              if(hash) $(window).scrollTop( pos.top - 100 );
          });
      }
    
      a();
    })(jQuery);
    </script>
    <?php
    }

    Best regards,
    Ismael

    #916150

    Hi @Ismael- would I place this code at the top of the “functions-enfold.php” file?

    Thx,
    Greg

    #916292

    Hi,

    No, please place on functions.php :)

    Thank you very much

    Best regards,
    Basilis

    #916362

    Thanks for the response Basilis.

    Greg

    #916529

    Hi Greg,

    Thanks for the feedback, please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #916572

    is there any private content i can’t see ?
    because the link above is no enfold theme. I’m wondering about the flyout mobile menu.

    #916790

    So I had a slightly different situation that I think I worked through. Thought I’d post here in the event anyone else can benefit.

    I was using a Button (not a navigation link) to scroll to different sections on the page. Found the section in avia.js that controlled click to a hash tag and added the following line:

    if( $(window).innerWidth() < 1025 && $(window).innerWidth() > 736 ) { target -= 100; }

    That line was placed within this block:

    if(container.length)
    	{
    		var cur_offset = the_win.scrollTop(),
    			container_offset = container.offset().top,
    			target =  container_offset - fixedMainPadding,
    			hash = window.location.hash,
    			hash = hash.replace(/\//g, ""),
    			oldLocation=window.location.href.replace(hash, ''),
    			newLocation=this,
    			duration= data.duration || 1200,
    			easing= data.easing || 'easeInOutQuint';
    		
    		if( $(window).innerWidth() < 1025 && $(window).innerWidth() > 736 ) { target -= 100; }
    		if(sticky_sub.length && container_offset > sticky_sub.offset().top) { target -= sticky_sub.outerHeight() - 3;}
    		
    		// make sure it's the same location
    		if(oldLocation+newHash==newLocation || originHash)
    		{
    			if(cur_offset != target) // if current pos and target are the same dont scroll
    			{
    				if(!(cur_offset == 0 && target <= 0 )) // if we are at the top dont try to scroll to top or above
    				{
    					the_win.trigger('avia_smooth_scroll_start');

    Not sure if there was a better way to handle, but seems to be working properly now on iPad Portrait and Landscape for me.

    Thx
    Greg

    • This reply was modified 6 years, 10 months ago by Gregory.
    #917626

    Hi,

    @Gregory: Glad that you fixed it. That modification is almost the same as the previous one. We decrease the scroll position value by 100px.

    Best regards,
    Ismael

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.