[Hustle Pro] Trigger Hustle Slindin with JS

Is their a way to trigger the slide in with JS. I have a page which is populated via ajax at certain stages and only want trigger a slide in at a specific point

  • Dimitris Kalliris
    • Support Team Lead

    Hello there John

    We just had some feedback from our Hustle lead developer that shared the following JS snippet for you.

    let leModule;
    for ( let i in window.Modules ) {
    
        if ( window.Modules[ i ].hasOwnProperty( 'module_id' ) ) {
            if ( window.Modules[ i ].module_id === '{ Module id here }' ) {
                leModule = new Optin.SlideIn( window.Modules[ i ] );
    
                leModule.showModule();
            }
        }
    }

    Please make sure that:
    1. you replace { Module id here } with the slide-in ID
    2. the slide-in module is published
    3. the slide-in module is set to be displayed in the page you need
    4. use some trigger that won’t actually trigger (so the custom trigger from the code above happens instead)

    Warm regards,
    Dimitris