Menu icon Foundation
top bar scrolltop : false?

In bower_components\foundation\js\foundation.js you can find this:

name : 'topbar',

version: '5.4.6',

settings : {
  index : 0,
  sticky_class : 'sticky',
  custom_back_text: true,
  back_text: 'Back',
  mobile_show_parent_link: true,
  is_hover: true,
  scrolltop : true, // jump to top when sticky nav menu toggle is clicked
  sticky_on : 'all'
}
         

I wan't to prevent the page to jump to the top when I open my fixed, sticky top bar. Probably this will be fixed by changeing this:

scrolltop : true, // jump to top when sticky nav menu toggle is clicked
            

         

To this:

scrolltop : false, // do not jump to top when sticky nav menu toggle is clicked
            

         

But I don't wan't to edit the core files of Foundation. How can I do this and at the same time leave the core untouched?

top-barstickyfixedjquery

In bower_components\foundation\js\foundation.js you can find this:

name : 'topbar',

version: '5.4.6',

settings : {
  index : 0,
  sticky_class : 'sticky',
  custom_back_text: true,
  back_text: 'Back',
  mobile_show_parent_link: true,
  is_hover: true,
  scrolltop : true, // jump to top when sticky nav menu toggle is clicked
  sticky_on : 'all'
}
         

I wan't to prevent the page to jump to the top when I open my fixed, sticky top bar. Probably this will be fixed by changeing this:

scrolltop : true, // jump to top when sticky nav menu toggle is clicked
            

         

To this:

scrolltop : false, // do not jump to top when sticky nav menu toggle is clicked
            

         

But I don't wan't to edit the core files of Foundation. How can I do this and at the same time leave the core untouched?

This post has been closed. No new replies can be added.

Rafi Benkual over 4 years ago

Yes and like this:

 $(document).foundation({
  topbar: {
   scrolltop : true
  }
});

Robin Cox over 4 years ago

Found it!

Add: data-options="is_hover: false"

here:

<nav class="top-bar" data-topbar role="navigation" data-options="is_hover: false">