Show a widget depending on if the other is visible

0
Hi guys! I want to show a widget in case the other one is visible, how can I achieve this?
asked
1 answers
0

You can achieve this by using simple css. 

Wrap your widgets in a container if you do not have one. Set some class name for the container (e.g., cnt-mywidgets). And also set some class name to your widgets (e.g., mywidget1, mywidget2). Let us assume that you want to display the widget2 if widget1 is visible. Now, in your custome scss file, add css like below with your class names.

 

.mywidget2 {
	display: none;
}

.cnt-mywidgets:has(.mywidget1) {
	.mywidget2 {
		display: block;
	}
]

 

answered