Absolutely positioned element won't show over other element - html

Im trying to make the div element 'tiktok-webapp-mobile-player-container' show over the div element 'video card' but I can't get it to do so. Both divs are inside a parent container with position:relative.
Im using swiperjs library with video thumbnail inside each slide. When user begins swiping up the thumbnail is set to display: none and the video element should be visible as it is absolutely positioned and should show over all other elements in the parent container.
HTML
<div class="jeg_viewport">
<script src="https://cdn.jsdelivr.net/npm/swiper/swiper-bundle.min.js"></script>
<div class="jeg_main">
<div class="jeg_container">
<div id="video-card" style="/* position: relative; */">
<div class="swiper mySwiper swiper-initialized swiper-vertical swiper-ios">
<div class="swiper-wrapper" id="swiper-wrapper-1d8f101a772932878" aria-live="polite" style="transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;">
<div class="swiper-slide swiper-slide-active" style="height: 896px;" role="group" aria-label="1 / 11">
<div height="100%" class="slide-container">
<img
class="video-img"
src=" "
width="414"
height="896"
data-pin-no-hover="true"
style="display: none;"
/>
</div>
</div>
<div class="swiper-slide swiper-slide-next" style="height: 896px;" role="group" aria-label="2 / 11">
<div height="100%" class="slide-container"><img class="video-img" src="" data-pin-no-hover="true" /></div>
</div>
<span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>
</div>
</div>
<div id="tiktok-webapp-mobile-player-container" height="100%" class="">
<div style="width: 100%; height: 100%;">
<video
autoplay=""
playsinline=""
preload="auto"
id="vidplayer"
style="width: 100%; height: 100%; object-fit: cover; z-index: 3; position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;"
src="https://questimesja.com/wp-content/uploads/2023/01/Snaptik.app_7174034252663737606.mp4"
></video>
</div>
<div class="blur-background" style="background-image: url();"></div>
</div>
</div>
</div>
</div>
CSS
.jeg_share_top_container{display:none;} .entry-header{display:none;}
html, body {
position: relative;
height: 100%;
}
#vidplayer{ }
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;color: #000;margin: 0;padding: 0;
}
.jeg_content{padding:0:}
.jeg_main{padding:0;position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;}
.jeg_featured .featured_image{display:none;}
.entry-content{ margin: 0!important;}
.jeg_container{position:relative;max-height: calc(100% - 49px);}
.swiper {width: 100%;height: 100vh!important;z-index:4;}
.swiper-slide {
text-align: center;font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
#tiktok-webapp-mobile-player-container video {
display:block;
}
#tiktok-webapp-mobile-player-container{
width: 100vw;
top: 0;
opacity: 1;
position: absolute;
height: 100%;
pointer-events:none;
}
.slide-container{width:100%;position:relative;height:100%;}
.video-img{width: 100%;
height: 100%;
object-fit: cover; }
#video-card{ width:100%; height:100%;}
#footer{display:none;}

Related

How can I use jquery to count the child divs within a parent div and display the order number within each child div?

I'm currently building a CMS gallery list within Webflow and I'd like to automatically display a number within each individual child div.
I can see that I probably need to implement some sort of jquery code and I'm struggling rewrite existing solutions.
In the code below, I want to count the number of children within .feature-slider_list and then display the child order number within .feature-slider_number.
Any help would be much appreciated!
.feature-slider_item {
width: 200px;
height: 200px;
margin-bottom: 50px;
background-color: black;
}
.feature-slider_wrap {
position: relative;
}
.feature-slider_number {
position: absolute;
left: 30px;
top: auto;
right: auto;
bottom: 30px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
width: 70px;
height: 70px;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
border-radius: 10px;
background-color: #00d6d6;
-webkit-transform: rotate(-6deg);
-ms-transform: rotate(-6deg);
transform: rotate(-6deg);
color: #fff;
font-size: 2rem;
line-height: 2.5rem;
font-weight: 700;
}
<div class="feature-slider_list">
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
</div>
Please add jQuery code to loop through the slider items and add index.
$(document).ready(function(){
$('.feature-slider_list').children().each(function (index) {
$(this).find('.feature-slider_number').html(index+1);
});
}
)
.feature-slider_item {
width: 200px;
height: 200px;
margin-bottom: 50px;
background-color: black;
}
.feature-slider_wrap {
position: relative;
}
.feature-slider_number {
position: absolute;
left: 30px;
top: auto;
right: auto;
bottom: 30px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
width: 70px;
height: 70px;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
border-radius: 10px;
background-color: #00d6d6;
-webkit-transform: rotate(-6deg);
-ms-transform: rotate(-6deg);
transform: rotate(-6deg);
color: #fff;
font-size: 2rem;
line-height: 2.5rem;
font-weight: 700;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="feature-slider_list">
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number">1</div>
</div>
</div>
</div>
Use ::after and content with attr. And I added height:100% to feature-slider_item and bottom: -30px; to .feature-slider_number to fix that one element with an index was not showing up.
.feature-slider_item {
width: 200px;
height: 200px;
margin-bottom: 50px;
background-color: black;
}
.feature-slider_wrap {
position: relative;
height:100%;
}
.feature-slider_number::after {
content: attr(index);
}
.feature-slider_number {
position: absolute;
left: 30px;
top: auto;
right: auto;
bottom: -30px;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
width: 70px;
height: 70px;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
border-radius: 10px;
background-color: #00d6d6;
-webkit-transform: rotate(-6deg);
-ms-transform: rotate(-6deg);
transform: rotate(-6deg);
color: #fff;
font-size: 2rem;
line-height: 2.5rem;
font-weight: 700;
}
<div class="feature-slider_list">
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number" index="1"></div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number" index="2"></div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number" index="3"></div>
</div>
</div>
<div class="feature-slider_item">
<div class="feature-slider_wrap">
<img src="" class="feature-slider_image">
<div class="feature-slider_number" index="4"></div>
</div>
</div>
</div>

Delay Hover Effect - prevent switching off overlay

I created a hover effect that is blurring out a picture and a text-description appears.
Now as soon as I hover above the description, I dont hover the image and the effect is failing, which I would like to prevent.
I assume that if I could target the hovered - version of the description, I could make it set sort of itself to be visible, but I am not sure about this.
Any other ideas how I can create this?
.flexbox{
position: relative;
display: flex;
height: 70vh;
flex-direction: row;
width: 90%;
margin-left: 5%;
max-height: 80vh;
}
.container{
width: 100%;
max-height: inherit;
padding: 0;
margin: 1%;
display:block;
text-align: center;
}
.image-category{
width: 100%;
object-fit: cover;
height: 100%;
opacity: 0.95;
max-height: inherit;
overflow: hidden;
}
.image-description{
padding: 10px;
transform: translateY(-30vh);
opacity: 0;
z-index: -1;
font-size: 20px;
}
.image-category:hover{
filter: blur(2px);
}
.image-category:hover ~ .image-description{
opacity: 100;
z-index: 2;
}
.description{
font-size: 1.25em;
background: rgba(255, 255, 255, 0.7);
}
.claim{
padding: 1vh 0 1vh 0;
width: 100%;
text-align: center;
}
Delay Hover
<div class="flexbox" id="flex">
<div class="container" id="box1">
<a class="image-category" href="https://amh-solingen.de/scheren.html">
<img class="image-category" id="product3" src="/images/Schere.jpg">
</a>
<div class="image-description">
<p class="description">Haushalts- und Friseurscheren</p>
</div>
</div>
<div class="container" id="box2">
<a class="image-category" href="https://amh-solingen.de/haushaltsmesser.html">
<img class="image-category" id="product2" src="/images/Hero.png">
</a>
<div class="image-description">
<p class="description">Aktuelle Auswahl an Küchenmessern</p>
</div>
</div>
<div class="container" id="box3">
<a class="image-category" href="https://amh-solingen.de/klingen.html">
<img class="image-category" id="product3" src="/images/Klinge_7.jpg">
</a>
<div class="image-description">
<p class="description">Klingen für Haushaltsmesser</p>
</div>
</div>
</div>
use this code:
.flexbox{
position: relative;
display: flex;
height: 70vh;
flex-direction: row;
width: 90%;
margin-left: 5%;
max-height: 80vh;
}
.container{
width: 100%;
max-height: inherit;
padding: 0;
margin: 1%;
display:block;
text-align: center;
}
.image-category{
width: 100%;
object-fit: cover;
height: 100%;
opacity: 0.95;
max-height: inherit;
overflow: hidden;
}
.image-description{
padding: 10px;
transform: translateY(-30vh);
opacity: 0;
z-index: -1;
font-size: 20px;
}
.container:hover .image-category{
filter: blur(2px);
}
.container:hover .image-description{
opacity: 100;
z-index: 2;
}
.description{
font-size: 1.25em;
background: rgba(255, 255, 255, 0.7);
}
.claim{
padding: 1vh 0 1vh 0;
width: 100%;
text-align: center;
}
Delay Hover
<div class="flexbox" id="flex">
<div class="container" id="box1">
<a class="image-category" href="https://amh-solingen.de/scheren.html">
<img class="image-category" id="product3" src="/images/Schere.jpg">
</a>
<div class="image-description">
<p class="description">Haushalts- und Friseurscheren</p>
</div>
</div>
<div class="container" id="box2">
<a class="image-category" href="https://amh-solingen.de/haushaltsmesser.html">
<img class="image-category" id="product2" src="/images/Hero.png">
</a>
<div class="image-description">
<p class="description">Aktuelle Auswahl an Küchenmessern</p>
</div>
</div>
<div class="container" id="box3">
<a class="image-category" href="https://amh-solingen.de/klingen.html">
<img class="image-category" id="product3" src="/images/Klinge_7.jpg">
</a>
<div class="image-description">
<p class="description">Klingen für Haushaltsmesser</p>
</div>
</div>
</div>

column image behave as background image

I have two columns using flexbox but does not have to use flexbox. just using it at the moment but am open to other options. The left side is content with a width of 450px and the right column I have an image that needs to behave as a background image but not use css background property. Is there a way to set the image size / image column and have it overflow out of containers and not push the left column content?
setting container widths and using relative positioning but not scaling or behaving as I would like
.row--flex {
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
margin: 0;
}
.content-col--450 {
max-width: 450px;
}
.content-col {
margin-bottom: auto;
margin-top: 97px;
padding-bottom: 20px;
}
.image-col {
padding-left: 10px;
}
}
.image {
width: 100%;
height: auto;
}
<div class="container container--outer">
<div class="row--flex">
<!--content-->
<div class="content-col content-col--450">
<div class="title-row">
<h2>
testing h2
</h2>
</div>
<div class="content-row">
<p class="p-margin-bottom">
testing P
</p>
<p class="lead">
download test
</p>
<button class="button--arrow">
<span class="button--text">download now</span>
</button>
</div>
</div>
<!--end content-->
<!--image-->
<div class="image-col">
<img src="/img/right-image.png" alt="right column image" class="image-test">
</div>
<!--end image-->
</div>
column 450 stay in place and image overflow out of containers and behave as BG image
You need something like this?
.row--flex {
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
margin: 0;
}
.content-col--450 {
/* max-width: 450px; */
flex-basis: 450px;
}
.content-col {
margin-bottom: auto;
margin-top: 97px;
padding-bottom: 20px;
}
.image-col {
position: relative;
flex-basis: 450px;
align-self: stretch;
padding-left: 10px;
}
.image-test {
position: absolute;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
object-fit: cover;
}
.image {
width: 100%;
height: auto;
}
<div class="container container--outer">
<div class="row--flex">
<div class="content-col content-col--450">
<div class="title-row">
<h2>
testing h2
</h2>
</div>
<div class="content-row">
<p class="p-margin-bottom">
testing P
</p>
<p class="lead">
download test
</p>
<button class="button--arrow">
<span class="button--text">download now</span>
</button>
</div>
</div>
<div class="image-col">
<img class="image-test" src="https://picsum.photos/536/354" alt="right column image">
</div>
</div>
</div>

