morphing modal window

How we can create an expanding modal overlay using HTML CSS JS? Solution: See this Morphing Modal Window With JavaScript and CSS, Fire Modal Overlay.

Previously I have shared some modal programs, but it is different from others it is an expanding modal overlay. Basically, A modal is a dialog box/popup window that is displayed on top of the current page. And Morphing involves automatically matching the basic look and feel of a website. And it is the combination of modal and morphing effect, it is a cool expanding modal overlay.

Today you will learn to create a Fire Modal Overlay. Basically, there are some text and a button to open the modal. When you will click on the button then the modal overlay will appear with a circular expanding effect. The modal window contains a bunch of text and a close button with a cross icon. When you will click on the close button the modal will disappear and the previous button will show again.

So, Today I am sharing Morphing Modal Window With JavaScript and CSS. There I have used a jQuery and a plugin for creating the program. And the layout and styles are based on HTML CSS. This is a cool modal overlay program that can be used on multiple sections like info, learn more, etc places. You can use this program on your website after some modifications.

If you are thinking now how this fire or expanding modal window actually is, then see the preview given below.

Preview Of Expanding or Fire Modal Overlay

See this video preview to getting an idea of how this expanding modal looks like.

Live Demo

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

You May Also Like:

Morphing Modal Window Source Code

Before sharing source code, let’s talk about it. First I have created a section with a class named container and placed all items inside it. Inside the sections, I have placed a line of text and a button using Div and Hyperlink tags. Also, I have created another section inside the container section for overlay elements. This section contains a bunch of text and a close button.

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 size, position, margin, padding, etc to all the elements. After that, I have used CSS transition and transform command to create animations. And used @media query to create a responsive design, the close button has an SVG icon.

jQuery handling here the open and close feature of the modal overlay. Also, it handling the circular expanding effect in every screen size. As you know there I have used a jQuery plugin named velocity.js and linked in the HTML file. There I have used if{} condition to declare the actions. 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

The final step, create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created Morphing Modal Window With JavaScript and CSS, Expanding or Fire Modal Overlay. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

1 COMMENT

  1. OMG, is not javascript & css, but also modernizr, jquery and velocity: at least 3 scripts to opena a modal!?!?!?

LEAVE A REPLY

Please enter your comment!
Please enter your name here