Simple Responsive Modal

Developer
Size
2,272 Kb
Views
46,552

How do I make an simple responsive modal?

What is a simple responsive modal? How do you make a simple responsive modal? This script and codes were developed by Chris Maki on 12 August 2022, Friday.

Simple Responsive Modal Previews

Simple Responsive Modal - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple Responsive Modal</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <button class="show-modal open-modal">Open Modal</button> <div class="modal"> <a class="close-modal" href="#">X</a> <div class='modal-content'>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt sit quas aut labore nam quis qui eos quasi soluta sunt nihil voluptate expedita. Aliquam aliquid excepturi ex ab fuga ipsa?</div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Simple Responsive Modal - Script Codes CSS Codes

.container {width: 500px; margin: 50px auto}
.open-modal { background-color:#38ddf7; border: none; border-radius: 4px; color: #fff; outline: none; padding: 20px 40px; text-transform: uppercase
}
.open-modal:hover {background-color: #bff2e5}
.modal { background-color: #dbd9d9; display: none; position: fixed; top: 50%; left: 50%; width: 400px; height: 200px; margin-left: -200px; margin-top: -150px; padding: 50px; border-radius: 5px; z-index: 10; box-shadow: 0 0 0 99999px rgba(0, 0, 0, 0.7);
}
.close-modal { color: #000; text-decoration: none; float: right; position: absolute; top: 10px; right: 20px
}
@media (max-width : 37.500rem) { .modal {	top: 0;	left: 0; width: 100%; height: 100%; margin: 0; padding: 1.250rem } .close-modal{ display: block; position: relative; padding: 5px 10px 20px 0 } .modal-content{ clear: both; padding-right: 1.25rem }
}

Simple Responsive Modal - Script Codes JS Codes

function openLightBox(){ var modal = $('.modal');
$('.show-modal').on('click', function() { modal.fadeIn();
});
$('.close-modal').on('click', function() { modal.fadeOut();
});
}
openLightBox();
Simple Responsive Modal - Script Codes
Simple Responsive Modal - Script Codes
Home Page Home
Developer Chris Maki
Username chrisMaki
Uploaded August 12, 2022
Rating 3
Size 2,272 Kb
Views 46,552
Do you need developer help for Simple Responsive Modal?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chris Maki (chrisMaki) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!