Background image

Workarounds and usability notes.

Background image

Postby John Robin Dove » Mon Oct 28, 2024 8:17 am

Hi Clifton.
I have been trying to make a system to allow users to change the color scheme in my program including the the image used by the page background. I have tried using pgStyleObject to change the css 'background' property or 'background-image'. Your instructions say that 'current', 'page' or 'background' may be used to refer to the background but none of these seem to work. I also have tried naming the background and using pgTBObjSet with 'backdrop' but that doesn't work either. It's not a great problem because I have found a solution which is putting a field on the background and using pgStyleObject to change its 'background' property but I'd like to know what I was doing wrong.
John
John Robin Dove
 
Posts: 538
Joined: Thu Jan 23, 2014 4:35 am

Re: Background image

Postby Clifton » Mon Oct 28, 2024 10:24 am

You are correct to use pgStyleObject() to set an image for the page.
Here is an example:
    pgStyleObject( "page", "background, backgroundSize", "url(../media/myBackground.png) no-repeat, 100% 100%" );

Of course, your alternate method is another option.
Clifton
Site Admin
 
Posts: 781
Joined: Tue Jan 14, 2014 1:04 am

Re: Background image

Postby John Robin Dove » Mon Oct 28, 2024 2:38 pm

Many thanks.
John Robin Dove
 
Posts: 538
Joined: Thu Jan 23, 2014 4:35 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron