I am trying to create a div containing 2 divs: one for a cover img and the other div with some text.
I would love to show only the image and move it away on hover to show the text.
I wrote this code using absolute positioning and css transitions but there's something wrong.
It works great in Chrome but it doesn't in Firefox.
http://jsfiddle.net/5NHh2/4/
Could someone help me?
I think the problem is the overflow:hidden set to the main div.
Thank you very much
This is the html code:
<div class="container">
<div class="info-box">
<a href="#" title="">
<div class="cover">
<img src="http://placehold.it/180x267" />
</div>
<div class="info">
<h5>A Title</h5>
<p>Some text</p>
</div>
</a>
</div>
<div>
And this is the css:
.container {
background:#000;
text-align:center;
padding:10px;
}
.info-box{
text-align:left;
overflow:hidden;
position:relative;
background:#ddd;
display:inline-table;
margin:0 10px 10px;
}
.info-box,
.info-box img,
.info-box .cover {
width:180px;
height:267px;
}
.info-box a {
text-decoration:none;
color:#333;
display:block;
position:absolute;
top:0;
left:0;
width:180px;
height:534px;
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.info-box .info {
box-shadow:inset 0 0 2px #000;
}
.info-box a:hover{
top:-267px;
}
.info-box .info {
width:160px;
height:247px;
padding:10px;
position:relative;
}
.info {
text-shadow:0 1px 0 #fff;
}
.info-box .info h5 {
font-family:'Trebuchet MS',Arial,sans-serif;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
margin-bottom:10px;
}
Added .container, .info-box {overflow:hidden;} to the end.
Works in firefox for me here: http://jsfiddle.net/5NHh2/5/
Related
I have image box that on hover, image goes to 0.5 opacity, and the text inside a DIV have to go from visibility:hidden to go to visibility:visible'. But I am struggling with figuring out how to do it.
#edno {
background-image:url(" ../../CONTENT/Images/a.png");
background-size:100%;
background-repeat:no-repeat;
background-position:center;
transition: 0.2s linear;
}
#edno:hover {
background-size:200%;
background-position:center;
opacity:0.5;
}
#edno .imee {
font-family:futuraat;
font-size:35px;
padding-top:204px;
visibility:hidden;
color:black;
}
#edno:hover .imee {
font-family:futuraat;
font-size:35px;
padding-top:204px;
visibility:visible;
color:black;
}
<a href="../../producti/sekcionni/1/index.html">
<div class="figure" id="edno">
<p class="imee">СТЪЛБИЧКА</p>
</div>
</a>
Everything that happens is that Everything goes on:
opacity:0.5
I want the text to pop in when hover the div.
I have image box that on hover, image goes to 0.5 opacity, and the text inside a DIV have to go from visibility:hidden to go to visibility:visible but I am struggling with figuring out how to do it.
Seems to work fine as is? The text IS doing that upon hover.
#edno {
background-image:url("https://placehold.it/300x150");
background-size:100%;
background-repeat:no-repeat;
background-position:center;
transition: 0.2s linear;
}
#edno:hover {
background-size:200%;
background-position:center;
opacity:0.5;
}
#edno .imee {
font-family:futuraat;
font-size:35px;
padding-top:204px;
visibility:hidden;
color:black;
}
#edno:hover .imee {
font-family:futuraat;
font-size:35px;
padding-top:204px;
visibility:visible;
color:black;
}
<a href="../../producti/sekcionni/1/index.html">
<div class="figure" id="edno">
<p class="imee">СТЪЛБИЧКА</p>
</div>
</a>
Here is some working code, just use a little jQuery to trigger a toggle and VOILA!
CSS:
#edno {
position: relative;
margin: auto;
background-color: red;
width:300px;
height: 200px;
transition: 0.2s linear;
}
#edno:hover {
background-size:200%;
background-position:center;
opacity:0.5;
}
.imee {
position: relative;
text-align: center;
top: -360px;
font-family:futuraat;
font-size:35px;
padding-top:204px;
display: none;
color:black;
}
.show
{
display: block;
}
HTML:
<a href="#">
<div class="figure" id="edno"></div>
<p id="fadeIn" class="imee">СТЪЛБИЧКА</p>
</a>
jQUERY:
$(document).ready(function()
{
$("#edno").hover(function()
{
$(".imee").toggleClass("show");
});
});
I'm creating a slider where .slider-wrap is a parent div which has rule overflow: hidden; and I want my every image should zoom in whenever I hover on div slider-boxes everything is working fine until I'm using overflow: hidden; but when I start to use overflow: hidden; image doesn't zoom out as the Desired Result in Snippet 2 where I'm not using overflow: hidden;
I want my final result like Snippet 2
But I think overflow is important to use because there will be more images come when I will make it dynamic so is there any way to fix this issue.
here is the jsfiddle https://jsfiddle.net/rhulkashyap/7g3vypqh/
Snippet 1: I'm Getting
body{
background-color: #DD3735;
padding-top:30px;
}
.slider-wrap{
width:616px;
height:120px;
border:1px solid #ccc;
margin:0 auto;
box-shadow: 0 0 10px #000;
border-radius:5px;
overflow:hidden;
}
img, .slider-boxes{
width:120px;
height:120px;
}
.slider-boxes{
display: inline-block;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.slider-boxes:hover{
-webkit-transform: scale(1.30);
transform: scale(1.30);
box-shadow: 0 0 10px #000;
}
<div class="slider-wrap">
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000108340114/a586d7a8df39836a114651aef74cd2d0_400x400.jpeg" alt="Image1"></div>
<div class="slider-boxes"><img src="https://s-media-cache-ak0.pinimg.com/736x/77/06/4e/77064e4e9ccc289ee5394dd7dbf48011.jpg" alt="Image2"></div>
<div class="slider-boxes"><img src="http://gloimg.gearbest.com/gb/2014/201411/goods-img/1415993980392-P-2179386.jpg" alt="Image3"></div>
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000451012500/4628fbb9dc70514d389ed9491243866f_400x400.png" alt="Image4"></div>
<div class="slider-boxes"><img src="http://howtodrawdat.com/wp-content/uploads/2014/01/1st-pic-Dave-Minion-from-despicable-me.png" alt="Image5"></div>
</div>
Snippet 2: Desired Result
body{
background-color: #DD3735;
padding-top:30px;
}
.slider-wrap{
width:616px;
height:120px;
border:1px solid #ccc;
margin:0 auto;
box-shadow: 0 0 10px #000;
border-radius:5px;
}
img, .slider-boxes{
width:120px;
height:120px;
}
.slider-boxes{
display: inline-block;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
.slider-boxes:hover{
-webkit-transform: scale(1.30);
transform: scale(1.30);
box-shadow: 0 0 10px #000;
}
<div class="slider-wrap">
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000108340114/a586d7a8df39836a114651aef74cd2d0_400x400.jpeg" alt="Image1"></div>
<div class="slider-boxes"><img src="https://s-media-cache-ak0.pinimg.com/736x/77/06/4e/77064e4e9ccc289ee5394dd7dbf48011.jpg" alt="Image2"></div>
<div class="slider-boxes"><img src="http://gloimg.gearbest.com/gb/2014/201411/goods-img/1415993980392-P-2179386.jpg" alt="Image3"></div>
<div class="slider-boxes"><img src="https://pbs.twimg.com/profile_images/378800000451012500/4628fbb9dc70514d389ed9491243866f_400x400.png" alt="Image4"></div>
<div class="slider-boxes"><img src="http://howtodrawdat.com/wp-content/uploads/2014/01/1st-pic-Dave-Minion-from-despicable-me.png" alt="Image5"></div>
</div>
This is not the prettiest solution, but it does solve it somewhat..
Adding a
.sliding-wrap:hover
{
overflow: visible;
}
does the trick, but it doesn't make the easing out very pretty..
Fiddle
CSS
#articlebottom {
width: 980px;
height: 250px;
}
.products{
width:980px;
margin:0px auto;
padding-left:20px;
}
#articlebottom .imgWrap {
width:295px;
height:200px;
position:relative;
float:left;
margin:10px;
background:#333;
}
#articlebottom .imgWrap img {
position:absolute;
left:5px;
top:5px;
width:285px;
height:190px;
}
#articlebottom .imgDescription1 {
position: absolute;
left:0;
letter-spacing: 2px;
background-color: rgba(255, 250, 250, 0.2);
color: rgba(255, 250, 250, 0.2);
font-weight:bold;
font-size:18pt;
line-height: 50px;
width:100%;
height:50px;
opacity: 0;
text-align:center;
text-transform:uppercase;
transition:opacity 500ms ease-in-out, color 20ms ease-in-out,height 500ms ease-in-out;
}
#articlebottom .imgWrap:hover .imgDescription1 {
opacity: 1;
height:200px;
line-height:200px;
color: #1b9bff;
}
HTML
<article id="articlebottom">
<div class="products">
<div class="imgWrap">
<a href="Products/Camphor.aspx" target="_blank"><img src="Images/Camphor_b.JPG" alt="polaroid" />
<p class="imgDescription1">Camphor</p></a>
</div>
</div>
</article>
Fiddle
What I'm having:
The Text appears on the center when i hover and going to top after hover
What i need:
When i hover on the image the appropriate text shoould appear on the center and also need to disappear on center of the image itself
Updated Fiddle
The crucial part is moving
height:200px;
line-height:200px;
color: #1b9bff;
From:
#articlebottom .imgWrap:hover .imgDescription1
To:
#articlebottom .imgDescription1
Otherwise the position of the text is set to a default/inherited value and only set to centred on hover, hence why the hover state sees it jump.
Hi I've got a Div I wont to expose on Click of a link, it reveals a pop up at the bottom of the page... at the moment it looks like this:
http://jsfiddle.net/XPJC5/
body{margin:0;}
#lightbox {
display:none;
position:absolute;
bottom:5px;
z-index:1000;
width:100%;
background-color:#09F;
height:50px;
float:left;
font-family: 'helvetica_bqregular';
font-size:20px;
line-height:65px;
color:#FFF;
text-align:center;
}
/* works with IE8+, Firefox 2+, Safari, Chrome, Opera 10+ */
#lightbox:target {
display:block;
}
Register
<div id="lightbox">
<div style=" background-color:#CBE376; width:100%; line-height:65px; height:65px; border-bottom:solid #999 thin; -webkit-box-shadow: 4px 4px 4px 4px #333;box-shadow: 4px 4px 4px 4px #333; clear:both;">
Consumer
</div>
<div style=" background-color:#94C8F1; line-height:65px; width:100%; height:65px;">
Business</div>
<div style=" background-color:#333; width:100%; height:65px;">Close
</div></div>
but I want the box to slide up from the bottom similar to this:
http://jsfiddle.net/R8zca/4/
Can anyone help with accomplishment? seems to fail on trial.
Thanks
remove the heights from the inline styles in the html and set the boxes to an initial height of 0px in the css, then use the css transition to bring them to full height
html
Register
<div id="lightbox">
<div style=" background-color:#CBE376; width:100%; line-height:65px; border-bottom:solid #999 thin; -webkit-box-shadow: 4px 4px 4px 4px #333;box-shadow: 4px 4px 4px 4px #333; clear:both;">
Consumer
</div>
<div style=" background-color:#94C8F1; line-height:65px; width:100%; ">
Business</div>
<div style=" background-color:#333; width:100%;">Close
</div></div>
css
body{margin:0;}
#lightbox div
{
height: 0px;
}
#lightbox {
display:block;
position:absolute;
bottom:5px;
z-index:1000;
width:100%;
background-color:#09F;
float:left;
font-family: 'helvetica_bqregular';
font-size:20px;
line-height:65px;
color:#FFF;
text-align:center;
}
/* works with IE8+, Firefox 2+, Safari, Chrome, Opera 10+ */
#lightbox:target div
{
height: 65px;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
}
http://jsfiddle.net/axrwkr/XPJC5/2
I was creating a portfolio, and I want it so that whenever someone hovers over my name, a bubble with an arrow appears. I've done that part already, but the problem is that the -webkit-transition property isn't working. The bubble is a little far to my name so I want it so that it takes a little bit of time to hide again, so someone can go to it easily because I'm thinking of making a form to contact me in it.
My HTML:
<div id="side-bar"><h1 id="ab_me">About Me</h1>
<img src="saksham.png" id="saksham">
<p id="name"><span>S</span>aksham <span>C</span>hauhan</p>
<div id="bubble">
SUP !
<div id="bubble-arrow-border">
</div>
<div id="bubble-arrow">
</div>
</div>
</div>
My CSS:
div#side-bar p
{
font-size:25;
border-bottom:2px solid red;
position:absolute;
left:10px;
color:#F63737;
}
div#side-bar p:hover
{
border-bottom:2px groove #C01F1F;
color:#C01F1F;
text-shadow:0px 1px 2px #F98378;
-webkit-transition:1s;
}
div#side-bar p span
{
font-size:40px;
}
div#side-bar p:hover ~ #bubble
{
display:block;
visibility:visible;
opacity:1;
-webkit-transition:5s;
}
div#side-bar p #bubble:hover
{
display:block;
visibility:visible;
opacity:1;
}
#bubble
{
background-color:#EDEDED;
visibility:hidden;
border:2px solid #666666;
font-size:35px;
line-height:1.3em;
padding:10px;
position:absolute;
text-align:center;
width:300px;
-moz-border-radius:15px;
-webkit-border-radius:15px;
-moz-box-shadow:0 0 5px #888888;
-webkit-box-shadow:0 0 5px #888888;
z-index:100;
left:230px;
top:400px;
display:none;
-webkit-transition:5s;
opacity:0;
}
#bubble-arrow
{
border-color:transparent #EDEDED transparent transparent;
border-style: solid;
border-width: 15px;
height:0;
width:0;
position:absolute;
bottom:25px;
left:-28px;
z-index:100;
}
#bubble-arrow-border
{
border-color:transparent #666666 transparent transparent;
border-style: solid;
border-width: 15px;
height:0;
width:0;
position:absolute;
bottom:25px;
left:-31px;
}
When you are using a transition you must have both "before" and "after" states set (e.g. you cant transition from nothing to opacity:0 but you can from opacity:1 to opacity:0). Also, you can't have a transition on display but you can on visibility.
Here's some more about transitions: https://developer.mozilla.org/en-US/docs/CSS/Tutorials/Using_CSS_transitions
You have to tell it what properties to transition. It looks like you're trying to do this:
transition:all 1s ease;
-webkit-transition:all 1s ease;
Don't post your entire code, only relevant code.
CSS transitions don't work well with display:none. When I had to use display:none, I had to use Javascript to supplement my CSS.
So, if you remove display:none from #bubble, and then use:
-webkit-transition:all 1000ms;
On #bubble, and then have #bubble:hover set to change the opacity to 1:
opacity:1;
Your bubble will fade in, and then fade out.
http://jsfiddle.net/charlescarver/nrTMg/1/