How can I do something similar to this cool panel at the top of stackoverflow that appears when you get a new icon?

When you get a new icon on stackoverflow.com, a panel appears at the top of the screen informing you of your achievements. It closes until the user closes it.

I like this system to inform the user about new news related to the site or their account. It is quite non-intrusive, but nevertheless clearly conveys information. Even if all users receive a notification in this way, it is suitable for each user until they confirm its appearance.

I am running a system using Ruby on Rails in a PostGres database. What is the best way to implement a similar system in my setup?

Edit: just to clarify, I'm interested in both server side and client side.

+3
source share
2 answers

The effect can be performed using jQuery and the slideDown method ( http://api.jquery.com/slideDown/ ). Set the onClick event to make the slideUp element, hide or press an AJAX call so that you know that the user received the message and rejected it.

( DIV), AJAX, DIV , DIV , slideDown $().ready (http://think2loud.com/jquery-document-ready-howto/).

+2

Source: https://habr.com/ru/post/1731603/


All Articles