Super Simple Modal

Developer
Size
3,182 Kb
Views
4,048

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 Previews

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");	}	}
})
Super Simple Modal - Script Codes
Super Simple Modal - Script Codes
Home Page Home
Developer Stephen Fray
Username stepfray
Uploaded January 20, 2023
Rating 3
Size 3,182 Kb
Views 4,048
Do you need developer help for Super Simple 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!

Stephen Fray (stepfray) Script Codes
Create amazing sales emails 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!