Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. <script>
  2. $(function() {
  3. document.cookie = "name=oeschger";
  4.  
  5.  
  6. var bodyTag = $('body'),
  7. cookieBox = $("<div id='cookie-box'></div>"),
  8. headerCookieBox = $("<h3>Diese Website verwendet Cookies</h3>"),
  9. buttonCookiesOk = $("<button>Mit der Verwendung von Cookies einverstanden</button>"),
  10. dslink = $("<a href='/'>Datenschutzerklärung.</a>"),
  11. 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>");
  12.  
  13. $(cookieBox).css({
  14. 'position': 'fixed',
  15. 'box-sizing': 'border-box',
  16. 'padding': '10px',
  17. 'bottom': '0',
  18. 'left': '0',
  19. 'z-index': '1000',
  20. 'width': '100%',
  21. 'backgroundColor': '#4962a0',
  22. 'height': 'auto'
  23. });
  24.  
  25. $(headerCookieBox).css({
  26. 'margin': '0',
  27. 'color': 'white',
  28. 'font-size': '32px'
  29. });
  30.  
  31. $(buttonCookiesOk).css({
  32. 'width' : 'auto',
  33. 'padding': '15px',
  34. 'height': '50px',
  35. 'background-color': '#edd365',
  36. 'font-size': '16px',
  37. 'border': 'none',
  38. 'outline': 'none',
  39. 'font-weight': 'bold',
  40. 'letter-spaceing': '.6px'
  41. });
  42.  
  43. $(paragraphCookieBox).css({
  44. 'color': 'white'
  45. });
  46.  
  47. $(dslink).css({
  48. 'color': 'white',
  49. 'font-weight': 'bold',
  50. 'letter-spaceing': '.5px'
  51. });
  52.  
  53. $(cookieBox)
  54. .append(headerCookieBox)
  55. .append(paragraphCookieBox)
  56. .append(buttonCookiesOk);
  57.  
  58. $(paragraphCookieBox).append(dslink);
  59.  
  60. $(bodyTag).append(cookieBox);
  61.  
  62. $(buttonCookiesOk).click(function () {
  63. $(cookieBox).fadeOut( function(){
  64. $(cookieBox).remove()
  65. });
  66. console.log(document.cookie);
  67. });
  68.  
  69.  
  70.  
  71. });
  72. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement