0

Watch the next image:

enter image description here

As you can see is a message in a box where it can be closed and no appear everytime if it was closed.. I'm looking for something like that, but I didn't have idea about how to find it in the web.

Darf Zon
  • 6,268
  • 20
  • 90
  • 149

3 Answers3

4

I think you're looking for alerts. Bootstrap has ones that you find scattered everywhere on the web.

You'll have to set a cookie or something to hide it for good (ie if someone dismisses it and comes back later)

You could try something like this (using bootstrap alerts and the jquery cookie lib)...

$(document).ready(function(){
    $('#dismissal').click(function(){
        $.cookie('dismissed','true');
    });
    if($.cookie('dismissed') == 'true'){
        $('.alert').hide();
        alert('cookie \'dismissed\' is set, alert hidden.');
    }
});

Demo in action

brbcoding
  • 13,378
  • 2
  • 37
  • 51
0

You have to set a cookie in the client browser for something like that. You could set a cookie based on user preference and check the cookie next time the user visits and then load the content based on user preferences.

user1
  • 1,063
  • 1
  • 8
  • 28
0

Build it in normal HTML (probably just a div with some basic styling and absolute or fixed positioning) and then use the JQuery.cookie plugin (very easy to use - check it out here) to set a cookie when the user clicks the "close" button on the div (in addition to hiding the div with jquery). Then just check for whether that cookie is set whenever the page is loaded and use that to determine whether to show the div or not.

Ennui
  • 10,102
  • 3
  • 35
  • 42