Window background transparent?

Just starting out? Need help? Post your questions and find answers here.
hoerbie
Posts: 100
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

Window background transparent?

Post by hoerbie »

Hi,

maybe I overlooked it in the docs or used the wrong search here, but I didn't find anything about making a SpiderBasic window transparent.

I use a lot of smaller windows with #PB_Window_BorderLess and would like to get them fully transparent, so that only the gadgets are shown in front of my background image. I know how to set a background image in the window, but this will look different than the full background image which is configured as no-repeat and center and its size as "cover".

Any tip from the CSS/Javascript pros of the forum?

Greetings, Hoerbie
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Window background transparent?

Post by Peter »

Code: Select all

Define WID = WindowID(YourWindow)

! $(v_wid.element).removeClass("spiderwindow")
! $(v_wid.contentFrame).removeClass("spiderwindow-content")
should work.

Greetings ... Peter
hoerbie
Posts: 100
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

Re: Window background transparent?

Post by hoerbie »

Thanks Peter, this way it doesn't work, but you put me on the right way!

! $(v_wid.element).removeClass("spiderwindow")
seems to change nothing.

! $(v_wid.contentFrame).removeClass("spiderwindow-content")
then only changes the light gray background of the window to white.

But changing the first line into:
! $(v_wid.element).removeClass("spiderwindow-background")
works!

Greetings, Hoerbie
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Window background transparent?

Post by Peter »

hoerbie wrote:Thanks Peter, this way it doesn't work
I used this sample code and the code I posted works for me.

Moreover, I don't find a class called 'spiderwindow-background' in the list of elements.

Greetings ... Peter
User avatar
Paul
Posts: 195
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada
Contact:

Re: Window background transparent?

Post by Paul »

Hi Peter,

The example code you refer to indeed has only "spiderwindow" but if hoerbie happened to use the #PB_Window_Background flag then "spiderwindow" becomes "spiderwindow-background"
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Window background transparent?

Post by Peter »

Paul wrote:but if hoerbie happened to use the #PB_Window_Background flag then "spiderwindow" becomes "spiderwindow-background"
I referred to his statement:
I use a lot of smaller windows with #PB_Window_BorderLess and would like to get them fully transparent
But anyway, it's good to know the problem is solved now. :)

Greetings ... Peter
hoerbie
Posts: 100
Joined: Sun Mar 17, 2019 5:51 pm
Location: DE/BY/MUC

Re: Window background transparent?

Post by hoerbie »

Hi,

I didn't use #PB_Window_Background, but the window I tried has the two flags #PB_Window_BorderLess and #PB_Window_ScreenCentered, and the div of the window got the class "spiderwindow-background" in my SB2.22 on Mac, I checked it with Firefox inspector. Maybe the background class is used for centering?

Greetings, Hoerbie
Post Reply