html css notifier that pops up from bottom right side of the page

15,130

Solution 1

What you require are known as Toast Notifications, or Toaster Popups, or a similar term.

Toastr is one such http://codeseven.github.io/toastr/

Here is a demo page for it http://codeseven.github.io/toastr/demo.html

toastr.options = {
  "closeButton": true,
  "debug": false,
  "newestOnTop": false,
  "progressBar": false,
  "positionClass": "toast-bottom-right",
  "preventDuplicates": false,
  "onclick": null,
  "showDuration": "300",
  "hideDuration": "1000",
  "timeOut": "5000",
  "extendedTimeOut": "1000",
  "showEasing": "swing",
  "hideEasing": "linear",
  "showMethod": "fadeIn",
  "hideMethod": "fadeOut"
};

toastr.info("This is a message <img src=\"http://news.bbcimg.co.uk/media/images/71977000/jpg/_71977649_71825880.jpg\" />", "Toaster Popup");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet"/>
<div id="toast"></div>

Solution 2

You could use positioning in order to avoid adding more weight to your project in the form of extra external library's. I've used jquery (yes, a library) although plain vanilla JS would also be sufficient to 'toggling the class'.

This allows for a much easier customisation of the notification as well.

I've made a simple, rough example of this:

$('.pop').click(function() {
  $('.popup').toggleClass("open");
});

$('.band').click(function() {
  $('.popup').toggleClass("open");
});
.popup {
  height: 150px;
  width: 250px;
  background: gray;
  bottom: -170px;
  right: 0;
  position: absolute;
  transition: all 0.8s;
  padding-top: 20px;
  border-radius: 10px;
  vertical-align:top;
}
.open {
  bottom: 0;
}
body {
  overflow: hidden;
}
.band {
  position: absolute;
  top: 0;
  width: 100%;
  height: 20px;
  background: rgba(0, 0, 0, 0.2);
  text-align: right;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  transition: all 0.8s;
}
.popup:hover {
  box-shadow: inset 0 0 15px black;
}
.band:hover {
  background: white;
}
html,
body {
  background: rgba(0, 0, 0, 0.3);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button class="pop">toggle popup</button>
<div class="popup">
  <div class="band">close/dismiss</div>
  <img src="http://placekitten.com/g/200/300" height="60" width="40"/>
  Someone say popup?
 </div>
Share:
15,130

Related videos on Youtube

j08691
Author by

j08691

There are 10 types of people in the world: Those who understand binary, and those who don't. Even a broken clock is right twice a day. I � Unicode Simple tips for new users: Take your time posting your question. Check your formatting, grammar, and spelling. Make sure the code you're posting is syntactically valid.

Updated on September 16, 2022

Comments

  • j08691
    j08691 over 1 year

    I need a notifier that pops up from bottom right side of the page. I have seen this on many sites including facebook as chat message from Friends. I have search bootstrap, jquery and many other things but could not get what I am looking for.

    Any info you have?