locked
LightSwitch 2013 - How to change the background image\color RRS feed

  • Question

  • Hey,

    I'm building a LightSwitch 2013 HTML application.

    I want to change the background on a specific screen to be a background-image.

    I saw a solution that goes like this:

    "add this classes to user-customization.css:

    .ui-body-a,
    .ui-overlay-a {
     background-image: url('background.jpg') !important;

    }

    "

    This solution works, but it will be in all my screens and i don't want that... I want to change the background only on one screen.

    How do i do that?

    Thanks.

    Sunday, February 28, 2016 11:50 AM

Answers

  • Hey Weiwei,

    Thank you for your response.

    I found a better (and logical) solution:

    Inside the tab post-render:

    $(element).css("background-image" , "url(data)");

    Best Regards.

    • Marked as answer by Yaron Y Thursday, March 3, 2016 8:42 AM
    Thursday, March 3, 2016 8:41 AM

All replies

  • Hi Yaron Y,

    If you just want to modify on screen's background, please add the change Javascript code in screen_postRender method which used to render current screen. For example, if you want to change background/background-image, please add below code.

    myapp.AddEditCustomer.Details_postRender = function (element, contentItem) {
        $(element).parent().parent().css({
            background: '#FFEEEF',
            "background-image":"none"
        });
    
    };

    Best Regards,
    Weiwei

    Thursday, March 3, 2016 8:23 AM
    Moderator
  • Hey Weiwei,

    Thank you for your response.

    I found a better (and logical) solution:

    Inside the tab post-render:

    $(element).css("background-image" , "url(data)");

    Best Regards.

    • Marked as answer by Yaron Y Thursday, March 3, 2016 8:42 AM
    Thursday, March 3, 2016 8:41 AM