// Sticky category menu on mobile JQUERY
-
Hello,
In my personal case, in this new version, I still had to make a change to the source code, for the plugin to work correctly with the theme I use.
file: restropress/assets/js/frontend/rp-frontend.js
Original code:`// Sticky category menu on mobile
var initTopPosition= $(‘.sticky-sidebar’).offset().top;
$(window).scroll(function(){
if($(window).scrollTop() > initTopPosition)
$(‘.sticky-sidebar’).addClass(‘mobile-sticky’);
else
$(‘.sticky-sidebar’).removeClass(‘mobile-sticky’);
});`Replaced code:
`// Sticky category menu on mobile
var TopPosition = $(‘.sticky-sidebar’);
if (TopPosition.length) {
var initTopPosition = TopPosition.offset().top;
}
$(window).scroll(function(){
if($(window).scrollTop() > initTopPosition)
$(‘.sticky-sidebar’).addClass(‘mobile-sticky’);
else
$(‘.sticky-sidebar’).removeClass(‘mobile-sticky’);
});`I don’t know if this is a unique incompatibility of the theme that I use or not.
I leave it for the consideration of the programmers.
Hugs
- The topic ‘// Sticky category menu on mobile JQUERY’ is closed to new replies.