[Support request] generate-slideout-menu trigger to open with javascript

Home Forums Support [Support request] generate-slideout-menu trigger to open with javascript

Home Forums Support generate-slideout-menu trigger to open with javascript

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1642217
    Randy

    Hi!

    If I want to trigger the generate-slideout-menu to open with javascript, can you tell me what classes I would need to manipulate?

    I tried document.querySelector('#generate-slideout-menu').classList.add('is-open'); which works well, except that it doesn’t display the slideout-overlay, so there must be a class or something I am missing, or a different one I should use maybe to make both the generate-slideout-menu and the slideout-overlay visible please?

    Thank you!

    #1642258
    Elvin
    Staff
    Customer Support

    Hi there,

    The script adds in offside-js--is-open class to the body tag as well so you may also have to add: document.querySelector('body').classList.add('offside-js--is-open'); to your script.

    This is required as the CSS to show the overlay is this:

    .offside-js--is-open .slideout-overlay {
        visibility: visible;
        opacity: 1;
    }

    Meaning if offside-js--is-open class is present within the body tag, this will apply, hence classList.add('offside-js--is-open').

    A wise man once said:
    "Have you cleared your cache?"

    #1642863
    Randy

    Great thanks! Looks like I might also have to add offside-js--is-right slide-opened classes to body in order to get the slideout close button to appear, right?

    #1643735
    Elvin
    Staff
    Customer Support

    Great thanks! Looks like I might also have to add offside-js–is-right slide-opened classes to body in order to get the slideout close button to appear, right?

    Yes thats right. or offside-js--is-left if its coming in from the left depending on what the offcanvas setting.

    A wise man once said:
    "Have you cleared your cache?"

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