Hi,
I’m using a script to open a specific part of my sub-menu to the left.
I’m using Litespeed cache to delay JS
And so the script is not working.
So I need to exclude the script from being delayed.
But I can’t find which attribute I need to set to exclude it. As Litespeed is authorizing all king of exclusion, including simple keyword that is part of the JS I’ve tried to exclude part of the code, like (jQuery('ul', this)
or main-navigation
but it’s not working.
Here is the script :
<script>
jQuery(function () {
jQuery(".main-navigation ul ul li").on('mouseenter mouseleave', function (e) {
if (jQuery('ul', this).length) {
var elm = jQuery('ul', this);
var off = elm.offset();
var l = off.left;
var w = elm.width();
var docH = jQuery("body").height();
var docW = jQuery("body").width();
var isEntirelyVisible = (l + w <= docW);
if (!isEntirelyVisible) {
jQuery(this).addClass('edge');
console.log('out of bounds');
} else {
jQuery(this).removeClass('edge');
}
}
});
});</script>
Maybe there would be a way to “name” this script in order to exclude it calling by its name ?
Thanks for your help