I am currently working on integrating the Responsive Menu plugin into a WordPress theme. However, I am facing an issue where the push-side menu causes the body to move vertically when open.
Fortunately, there is a solution available for this specific template page that works amazingly well and has produced satisfactory results.
The question: Considering the answer provided by Outsource WordPress which fixed the aforementioned page, is it possible to modify the code below in order to make it usable across various template pages such as here, similar to how it currently functions here?
I believe that `.edge-ils-item-link` and `.edge-ils-content-table` are variables, but I am unsure of how to approach and adjust them. I have attempted replacing these elements without success, suggesting that the solution may be more complex than initially thought. Additionally, elements like `edge-wrapper`, `edge-wrapper-inner`, and `wpb_wrapper` are present on all pages, indicating that modifying these common elements could potentially enhance the overall solution’s versatility.
It would also be beneficial to ensure compatibility with the latest jQuery version (currently using jQuery migrate 1.4.1) and an older version of Wordpress for functional purposes on the designated page.
.scroll-lock{position:fixed !important;}
$(document).ready(function() {
var windowTop = 0;
var menuOpen = 0;
var offsetContainerList = 0;
$('#responsive-menu-pro-button').click(function() {
var offsetScrollList = $('.edge-ils-item-link:first').offset().top;
if ($('html').hasClass('scroll-lock')) {
$('#responsive-menu-pro-container').one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",
function(event) {
if (menuOpen==0) {
menuOpen = 1;
$('html').removeClass('scroll-lock');
$('.edge-ils-content-table').css('top', eval(offsetContainerList)-40+'px');
$('html').scrollTop(windowTop);
}
else {
menuOpen = 0;
}
});
}
else {
windowTop = $(window).scrollTop();
offsetContainerList = $('.edge-ils-content-table').offset().top;
$('html').addClass('scroll-lock');
$('.edge-ils-content-table').css('top', -offsetScrollList + 'px');
}
});
});
If needed, you can view a video demonstrating the issue here.