Stack Overflow Asked by DDulla on December 25, 2020
I’m trying to create a modal that contains the following properties:
Issues:
Picture of desktop/mobile (Scrollable section in red for clarity):
Code:
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
.modal {
overflow: hidden;
}
.modal-wrapper{
display:flex;
flex-direction:row;
align-items:stretch;
}
.modal-main{
/* display:flex;
flex:25%; */
}
.modal-sidebar{
display:flex;
background-color:red;
height:100%;
}
.modal-header {
padding: 15px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
width:100%
}
.modal-header h4 {
margin: 0;
}
.modal-content {
height: auto !important;
max-height: calc(100vh - 340px) !important;
}
.content-row {
display: flex;
align-items: center;
padding: 10px;
border-bottom: 1px solid #ddd;
}
.content-row:last-child {
border-bottom: none;
}
.icon {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: #33b5e5;
color: #fff;
}
.name {
padding: 0 10px;
}
.role {
padding: 0 10px;
flex: 1;
text-align: right;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.css" rel="stylesheet"/>
<!-- Modal Trigger -->
<a class="modal-trigger waves-effect waves-light btn" href="#modal1">Modal</a>
<!-- Modal Structure -->
<div id="modal1" class="modal modal-fixed-footer">
<div class="modal-wrapper">
<div class="modal-sidebar">
<h4>Modal Sidebar</h4>
</div>
<div class="modal-main">
<div class="modal-header">
<h4>Modal Header</h4>
</div>
<div class="modal-content">
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
<div class="content-row">
<div class="icon">1</div>
<div class="name">Name</div>
<div class="role">Role</div>
</div>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">Agree</a>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/js/materialize.min.js"></script>
For the parent container that defines rule display: flex
, you can use rule height: 100%
.
.modal-wrapper {
...
height: 100%;
}
Answered by sergey kuznetsov on December 25, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP