<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
var cookieBar = {
closeAfter: 500000, //ms
cookieBar: null,
init: function() {
this.createCookieBar();
},
createCookieBar: function() {
this.cookieBar = "<div id='cookieBar' class='bar'>We use cookies and other technologies on our website to offer you the full functionality of our website. In addition, cookies allow the personalisation of content. They can also be set for analysis. By continuing to use our website, you agree to the use of cookies. Further information, can be found in our <a href='#'>privacy policy</a>.</div>";
this.showCookieBar();
},
showCookieBar: function() {
$('body').prepend(this.cookieBar);
this.cookieBar = $('#cookieBar');
this.cookieBar.hide().slideDown('slow');
this.autoClose();
},
autoClose: function() {
setTimeout(function(){
this.cookieBar.slideUp('slow');
}.bind(this), this.closeAfter);
}
};
$(function() {
cookieBar.init();
});