Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > RocketCake
cookies Banner
Author Text

lubekka
Registered User
Quote
2021-02-01 13:11:34

Hallo,
wie kann ich im RocketCake einen cookies-Banner einbauen? Da ich den HTML-Code nicht bearbeiten kann ?
Danke


erik
Registered User
Quote
2021-02-01 14:39:37

Hi,

just paste the code below into a JavaScript element and turn off the "Create Div" to turn off the JavaScript:


function hideCookieOverlay()
{
var slotname = "cookieOverlay";

try
{
localStorage.setItem(slotname, "hidden");
} catch(e) { }

var b = document.getElementById("cookiearea51");
if (b != null)
b.parentNode.removeChild(b);
}

function showCookieOverlay()
{
var slotname = "cookieOverlay";
var content = '';

try
{
content = localStorage.getItem(slotname);
} catch(e) {}

if (content == 'hidden')
return;

var tdiv = document.createElement('div');
tdiv.innerHTML = "<div style=\"text-align: center; position: fixed; bottom: 20px; width: 300px; right: 10px; background-color: rgb(221, 221, 221); border: 1px solid rgb(195, 195, 195); padding: 15px; font-size: 14px; font-family: Arial, Helvetica, sans-serif; opacity: 1;\" id=\"cookiearea51\">Note: This page on this website uses cookies to make it work. <br/><br/><div style=\"vertical-align: bottom; border-radius: 5px; position:relative; display: inline-block; width:150px; height:40px; background-color:808080; color:ffffff;\"><div =\"hideCookieOverlay()\" style=\"cursor: pointer; display: table; width: 100%; height: 100%;\"><div style=\"display: table-cell; vertical-align: middle;\">Ok, understood.</div></div></div>";
var elem = tdiv.firstChild;
document.body.appendChild(elem);

var cookieAreaSetAlpha=function(a,c){c.style.filter="Alpha(Opacity="+a*100+")";c.style.MozOpacity=a;c.style.opacity=a};

var b=document.getElementById("cookiearea51");
d=(new Date).getTime();
e=0;
if(b!=0)
{
cookieAreaSetAlpha(0,b);
e=setInterval(
function()
{var a=((new Date).getTime()-d)/3E3;
if(a>1)
{
cookieAreaSetAlpha(1,b);
clearInterval(e);
}
else
cookieAreaSetAlpha(a,b)
},100);
};

}

showCookieOverlay();






Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact