Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(function() {
- document.cookie = "name=oeschger";
- var bodyTag = $('body'),
- cookieBox = $("<div id='cookie-box'></div>"),
- headerCookieBox = $("<h3>Diese Website verwendet Cookies</h3>"),
- buttonCookiesOk = $("<button>Mit der Verwendung von Cookies einverstanden</button>"),
- dslink = $("<a href='/'>Datenschutzerklärung.</a>"),
- paragraphCookieBox = $("<p>Cookies dienen der Benutzerführung und der Webanalyse und helfen dabei, diese Website zu verbessern und Ihnen den bestmöglichen Service zu bieten. Nähere Informationen finden Sie in unserer </p>");
- $(cookieBox).css({
- 'position': 'fixed',
- 'box-sizing': 'border-box',
- 'padding': '10px',
- 'bottom': '0',
- 'left': '0',
- 'z-index': '1000',
- 'width': '100%',
- 'backgroundColor': '#4962a0',
- 'height': 'auto'
- });
- $(headerCookieBox).css({
- 'margin': '0',
- 'color': 'white',
- 'font-size': '32px'
- });
- $(buttonCookiesOk).css({
- 'width' : 'auto',
- 'padding': '15px',
- 'height': '50px',
- 'background-color': '#edd365',
- 'font-size': '16px',
- 'border': 'none',
- 'outline': 'none',
- 'font-weight': 'bold',
- 'letter-spaceing': '.6px'
- });
- $(paragraphCookieBox).css({
- 'color': 'white'
- });
- $(dslink).css({
- 'color': 'white',
- 'font-weight': 'bold',
- 'letter-spaceing': '.5px'
- });
- $(cookieBox)
- .append(headerCookieBox)
- .append(paragraphCookieBox)
- .append(buttonCookiesOk);
- $(paragraphCookieBox).append(dslink);
- $(bodyTag).append(cookieBox);
- $(buttonCookiesOk).click(function () {
- $(cookieBox).fadeOut( function(){
- $(cookieBox).remove()
- });
- console.log(document.cookie);
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement