Home Forums Porto Template Nav bars not collapsing after navigation

This topic contains 2 replies, has 2 voices, and was last updated by  Support2 5 months, 1 week ago. This post has been viewed 169 times

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10025524

    thereforesolutions
    Participant

    Hi There,

    I can’t figure out how to get the nav bars to collapse after clicking on a nav item. Any help would be appreciated.

    Best,

    Chris


    #10025525

    thereforesolutions
    Participant

    The issue seems to be related to my hosting platform. It doesn’t work with BlueHost, but does @ StartLogic.


    #10025535

    Support2
    Keymaster

    Hello, thanks for your purchase 🙂

    I saw that you are using an old version of Porto.
    The most updated version of Porto already has a fix for that. In that case, to fix please replace the code of “Anchors Position” at (js/theme.js) line 2826 until 2845 to:

    // Anchors Position
    $('[data-hash]').each(function() {
    
    	var target = $(this).attr('href'),
    		offset = ($(this).is("[data-hash-offset]") ? $(this).data('hash-offset') : 0);
    
    	if($(target).get(0)) {
    		$(this).on('click', function(e) {
    			e.preventDefault();
    
    			if( !$(e.target).is('i') ) {
    
    				// Close Collapse if Opened
    				$(this).parents('.collapse.show').collapse('hide');
    
    				self.scrollToTarget(target, offset);
    				
    			}
    
    			return;
    		});
    	}
    
    });

    Please, try that and let me know if you need further assistance.

    Kind Regards,

    Rodrigo.


Viewing 3 posts - 1 through 3 (of 3 total)