Just starting out? Need help? Post your questions and find answers here.
hoerbie
 
Posts: 33
Joined: Sun Mar 17, 2019 5:51 pm

Window background transparent?

by hoerbie Mon Oct 28, 2019 10:41 am

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: 691
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: Window background transparent?

by Peter Mon Oct 28, 2019 12:39 pm

Code: Select all
Define WID = WindowID(YourWindow)

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


should work.

Greetings ... Peter
hoerbie
 
Posts: 33
Joined: Sun Mar 17, 2019 5:51 pm

Re: Window background transparent?

by hoerbie Mon Oct 28, 2019 2:42 pm

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: 691
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: Window background transparent?

by Peter Mon Oct 28, 2019 2:54 pm

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: 79
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada

Re: Window background transparent?

by Paul Mon Oct 28, 2019 3:57 pm

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: 691
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080

Re: Window background transparent?

by Peter Mon Oct 28, 2019 4:10 pm

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: 33
Joined: Sun Mar 17, 2019 5:51 pm

Re: Window background transparent?

by hoerbie Mon Oct 28, 2019 8:24 pm

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
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 1 guest