Simple Responsive Modal
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 - 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();
Developer | Chris Maki |
Username | chrisMaki |
Uploaded | August 12, 2022 |
Rating | 3 |
Size | 2,272 Kb |
Views | 46,552 |
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!
Name | Size |
Css expanding search | 1,728 Kb |
Overlay using mix-blend-mode | 2,771 Kb |
Morphing svg using Kute.js | 2,417 Kb |
JQuery style fade in with regular JavaScript | 2,508 Kb |
Show dialogue with blur animation | 2,085 Kb |
A Pen by chris maki | 2,711 Kb |
Mobile navigation using GSAP | 3,145 Kb |
Objects move into place when scrolled into view | 2,175 Kb |
Parallax Type Thing | 7,000 Kb |
Light bulb svg loader | 2,344 Kb |
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!
Name | Username | Size |
CSS only simple parallax scroll | Stanssongs | 3,708 Kb |
Toggling Divs with jQuery | Yying6 | 1,967 Kb |
Sidebar Thing | Jonambas | 2,779 Kb |
Progressively reveal dots on a Bezier curve | GreenSock | 2,489 Kb |
Free css icon set v2 - one div | Ben_jammin | 0 Kb |
Simple content swap | Snografx | 1,859 Kb |
Mapbox Directions with geolocation tracking | Pollardld | 5,827 Kb |
Button shaking | SusanneLundblad | 2,227 Kb |
Responsive Table-less Shopping Cart | Alex_rodrigues | 6,637 Kb |
Fellowship of the Ring | Aussieyang | 2,639 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!