Flexbox trouble

I'm currently working a lot with flexboxes and have some trouble regarding the code below:
Why isn't the image being treated like a flexbox item
Why are the text items on the right, which are in another flexbox, spanning over the height of their div
* {
font-size: 11pt;
}
.categories-area {
margin-top: 80px;
display: flex;
justify-content: space-between;
position: relative;
left: 50%;
transform: translateX(-50%);
width: 83.59375%;
height: 218px;
}
.category {
position: relative;
width: 20vw;
min-width: 230px;
max-width: 282px;
height: 100%;
}
.category-title {
position: absolute;
width: 6vw;
min-width: 94px;
max-width: 106px;
height: 195px;
background-color: rgb(51, 112, 177);
z-index: -1;
}
.category-content {
display: flex;
align-items: center;
justify-content: space-around;
position: absolute;
top: 26px;
left: 2.943262411%;
width: 20vw;
min-width: 192px;
max-width: 273px;
height: 191px;
border: 1pt solid rgb(51, 51, 51);
background-color: rgb(255, 255, 255);
}
.text-content {
display: flex;
justify-content: space-between;
flex-direction: column;
height: 125px;
}
<body>
<div class="categories-area">
<div class="category">
<div class="category-title">
<div class="wrapper" style="width: 100%; height: 26px; font-size: 12pt;">
<span>something</span>
</div>
</div>
<div class="category-content">
<div style="position: relative; width: 132px; height: 100%;">
<a href="librarymain.html" title="whatever">
<img src="resources/buchcover.jpg" style="width: 87.179487179%;" />
</a>
</div>
<div class="text-content">
<span>
<img src="resources/kleinerPfeil.svg" style=" height: 1em;"/>something
</span>
<br />
<span>
<img src="resources/kleinerPfeil.svg" style=" height: 1em;"/>something else
</span>
<br />
<span>
<img src="resources/kleinerPfeil.svg" style=" height: 1em;"/>even more
</span>
<br />
<span>
<img src="resources/kleinerPfeil.svg" style=" height: 1em;"/>a little more
</span>
<br />
<span>
<img src="resources/kleinerPfeil.svg" style=" height: 1em;"/>the last bit
</span>
</div>
</div>
</div>
</div>
</body>
The images in front of the text are irrelevant, the buchcover.jpg is supposed to be a bookcover but for testing purposes anything should work.
Thanks in advance
What are you trying to accomplish here?
Your image is inside anchor tag and you the parent is displayed flex you need to target the <a ... >img</a> not the image.
The text is spanning because the hight is set to number so where the content suppose to wrap while the parent .text-content is setup to column without wrap even. I changed that to flex-flow: row wrap; change that to column and see the difference. You need to fix all your width and hight numbers.
Check My code:
body {
font-size: 11pt;
}
img {
display: block;
}
.categories-area {
margin-top: 80px;
position: relative;
left: 50%;
transform: translateX(-50%);
width: 83.59375%;
height: 218px;
}
.category {
display: flex;
flex-flow: row;
justify-content: space-between;
position: relative;
width: 20vw;
min-width: 230px;
max-width: 282px;
height: 100%;
}
.category-title {
position: absolute;
width: 6vw;
min-width: 94px;
max-width: 106px;
height: 195px;
background-color: rgb(51, 112, 177);
z-index: -1;
}
.category-content {
display: flex;
align-items: center;
justify-content: space-around;
position: absolute;
top: 26px;
left: 2.943262411%;
width: 20vw;
min-width: 192px;
max-width: 273px;
height: 191px;
border: 1pt solid rgb(51, 51, 51);
background-color: rgb(255, 255, 255);
}
.text-content {
display: flex;
justify-content: space-between;
flex-flow: row wrap;
height: 125px;
}
.text-content>span {
flex-basis: 100%;
}
<div class="categories-area">
<div class="category">
<div class="category-title">
<div class="wrapper" style="width: 100%; height: 26px; font-size: 12pt;">
<span>something</span>
</div>
</div>
<div class="category-content">
<div style="position: relative; width: 132px; height: 100%;">
<a href="librarymain.html" title="whatever">
<img src="http://via.placeholder.com/80/0f0" style="width: 87.179487179%;" />
</a>
</div>
<div class="text-content">
<span>
<img src="http://via.placeholder.com/10/0f0" style="height: 1em;"/>something
</span>
<span>
<img src="http://via.placeholder.com/10/0f0" style="height: 1em;"/>something else
</span>
<span>
<img src="http://via.placeholder.com/10/0f0" style="height: 1em;"/>even more
</span>
<span>
<img src="http://via.placeholder.com/10/0f0" style="height: 1em;"/>a little more
</span>
<span>
<img src="http://via.placeholder.com/10/0f0" style="height: 1em;"/>the last bit
</span>
</div>
</div>
</div>
</div>

