CMS Development

sjay
メンバー | Diamond Partner
メンバー | Diamond Partner

How to set cookie banner in center of the screen and lock screen till getting response?

Is there any way to lock the screen until we get the response from the cookiebot?

Like the below example

https://templates.cookieinformation.com

sjay_0-1663851003757.png

 

1件の返信
BarryGrennan
トップ投稿者

How to set cookie banner in center of the screen and lock screen till getting response?

You'd style the banner with css

 div#hs-eu-cookie-confirmation {
    height: 100%;
/* etc., lots of styling, probably need a bfore elemnet for the shading? */
}

Then you'd probably set a class on your body element that had a overflow:hidden; and a height:100vh. Maybe this'd do the shading too if you weren't doing it above. Or maybe you could set a class on the html element that had overflow hidden. instead.

Then you'd create some javascript to remove the overflow hidden class you created on the body/html when a button in the cookie banner is clicked.

But, personally, I wouldn't do it unless you really have to, it's pretty annoying for the end user.

 


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact

 

 

 

 

0 いいね!