Menu scrolling
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Please add the following js codes to layout.js;
Best Regards,
Code: Select all
/**
* PrimeFaces Apollo Layout
*/
PrimeFaces.widget.Apollo = PrimeFaces.widget.BaseWidget.extend({
init: function(cfg) {
...
this.nano = this.menuContainer.find('.nano');
this._bindEvents();
/*** Refactor the following lines ********/
var nanoOptions = {flash:true};
if(!this.isHorizontal() && !this.isSlim()) {
this.restoreMenuState();
this.bindMenuScroll();
var scrollTop = $.cookie('apollo_menu_scrollPosTop');
if (scrollTop != null) {
nanoOptions['scrollTop'] = scrollTop;
}
}
this.nano.nanoScroller(nanoOptions);
/********************end*************************/
this.nano.children('.nano-content').removeAttr('tabindex');
},
/** Add the following methods ****************/
bindMenuScroll: function() {
var $this = this;
this.nano.on('update', function(e, values){
$this.saveScrollPosition(values.position);
});
},
saveScrollPosition: function(position) {
$.cookie('apollo_menu_scrollPosTop', position, {path: '/'});
},
clearScrollPosition: function() {
$.removeCookie('apollo_menu_scrollPosTop', {path: '/'});
},
/*********************end***************************/
_bindEvents: function() {
...
}
...
}
...
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest