toast message with close animation

How we can create popup success or information messages using HTML CSS JS? Solution: See this Toast Message With Close Animation Using CSS & jQuery, Info Messages.

Previously I have shared an info window program, but this is something different this is a toast message. Basically, Toast Messages is a small, non-disruptive popup for success or information messages that disappears automatically after a few seconds. Firstly it introduces by android, now you will see on many software on windows and mac. This is called a toast message because they pop up like toast from a toaster. This program is a kind of prototype of that using HTML CSS and jQuery.

Today you will learn to create the popup info messages UI design. Basically, there are three types of toast messages, the first one is for success, the second is info, and the third one is a warning. All these messages boxes have a separate icon, some texts, and a cross icon on the right side for closing it. When you will click on the cross icons then the message box will close and disappear with a smooth animation.

So, Today I am sharing Toast Message With Close Animation Using CSS and jQuery. Basically, the whole layout any styles are based on HTML and CSS, but I used jQuery for the close function. There the icons are based on SVG, there is no third-party icon library. You can use this on your website as progress result dialog. This type of massage is best for success, error, and warning dialogs.

If you are thinking now how these messages actually are, then see the preview given below.

Preview Of Popup Info Messages

See this video preview to getting an idea of how this toast message looks like.

Live Demo

Now you can see this design visually, also you can see and test close animation live by pressing the button given above. If you like this program, then get the source code of its.

You May Also Like:

Toast Message With Close Animation Source Code

Before sharing source code, let’s talk about it. First I have created a main div named container and placed all elements inside it. There I have created 3 different sections because there are 3 types of messages. Each message section two SVG icons for the main icon and close icon, and some texts. Also in the HTML file, I have linked other files like CSS, JS, jQuery CDN.

Now using CSS I have placed all the items in the right place, as you can see in the preview. With CSS first I gave basic values like position, margin, padding, etc to the elements. Also, I have placed SVG icons and gave color values to those. There I have used a google font to style the texts. I have used CSS transform command for the close or cross icon.

jQuery handling here only close feature in this program, left all are based on CSS and HTML. jQuery detects the click on cross icon and closes the message box with a slow fade animation. Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First file for HTML, second for CSS, and the third file for JavaScript.

Follow the steps to creating this program without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

That’s It. Now you have successfully created Toast Message With Close Animation Using CSS & jQuery, Popup Info Messages. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here