titcrunch Posted December 18, 2016 Share Posted December 18, 2016 (edited) We create a clone of menu for scroll with this own parameter In "globaltemplate" search : {template="includeJS" if="theme.js_include == 'footer'" app="core" group="global" location="global" params=""} Add below : <script> // Create a clone of the menu, right next to original. $('.ipsNavBar_primary').addClass('original').clone().insertAfter('.ipsNavBar_primary').addClass('cloned').css('position','fixed').css('top','0').css('margin-top','0').css('z-index','500').removeClass('original').hide(); scrollIntervalID = setInterval(stickIt, 10); function stickIt() { var orgElementPos = $('.original').offset(); orgElementTop = orgElementPos.top; if ($(window).scrollTop() >= (orgElementTop)) { // scrolled past the original position; now only show the cloned, sticky element. // Cloned element should always have same left position and width as original element. orgElement = $('.original'); coordsOrgElement = orgElement.offset(); leftOrgElement = coordsOrgElement.left; widthOrgElement = orgElement.css('width'); $('.cloned').css('left',leftOrgElement+'px').css('top',0).css('width',widthOrgElement).show(); $('.original').css('visibility','hidden'); } else { // not scrolled past the menu; only show the original menu. $('.cloned').hide(); $('.original').css('visibility','visible'); } } </script> if you don't use the "more" item menu, add in custom css : li#elNavigationMore { display: none; } This modification is for default theme but you can use on all theme, just change the class menu use in script by your ! in this exemple we use : ".ipsNavBar_primary" (care ! the script use this balise two times). And show if you have script in footer too : Edited December 18, 2016 by titcrunch 1 Quote Best Regards Titcrunch French webdesigner in camel Design, Support, help and tutorials in : Forum Camel Design. Link to comment Share on other sites More sharing options...
AwesomeBoy Posted January 8, 2017 Share Posted January 8, 2017 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.