I implemented a modal window with partial view using bootstrap, the problem is that when I open my modal it leaves the main view blocked, giving it a black color
When I inspect the item with the console of my browser, I can not find the control that gives the property of the fund to the manners
Incorporate a template of Boostrapwatch for some time in my project, I enclose the code:
.modal-open {
overflow: hidden;
}
.modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1050;
display: none;
overflow: hidden;
outline: 0;
}
.modal-open .modal {
overflow-x: hidden;
overflow-y: auto;
}
.modal-dialog {
position: relative;
width: auto;
margin: 0.5rem;
pointer-events: none;
}
.modal.fade .modal-dialog {
-webkit-transition: -webkit-transform 0.3s ease-out;
transition: -webkit-transform 0.3s ease-out;
transition: transform 0.3s ease-out;
transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
-webkit-transform: translate(0, -25%);
transform: translate(0, -25%);
}
.modal.show .modal-dialog {
-webkit-transform: translate(0, 0);
transform: translate(0, 0);
}
.modal-dialog-centered {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
min-height: calc(100% - (0.5rem * 2));
}
.modal-content {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
width: 100%;
pointer-events: auto;
background-color: #4E5D6C;
background-clip: padding-box;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 0;
outline: 0;
}
.modal-backdrop {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1040;
background-color: #000;
}
.modal-backdrop.fade {
opacity: 0;
}
.modal-backdrop.show {
opacity: 0.5;
}
.modal-header .close {
padding: 1rem;
margin: -1rem -1rem -1rem auto;
}
.modal-title {
margin-bottom: 0;
line-height: 1.5;
}
I have to put some additional class in my modal window?
<div class="modal" id="myModalEditar">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Editar Producto</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="EditModalBody">
</div>
</div>
</div>
</div>
do I have to create another css property? What is wrong with this? any help for me?
It's the Bootstrap modal backdrop you'll want to hide. To do so you could add this style:
.modal-backdrop {
display: none;
}
or change the opacity:
.modal-backdrop {
opacity: 0;
}
Related
Does anyone know why the input box might be glitching only on iOS but works fine on Android? I have attached two videos for better explanation of this problem. Basically on iOS I would have to tap the input field twice for it to go into 'active' state and afterwards when I try type it zooms in so much into the screen to type. No issues like this in the browser as well.
iOS - https://streamable.com/e622tj
Android - https://streamable.com/4zvns6
<div
id='task-writer'
onClick={() => {
inputRef.current?.focus();
}}
>
<div className='left'>
<label>
<input
type='checkbox'
defaultChecked={checked}
onChange={() => setChecked(!checked)}
/>
<div className='checkbox-div' />
</label>
<form
className='NewTodoForm'
id='task-form'
onSubmit={handleSubmit}
ref={formRef}
>
<input
value={userInput.task}
onChange={handleChange}
id='task'
type='text'
name='task'
placeholder='Add your task here...'
autoComplete='off'
ref={inputRef}
// onFocus={() => {
// console.log('focused');
// setIsFocused(true);
// }}
// onBlur={() => {
// console.log('blurred');
// inputRef.current?.focus();
// setIsFocused(false);
// }}
/>
</form>
</div>
CSS Code:
#task-writer {
display: flex;
flex-direction: row;
width: 100%;
align-items: center;
padding: 10px;
padding-left: 20px;
padding-right: 15px;
border-radius: 20px;
background-color: #f5f7fa;
.left {
display: flex;
flex-direction: row;
width: 100%;
height: 100%;
align-items: center;
gap: 20px;
padding: 10px 0;
label {
display: grid;
place-items: center;
width: 30px;
height: 30px;
cursor: pointer;
input {
display: none;
}
form {
width: 100%;
height: 100%;
overflow: hidden;
transform: translateX(-50px);
transition: 0.25s ease;
transition-property: transform;
input {
width: 100%;
height: 100%;
border: none;
outline: none;
font-family: 'Inter var', sans-serif;
font-size: clamp(12px, 1.65vw, 16px);
font-weight: 400;
color: #000;
background-color: transparent;
}
}
}
right-calendar-date {
position: relative;
display: flex;
flex-direction: row;
height: 40px;
width: fit-content;
align-items: center;
gap: 12px;
padding: 0px 12px;
margin-left: 12px;
border-radius: 10px;
padding-right: 40px;
cursor: pointer;
color: #6d6d6d;
background-color: #EAEDEE;
opacity: 0;
pointer-events: none;
transition: 0.25s ease;
transition-property: opacity;
h4 {
overflow: hidden;
white-space: nowrap;
color: #000;
}
}
.date-form {
display: grid;
place-items: center;
height: 30px;
width: 80px;
padding: 0 16px;
border-radius: 10px;
opacity: 0;
cursor: pointer;
color: #6d6d6d;
background-color: #eaedee;
transition: 0.25s ease;
transition-property: background-color;
:hover {
background-color: #d9d9d9;
}
h4 {
font-size: clamp(12px, 1.65vw, 14px);
font-weight: 500;
}
}
I've tried to do animations on hover with animate.css . Everything works, on desktop (safari, chrome) and mobile too(chrome), but not in Safari(iOS).
iOS Chrome | iOS Safari
//main flexbox
.ref {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
align-content: center;
}
//flexbox child
.ref-content {
height: 350px;
//background: grey;
width: 50%;
transition: 0.75s;
background-size: cover !important;
}
// flexbox text
.ref-text {
text-align: center;
display: none;
position: relative;
transition: 2.5s !important;
width: 100%;
height: 100%;
-webkit-animation: fadeIn 1s;
animation: fadeIn 1s;
h1 {
position: relative;
top: 30%;
display: block;
text-transform: uppercase;
padding-bottom: 10px;
// animate css použitý ako hover
-webkit-animation: fadeInLeft 1.5s;
animation: fadeInLeft 1.5s;
}
p {
position: relative;
top: 30%;
font-size: 1.5em;
// animate css použitý ako hover
-webkit-animation: fadeInLeft 1.75s;
animation: fadeInLeft 1.75s;
opacity: 0.75;
}
a {
display: block;
position: relative;
top: 35%;
// animate css použitý ako hover
-webkit-animation: fadeInLeft 2s;
animation: fadeInLeft 2s;
text-decoration: none;
background: #fff;
color: black;
max-width: 15%;
padding: 10px 0;
border-radius: 25px;
}
}
// ref 1
//ref1 background
.ref-content:nth-child(1) {
background-image: url('http://lavenderforluck.co/wp-content/uploads/2019/02/modern-home-office-desks-desk-designs-executive-options-for-ergonomics-sydney.jpg');
}
.ref-content:nth-child(1):hover .ref-text {
display: block;
color: #fff;
// fadeIn color overlay
-webkit-animation: fadeIn 1.5s;
animation: fadeIn 1.5s;
background: rgba(purple, 0.75);
}
// ref 2
.ref-content:nth-child(2) {
background-image: url('http://lavenderforluck.co/wp-content/uploads/2019/02/modern-home-office-desks-desk-designs-executive-options-for-ergonomics-sydney.jpg');
}
.ref-content:nth-child(2):hover .ref-text {
display: block;
color: #fff;
-webkit-animation: fadeIn 1s;
animation: fadeIn 1s;
background: rgba(black, 0.75);
}
<!-- referencie -->
<div class="ref">
<div class="ref-content">
<div class="ref-text">
<h1>RIVER VIEW RESIDENCE BRATISLAVA</h1>
<p>#web #webdesign #forms #campaing</p>
Zobraziť
</div>
</div>
<div class="ref-content">
<div class="ref-text">
<h1>RIVER VIEW RESIDENCE BRATISLAVA</h1>
<p>#web #webdesign #forms #campaing</p>
Zobraziť
</div>
</div>
</div>
Can someone help me to solve my problem?
I've tried to do animations.
I would be glad, if someone can resolve my problem
Any error message, everything is in screenshot :-)
I've tried lot of options to solve my problem but any of them didnt work well...
I was looking for some answers on stackoverflow too, but i didnt find any answer with problem like this...
You will need to create an overlay! and also in class .ref-text you can "play" with opacity:0; and not with the display: none;.
//scss code
.ref-content{
position: relative;
.ref-text{
opacity: 0;
position: relative;
z-index: -1;
}
&:before {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0;
background: rgba(0, 0, 0, 0.35); //put your rgba color here
-webkit-transition: opacity 0.2s ease;
transition: opacity 0.2s ease;
content: '';
z-index: -1;
}
&:hover{
&:before{
opacity: 1;
-webkit-transition: opacity 0.2s ease;
transition: opacity 0.2s ease;
}
.ref-text{
opacity: 1;
position: relative;
z-index: 1;
-webkit-transition: opacity 0.2s ease;
transition: opacity 0.2s ease;
}
}
}
I have this message thread component that has a header, content and a textarea and everytime. The issue here is in mobile views, when I want to type a message the keyboard on IOS (Iphones) pushes the divs up so the header would be hidden, I don't want this behavior, for Android it doesn't behave like this. This app is using React and scss and the code is this:
<div className="message-thread-wrapper d-flex flex-column">
<div className="messages-header d-flex flex-row justify-content-between align-items-center">
<Icon
className="back-btn d-lg-none"
icon="chevron-left"
onClick={(e) => {
e.stopPropagation();
actions.closeMessage();
}}
/>
<h5 className="messages-title text-truncate">
{participant.firstname && participant.lastname ? `${participant.firstname} ${participant.lastname}` : participant.name}
</h5>
<div className="messages-header-right d-flex flex-row align-items-center">
<Icon
className="settings-btn"
icon="settings"
onClick={(e) => {
e.stopPropagation();
this.toggleDeleteMenu();
}}
/>
}
<Icon
className="close-btn-cross d-none d-lg-block"
icon="cross"
onClick={(e) => {
e.stopPropagation();
this.setState(
{isMinimized: false},
actions.closeMessage
);
}}
/>
</div>
</div>
{showDeleteMenu &&
<DeleteMenu onClick={this.archiveMessage} onClickOutside={this.toggleDeleteMenu}/>
}
{
this.renderMessages()
}
<div
className="bottom-actions d-flex flex-row flex-nowrap justify-content-between align-items-center">
<TextArea
ref={ref => this.messageInput = ref}
className="input blue d-block"
name="msgText"
placeholder="Type your message..."
.
.
.
.
autoFocus
/>
<Button
className={`send-btn circle ${IS_SAFARI ? 'safari-fix-button' : ''}`}
icon="paper-plane"
onClick={this.onSendMessage}
/>
</div>
}
</div>
and the scss file:
.message-thread-wrapper {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0;
z-index: 950;
.messages-header {
padding: 19px 16px 14px 16px;
width: 100%;
flex-basis: 57px;
color: white;
pointer-events: none;
position:sticky;
.back-btn {
pointer-events: auto;
}
.close-btn-cross {
width: 18px;
height: 18px;
pointer-events: auto;
}
.settings-btn {
width: 25px;
height: 26px;
pointer-events: auto;
}
}
.delete-menu {
border-radius: 2px;
background-color: white;
position: absolute;
top: 53px;
right: 0px;
z-index: 1;
.menu-arrow {
width: 15px;
height: 15px;
position: absolute;
top: 0;
right: 0;
background: white;
border-right: none;
border-bottom: none;
}
a {
padding: 18px;
font-size: 16px;
line-height: 1.5;
text-decoration: none;
z-index: 1;
cursor: pointer;
}
}
.messages-content {
height: 100%;
padding: 16px;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
.dateline {
margin: 28px 0 11px 0;
line-height: 1.33;
text-align: center;
}
}
.bottom-actions {
bottom: 0;
width: 100%;
max-height: 130px;
min-height: 70px;
overflow-y: hidden;
padding: 0 0 0 24px;
background-color: white;
box-shadow: 0 -1px 3px 0 #d9dbdc;
.form-group-wrapper {
padding-top: 10px;
width: 100%;
align-self: stretch;
overflow: auto;
&.text-area-wrapper {
padding-right: 71px;
textarea {
min-height: 48px;
}
.form-bar {
display: none;
}
}
}
.button.circle {
width: 34px;
height: 34px;
padding: 9px 12px 9px 8px;
position: fixed;
right: 26px;
&.safari-fix-button {
bottom: 22px;
}
}
}
}
Note I deleted the properties that are not important for this question so it won't be too long.
This is how it currently behaves:
Iphone:
Android - Pixel 2XL:
I would appreciate if Any could help me. Thank you in advance!
I am having a hard time figuring out how to have my mobile menu icon animate on click. It would be ideal if I could click the menu icon and the menu would just slide in using animate.css fadeInDown and then when clicked again to exit the menu if it used animate.css fadeOutUp. Is there any way to do this using JS too? I really want to learn.
Here is the html:
<header>
<div id="pic-1">
<img id="top" src="css/Unknown.png" class="log animated fadeInDown">
<nav>
<a class="burger-nav animated fadeInDown"><i class="fas fa-bars"></i>
</a>
<ul class="li animated fadeInDown">
<li><a>Home</a></li>
<li><a>About Us</a></li>
<li><a>Contact Us</a></li>
<li><a>Volunteer</a></li>
</ul>
</nav>
</div>
</header>
Here is the CSS (media queries):
/* Mobile 1 */
#media only screen and (min-width : 320px) {}
.checkBox {
display: none;
}
.logo {
display: none;
}
.log {
position: fixed;
z-index: 999;
left: -2%;
height: 10%;
width: 35%;
padding-top: 2%;
padding-right: 33%;
padding-left: 33%;
border: solid white;
background-color: white;
}
.burger-nav {
position: fixed;
z-index: 999;
left: 85%;
top: 1%;
font-size: 300%;
}
header nav ul {
overflow: hidden;
height: 0;
margin-top: 70px;
width: 100%;
margin-left: -40px;
position: fixed;
z-index: 999;
}
header nav ul.open {
height: auto;
}
header nav ul li {
text-align: center;
width: 100%;
margin: 0;
list-style-type: none;
font-family: Jazz LET, fantasy;
font-size: 17px;
word-spacing: 7px;
letter-spacing: 5px;
font-weight: bold;
}
header nav ul li a:hover {
}
header nav ul li a {
color: #FF6103;
padding: 10px;
border-bottom: 1px solid white;
display: block;
background-color: black;
opacity: .5;
}
.li {
-webkit-animation-duration: 1s;
-webkit-animation-delay: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-duration: 1s;
-moz-animation-delay: 1s;
-moz-animation-iteration-count: 1;
-o-animation-duration: 1s;
-o-animation-delay: 1s;
-o-animation-iteration-count: 1;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: 1;
}
.fas {
color: purple;
}
#pic-1 {
background-size: 120% 100%;
}
#pic-2 {
background-size: 123% 100%;
}
#pic-3 {
background-size: 120% 100%;
}
.social {
display: none;
}
.circle {
display: none;
}
}
And here is some JS I've used:
$(document).ready(function(){
$(".burger-nav").on("click", function(){
$("header nav ul").toggleClass("open")
});
});
I hope someone can help! Thank you!
Well css-animations are a bit tricky. But nothing that can't be solved. First of all you should use #keyframes. A good explanation can be found here. The trick is to toggle two classes (.open and .close) which will handle your opening and closing animation. Important is the animation-fill-mode attribute to keep your animation sticking with it's final state. Also you can not use height: auto; because it needs to be a real value. max-height: 1000px; will do the trick. So you animate from max-height: 0; to max-height: 1000px; and vice versa. Here is your simplified code as a runnable snippet:
$(document).ready (function() {
$('.burger-nav').on ('click', function () {
//check if class open is already set then toggle
if ($('header nav ul').hasClass ('open'))
$('header nav ul').toggleClass ('close open');
else {
$('header nav ul').removeClass ('close');
$('header nav ul').addClass ('open');
}
});
});
header nav ul {
overflow: hidden;
max-height: 0; //<-- this needs to be changed
margin-top: 70px;
width: 100%;
margin-left: -40px;
position: fixed;
z-index: 999;
}
header nav ul li {
text-align: center;
width: 100%;
margin: 0;
list-style-type: none;
font-family: Jazz LET, fantasy;
font-size: 17px;
word-spacing: 7px;
letter-spacing: 5px;
font-weight: bold;
}
header nav ul li a {
color: #FF6103;
padding: 10px;
border-bottom: 1px solid white;
display: block;
background-color: black;
opacity: .5;
}
.li {
-webkit-animation-duration: 1s;
-webkit-animation-delay: 1s;
-webkit-animation-iteration-count: 1;
-moz-animation-duration: 1s;
-moz-animation-delay: 1s;
-moz-animation-iteration-count: 1;
-o-animation-duration: 1s;
-o-animation-delay: 1s;
-o-animation-iteration-count: 1;
animation-duration: 1s;
animation-delay: 1s;
animation-iteration-count: 1;
}
header nav ul.open {
animation-name: open;
animation-name: open;
animation-fill-mode: forwards;
}
#keyframes open {
from {max-height: 0;}
to {max-height: 1000px;}
}
header nav ul.close {
animation-name: close;
animation-name: close;
animation-fill-mode: both;
}
#keyframes close {
from {max-height: 1000px;}
to {max-height: 0;}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<header>
<nav>
click_me
<ul class="li animated fadeInDown">
<li><a>Home</a></li>
<li><a>About Us</a></li>
<li><a>Contact Us</a></li>
<li><a>Volunteer</a></li>
</ul>
</nav>
</header>
I have problem with my View in asp.net mvc project. I added new checkboxFor element on this view:
<div class="col-md-6">
<div class="form-group">
<div class="checkbox clip-check check-primary">
#Html.CheckBoxFor(x => x.IsHomePage)
<label for="isHomePage">
Is Home Page
</label>
</div>
</div>
</div>
And this is my css:
.clip-check {
margin-bottom: 10px;
margin-top: 10px;
padding-left: 0;
}
.clip-check label {
cursor: pointer;
display: inline-block;
font-size: 13px;
margin-right: 15px;
padding-left: 30px !important;
position: relative;
line-height: 23px;
transition: border 0.2s linear 0s, color 0.2s linear 0s;
white-space: nowrap;
}
.clip-check label:before {
background-color: #ffffff;
border: 1px solid #c8c7cc;
content: "";
display: inline-block;
height: 20px;
left: 0;
margin-right: 10px;
position: absolute;
width: 20px;
border-radius: 0;
top: 1px;
transition: border 0.2s linear 0s, color 0.2s linear 0s;
}
.clip-check label:after {
display: inline-block;
font-size: 11px;
height: 19px;
left: 4px;
position: absolute;
top: -1px;
transition: border 0.2s linear 0s, color 0.2s linear 0s;
width: 19px;
}
.clip-check input[type="checkbox"] {
display: none;
}
.clip-check input[type="checkbox"]:checked + label:before {
border-width: 10px;
}
.clip-check input[type="checkbox"]:checked + label:after {
color: #fff;
content: "\f00c";
font-family: "FontAwesome";
}
.clip-check input[type="checkbox"][disabled] + label {
opacity: 0.65;
}
.clip-check input[type="checkbox"][disabled] + label:before {
background-color: #F8F8F8;
}
but after built and check from browser, I am not able to hit to check this checkbox, even I have done successfully with other checkbox as well. I am using bootstrap. Much appreciate to any help, thank you.
I have just checked carefully your css, you wrote everything for label element. You already hided checkbox input and draw the rectangle by css as well. Please see this code:
.clip-check label {
cursor: pointer;
display: inline-block;
font-size: 13px;
margin-right: 15px;
padding-left: 30px !important;
position: relative;
line-height: 23px;
transition: border 0.2s linear 0s, color 0.2s linear 0s;
white-space: nowrap;
}
.clip-check label:before {
background-color: #ffffff;
border: 1px solid #c8c7cc;
content: "";
display: inline-block;
height: 20px;
left: 0;
margin-right: 10px;
position: absolute;
width: 20px;
border-radius: 0;
top: 1px;
transition: border 0.2s linear 0s, color 0.2s linear 0s;
}
.clip-check label:after {
display: inline-block;
font-size: 11px;
height: 19px;
left: 4px;
position: absolute;
top: -1px;
transition: border 0.2s linear 0s, color 0.2s linear 0s;
width: 19px;
}
So if your label is not pointed to exactly the checkbox input with Id is IsHomePage (what will be rendered from asp.net server) then the style will not be changed :after. So your problem here :
<label for="isHomePage">
Please change isHomePage to IsHomePage, because of name of your field is IsHomePage.