[Resolved] How to exclude a script

Home Forums Support [Resolved] How to exclude a script

Home Forums Support How to exclude a script

  • This topic has 3 replies, 2 voices, and was last updated 5 months ago by David.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2393149
    Samuel

    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

    #2393174
    David
    Staff
    Customer Support

    Hi there,

    you may want to check with Litespeed support.
    Before that, try a longer pattern to check eg.

    jQuery(".main-navigation ul ul li").on('mouseenter mouseleave', function (e) {

    #2393192
    Samuel

    Thanks David,
    This is not working,
    I’ll see with Litespeed support, or I’ll change my menu to not be so deep and to not need this feature.

    #2393206
    David
    Staff
    Customer Support

    I hope they can help 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.