How can I create a dismissable sticky div

Hey @Floris_van_Lint - thank you for the example.

Basically, the Cookie Bar is also just “an element”. You could mimic this element or just create a new one and set the position to fixed and bottom: 0

In that element, you should be able to add the logos and a button on the top right side that triggers the element to close.

If you want to mimic the feature that the element is being closed as if this is a cookie bar, this would be the JS to be added:

$('.your-close-button').click(function(e) {
	e.preventDefault();
	$('.the-container-to-hide').hide();
});

It is recommended to set a CSS class to the element, of course. Otherwise, it won’t work :smiley:

Please try it out and let me know if that worked out for you :slight_smile:

3 Likes