Page 1 of 1
Window background transparent?
Posted: Mon Oct 28, 2019 10:41 am
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
Re: Window background transparent?
Posted: Mon Oct 28, 2019 12:39 pm
by Peter
Code: Select all
Define WID = WindowID(YourWindow)
! $(v_wid.element).removeClass("spiderwindow")
! $(v_wid.contentFrame).removeClass("spiderwindow-content")
should work.
Greetings ... Peter
Re: Window background transparent?
Posted: Mon Oct 28, 2019 2:42 pm
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
Re: Window background transparent?
Posted: Mon Oct 28, 2019 2:54 pm
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
Re: Window background transparent?
Posted: Mon Oct 28, 2019 3:57 pm
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"
Re: Window background transparent?
Posted: Mon Oct 28, 2019 4:10 pm
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
Re: Window background transparent?
Posted: Mon Oct 28, 2019 8:24 pm
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