transparent background

Posted by meyrick on 10-Mar-2014 01:13

Hi there,

Does anyone know how to make the background of a popup transparent? When i open the popup, the background goes completely black.

Regards,

Posted by Ricardo Perdigao on 09-Apr-2014 02:17

Hi Meyrick,

Please check the Sample Project I shared with you with a solution.  Areas changed:

- Created a CSS file called Transparent

- Created a JavaScript file called Transparent

Code for the CSS:

.ui-dialog-background {
    opacity: 0.5;
    display: block !important;
    -webkit-transition: opacity 0.5s ease-in;
}
.ui-dialog-background.pop.in {
    opacity: 1;
    -webkit-transition: opacity 0.5s ease-in;
}
.ui-dialog {
    min-height: 80% !important;
    background: transparent !important;
    z-index: 3000;
}

Code for the JavaScript:

$('div[data-role="dialog"]').live('pagebeforeshow', function(e, ui) {
    ui.prevPage.addClass("ui-dialog-background ");
});
$('div[data-role="dialog"]').live('pagehide', function(e, ui) {
    $(".ui-dialog-background ").removeClass("ui-dialog-background ");
});


Please let us know if this helped and if you have further questions.
Regards,

Ricardo

All Replies

Posted by Shelley Chase on 10-Mar-2014 07:58

Hi Meyrick,

This is a known issue and we are working on changing it. It is actually a behavior difference between the jquery dialog and pop-up components.

-Shelley

Posted by meyrick on 11-Mar-2014 00:49

thanks for the info. hopefully it changes soon as it is a nice feature to use

Posted by Ricardo Perdigao on 09-Apr-2014 02:17

Hi Meyrick,

Please check the Sample Project I shared with you with a solution.  Areas changed:

- Created a CSS file called Transparent

- Created a JavaScript file called Transparent

Code for the CSS:

.ui-dialog-background {
    opacity: 0.5;
    display: block !important;
    -webkit-transition: opacity 0.5s ease-in;
}
.ui-dialog-background.pop.in {
    opacity: 1;
    -webkit-transition: opacity 0.5s ease-in;
}
.ui-dialog {
    min-height: 80% !important;
    background: transparent !important;
    z-index: 3000;
}

Code for the JavaScript:

$('div[data-role="dialog"]').live('pagebeforeshow', function(e, ui) {
    ui.prevPage.addClass("ui-dialog-background ");
});
$('div[data-role="dialog"]').live('pagehide', function(e, ui) {
    $(".ui-dialog-background ").removeClass("ui-dialog-background ");
});


Please let us know if this helped and if you have further questions.
Regards,

Ricardo

Posted by meyrick on 09-Apr-2014 02:46

Ricardo, thank you very much for all your help. it works brilliantly!

This thread is closed