Super Simple Modal
How do I make an super simple modal?
What is a super simple modal? How do you make a super simple modal? This script and codes were developed by Stephen Fray on 20 January 2023, Friday.
Super Simple Modal - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Super Simple Modal</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Super Simple Modal Test</h1>
<div class="modal_launch">Launch Modal</div>
<div class="modal" style="display:none;"> <div class="modal_content"> <h2>Test Modal</h2> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <div class="close">Close</div> </div> <div class="overlay"></div>
</div>
<div class="text-block"> <p><b>Test blocks of text</b> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Super Simple Modal - Script Codes CSS Codes
body { font-family: arial; background-color: #f9fede; text-align: center;
}
.text-block { max-width: 500px; margin: auto;
}
.text-block p { margin: 100px 0;
}
.modal_launch { background-color: #2bbfac; display: inline-block; padding: 15px 30px; border-radius: 40px; color: #fff; cursor: pointer;
}
.modal_launch:hover { background-color: #159a89;
}
.modal { text-align: center; position: fixed; top: 0; bottom: 0; right: 0; left: 0; padding: 5vh 15px; min-height: 90vh; overflow: auto;
}
.modal .overlay { background-color: rgba(0, 0, 0, 0.3); position: fixed; top: 0; bottom: 0; right: 0; left: 0; z-index: 9999;
}
.modal .modal_content { background-color: white; padding: 30px; max-width: 500px; margin: auto; z-index: 999999; position: relative;
}
.modal .modal_content .close { background-color: #ccc; display: inline-block; padding: 15px 30px; border-radius: 50px; cursor: pointer;
}
.modal .modal_content .close:hover { background-color: #666; color: #fff;
}
Super Simple Modal - Script Codes JS Codes
$(function(){ if ($(".modal").length) { var $modal_launch = $(".modal_launch"), $modal = $(".modal"), $modal_overlay = $modal.find(".overlay"), $modal_content = $modal.find(".modal_content"), $close = $modal_content.find(".close"); $modal_launch.click( function(){ var $window_height = $( window ).height(); $modal.fadeIn(); center_modal($window_height); } ); $modal_overlay.click( function(){ close_modal(); } ); $close.click( function(){ close_modal(); } ); function close_modal(){ $modal.fadeOut(); } function center_modal($window_height) { var $modal_content_height = $modal_content.height(), $center_minus = $window_height - $modal_content_height, $center = $center_minus / 3; if($center < 0) { $center = 15; } $modal.css("padding-top",+$center+"px"); } }
})
Developer | Stephen Fray |
Username | stepfray |
Uploaded | January 20, 2023 |
Rating | 3 |
Size | 3,182 Kb |
Views | 4,048 |
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 |
Counter rotating CSS elements | 1,749 Kb |
Flexbox Test | 1,757 Kb |
Full screen slider mk2 | 3,265 Kb |
Form Submit - Tick Confirmation | 3,007 Kb |
Pure CSS Slanted Shadows | 1,901 Kb |
Fixed width, fluid Background with one element | 1,897 Kb |
Flexbox Test Centered Content | 1,734 Kb |
Hc first draft | 5,104 Kb |
Blur Filter | 1,767 Kb |
Full Screen slider mk3 | 4,244 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 |
Very Simple Slider | Doodlemarks | 2,682 Kb |
BSP Dungeon Generation | Xgundam05 | 5,326 Kb |
3D-box | Parthviroja | 2,346 Kb |
SnappySnippet Test | Elmsoftware | 8,385 Kb |
A Pen by Alex Bergin | Abergin | 3,347 Kb |
Animated bar chart | CreativePunch | 3,124 Kb |
Dragonball Dragon Radar | DouglasGlover | 2,157 Kb |
Add This API | ThatGuySam | 2,848 Kb |
Twitch Live Channels | Inkblotty | 4,956 Kb |
Parallax scrolling scene | Iharosi | 2,485 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!