Modal offer extension change background div tDrkdiv

Silver Contributor
Silver Contributor

Is there a way to override the tDrkdiv style settings that are set with the modal offer extension?

3 REPLIES 3

Modal offer extension change background div tDrkdiv

Employee Emeritus

@joecbrown,

 

What changes do you want to make?

Modal offer extension change background div tDrkdiv

Silver Contributor
Silver Contributor

@christina_schel I wanted to change the background and opacity for the tDrkdiv. 

Modal offer extension change background div tDrkdiv

Employee Emeritus

@joecbrown,

 

Adding the below code to a JS Extension scoped to Pre-Loader seems to do the trick for me. Let me know if this works for you.

 

function waitForElement(selector, time, function_to_run, max_runs, this_run) {
    if (typeof max_runs === 'undefined')
        max_runs = 10;
    if (typeof this_run === 'undefined')
        this_run = 1;
    if (max_runs < this_run)
        return;
    if (jQuery(selector).length) {
        function_to_run();
        return;
    } else {
        this_run++;
        setTimeout(function() {
            waitForElement(selector, time, function_to_run, max_runs, this_run);
        }, time);
    }
}

waitForElement('#_tealiumModalWindow', 25, function() {
    jQuery('#_tealiumModalWindow').attr("style", "background-color:blue;opacity: 0.5;")
})
Public