Mobile Safari: Image with 100% height not visible in absolute positioned container

Demo: http://codepen.io/malte/pen/kDlbt
I am using an absolute positioned wrapper to center an image in a thumbnail frame. (Only) On mobile safari, the image won't be displayed. if you inspect the .image-pos container you'll see that the height is properly set to its parent's size. applying a fixed px height to it will make the image show up... Does anyone know how to fix that?
It's working on any Desktop browser...
HTML:
<div class="wrapper">
<div class="thumb-grid">
<div class="thumb">
<a href="#" class="image">
<div class="image-pos">
<img src="http://images.weserv.nl/?url=static.living.is/gallery/original/5184f3631034bcdf16bd4d37c341928e.jpg&il&w=600" />
</div>
</a>
<div class="details">
<h5>Image Title</h5>
</div>
</div>
<div class="thumb">
<a href="#" class="image">
<div class="image-pos">
<img src="http://images.weserv.nl/?url=static.living.is/gallery/original/5184f3631034bcdf16bd4d37c341928e.jpg&il&w=600" />
</div>
</a>
<div class="details">
<h5>Image Title</h5>
</div>
</div>
<div class="thumb">
<a href="#" class="image">
<div class="image-pos">
<img src="http://images.weserv.nl/?url=static.living.is/gallery/original/016e551de2f53d58e7f4acd68279e6a1.JPG&il&w=600" />
</div>
</a>
<div class="details">
<h5>Image Title</h5>
</div>
</div>
</div>
</div>
CSS:
.wrapper {
width: 600px;
margin: 30px auto 0
}
.thumb-grid {
text-align: justify;
}
.thumb-grid:after {
content: '';
display: inline-block;
width: 100%;
}
.thumb {
position: relative;
display: inline-block;
width: 31.5%;
height: 0;
padding-top: 29%;
margin-bottom: 6%;
}
.image {
height: 73%;
overflow: hidden;
position: absolute;
text-align: center;
top: 0;
width: 100%;
vertical-align: top;
display: block;
border: 1px solid #eee;
}
.image-pos {
height: 100%;
left: 50%;
margin-left: -300px;
position: absolute;
text-align: center;
width: 600px;
}
.image-pos img {
height: 100%;
max-height: 100%;
min-height: 100%;
max-width: none;
width: auto;
display: inline;
border: 0;
}
.details {
height: 27%;
position: absolute;
top: 73%;
}
.details h5 {
margin: 0;
padding-top: 5px;
}
Demo: http://codepen.io/malte/pen/kDlbt