I have a website, on it, links that container img tags will transition the opacity for the image tag to be less than 100%. This seems to work well with all images except for one and it only happens on ONE page. At the bottom of this page http://www.saerdesigns.com/ there is a VetPros imag, when I hover over it on Chrome (unsure of other browsers), the transition stops and starts and ultimately looks very bulky. It doesn't appear to do this with any other images on the same page, and also, the image in this page using the same stylesheet file appears to work fine http://www.saerdesigns.com/jobs.
Here is my relevant CSS:
a {
text-decoration: none;
-webkit-transition: all 0.5s linear;
-moz-transition: all 0.5s linear;
-ms-transition: all 0.5s linear;
-o-transition: all 0.5s linear;
transition: all 0.5s linear;
&:hover, &:active, &:link {
text-decoration: none;
}
}
a {
img {
#extend a;
&:hover {
opacity: 0.8;
}
}
}
And here is the HTML code (it might look weird, but that's because I am using Angular):
<section class="container-fluid buffer" id="scroll-send-3">
<div class="center-block text-center" ng-show="jobs[0]">
<div class="row">
<div ng-repeat="job in jobs" class="col-md-4 job">
<a ui-sref="^.jobs.show({id: job.id})">
<img class="img-responsive center-block" alt="{{job.company}}" ng-src="{{job.image_small}}"/>
</a>
<ul>
<li>{{job.title}}</li>
</ul>
</div>
</div>
<div class="btn-group">
<a class="btn btn-default btn-lg" ui-sref="^.jobs">Work history</a>
</div>
</div>
</section>
How can I prevent this from happening? And why is this happening?
Thanks so much!
~The :hover works fine if you add position: relative;.
Maybe better to add transform: translate3d(0, 0, 1px); instead. I think the issue is because you are using opacity.
I don't have the explanation at hand right now, would have to go digging. Maybe tomorrow I can find the explanation again.
Related
I'm having odd behavior where circular pictures are changing to square on desktop and mobile. This only seems to be happening on safari, and it only happens when I add a CSS transition. Here's the website:
https://shmoss.github.io/Gibbs-Lab/people.html
If you view on mobile and click on a photo, it will change to a square. Here's the code:
<div class="py-5 text-center text-info background-info" style="">
<div class="container" id="people-container">
<div id="parent" class="row">
<!-- Lead Scientists -->
<div class="col-6 col-md-3 p-4 holly-gibbs lead-scientist">
<div class="img-holder">
<a style='color:none'href="holly-gibbs.html"><img class="img-fluid d-block mx-auto" src="bio_img/holly_gibbs_bio_new.png" alt="Card image cap" width="200">
</a>
</div>
<div class="bio-holder">
<a style='color:none'href="holly-gibbs.html">
<h4 class="people_name"> <b>Holly Gibbs</b> </h4>
<p class="mb-0">PROFESSOR AND DIRECTOR OF GLUE LAB</p>
</a>
</div>
</div>
<div class="col-6 col-md-3 p-4 lead-scientist">
<div class="img-holder">
<a style='color:none'href="tyler-lark.html"><img class="img-fluid d-block mx-auto " src="bio_img/tyler_lark_bio.png" alt="Card image cap" width="200">
</a>
</div>
<div class="bio-holder">
<a style='color:none'href="tyler-lark.html">
<h4 class="people_name"> <b>Tyler Lark</b> </h4>
<p class="mb-0">LEAD SCIENTIST</p>
</a>
</div>
</div>
</div>
</div>
/* ------------------------------People Page ------------------------------*/
/* container for people photos */
#people-container {
padding-top:10px;
}
/* Bio photo */
.img-holder {
max-width: 200px;
max-height: 200px;
overflow: hidden !important;
margin:0 auto
}
/* Bio info container (name, title) */
.bio-holder {
padding-top:10px;
}
/* Bio title */
.mb-0 {
color:#004869 !important;
font-size:14px;
font-weight:500 !important;
text-transform: uppercase
}
/* Bio image container */
.img-holder {
box-shadow: 0px 3px 15px rgba(0,0,0,0.2);
border-radius:50%
}
/* Scaling bio image on hover */
/* THIS CAUSES THE ISSUE! */
.img-fluid.d-block.mx-auto:hover {
-webkit-transform: scale(1.1);
-webkit-transition: all 0.125s ease-in-out 0s;
-moz-transition: all 0.125s ease-in-out 0s;
-ms-transition: all 0.125s ease-in-out 0s;
-o-transition: all 0.125s ease-in-out 0s;
transition: all 0.125s ease-in-out 0s;
}
.img-fluid.d-block.mb-3.mx-auto:focus {
-webkit-transform: scale(1.1);
-webkit-transition: all 0.125s ease-in-out 0s;
-moz-transition: all 0.125s ease-in-out 0s;
-ms-transition: all 0.125s ease-in-out 0s;
-o-transition: all 0.125s ease-in-out 0s;
transition: all 0.125s ease-in-out 0s;
}
I can't seem to figure out what's going on, maybe conflicting CSS somewhere?
I can reproduce, here is a minimal example, (please next time try to make yours as minimal)
.round {
width: 200px;
height: 200px;
overflow: hidden;
border-radius: 50%;
}
.inner {
transition: all 1s;
background: radial-gradient(red, green);
height: 100%;
cursor: pointer;
}
.inner:hover {
transform: scale(2);
}
<div class=round >
<div class=inner ></div>
</div>
This is a Safari bug, your code is fine [should work], and you should report the issue at https://bugs.webkit.org/.
The problem seems to affect only the software rendering, if we force using the GPU rendering, e.g by applying a 0px translateZ on the container, it works as expected:
.round {
width: 200px;
height: 200px;
overflow: hidden;
border-radius: 50%;
transform: translateZ(0px); /* force GPU rendering */
}
.inner {
transition: all 1s;
background: radial-gradient(red, green);
height: 100%;
cursor: pointer;
}
.inner:hover {
transform: scale(2);
}
<div class=round >
<div class=inner ></div>
</div>
So in your code you'd add this on the .img-holder rule.
However note that you probably don't need the prefixes for these properties anymore, and that even if you do need them, you should always add the unprefixed ones too, at the end. Currently your code only has -webkit-transform set, not the unprefixed one. This particular case works, but on some property you'll get different behaviors when the prefixed version is being chosen over the unprefixed one.
I think you need to clear your cache cos I can't notice it here
Tried on a OnePlus with both Chrome and Mozilla, it seems exactly like on desktop.
CSS has a habit of bugging out, try to clear cache line Nasiru stated or try a different browser just for testing
I'm having odd behavior where circular pictures are changing to square on desktop and mobile. This only seems to be happening on safari, and it only happens when I add a CSS transition. Here's the website:
https://shmoss.github.io/Gibbs-Lab/people.html
If you view on mobile and click on a photo, it will change to a square. Here's the code:
<div class="py-5 text-center text-info background-info" style="">
<div class="container" id="people-container">
<div id="parent" class="row">
<!-- Lead Scientists -->
<div class="col-6 col-md-3 p-4 holly-gibbs lead-scientist">
<div class="img-holder">
<a style='color:none'href="holly-gibbs.html"><img class="img-fluid d-block mx-auto" src="bio_img/holly_gibbs_bio_new.png" alt="Card image cap" width="200">
</a>
</div>
<div class="bio-holder">
<a style='color:none'href="holly-gibbs.html">
<h4 class="people_name"> <b>Holly Gibbs</b> </h4>
<p class="mb-0">PROFESSOR AND DIRECTOR OF GLUE LAB</p>
</a>
</div>
</div>
<div class="col-6 col-md-3 p-4 lead-scientist">
<div class="img-holder">
<a style='color:none'href="tyler-lark.html"><img class="img-fluid d-block mx-auto " src="bio_img/tyler_lark_bio.png" alt="Card image cap" width="200">
</a>
</div>
<div class="bio-holder">
<a style='color:none'href="tyler-lark.html">
<h4 class="people_name"> <b>Tyler Lark</b> </h4>
<p class="mb-0">LEAD SCIENTIST</p>
</a>
</div>
</div>
</div>
</div>
/* ------------------------------People Page ------------------------------*/
/* container for people photos */
#people-container {
padding-top:10px;
}
/* Bio photo */
.img-holder {
max-width: 200px;
max-height: 200px;
overflow: hidden !important;
margin:0 auto
}
/* Bio info container (name, title) */
.bio-holder {
padding-top:10px;
}
/* Bio title */
.mb-0 {
color:#004869 !important;
font-size:14px;
font-weight:500 !important;
text-transform: uppercase
}
/* Bio image container */
.img-holder {
box-shadow: 0px 3px 15px rgba(0,0,0,0.2);
border-radius:50%
}
/* Scaling bio image on hover */
/* THIS CAUSES THE ISSUE! */
.img-fluid.d-block.mx-auto:hover {
-webkit-transform: scale(1.1);
-webkit-transition: all 0.125s ease-in-out 0s;
-moz-transition: all 0.125s ease-in-out 0s;
-ms-transition: all 0.125s ease-in-out 0s;
-o-transition: all 0.125s ease-in-out 0s;
transition: all 0.125s ease-in-out 0s;
}
.img-fluid.d-block.mb-3.mx-auto:focus {
-webkit-transform: scale(1.1);
-webkit-transition: all 0.125s ease-in-out 0s;
-moz-transition: all 0.125s ease-in-out 0s;
-ms-transition: all 0.125s ease-in-out 0s;
-o-transition: all 0.125s ease-in-out 0s;
transition: all 0.125s ease-in-out 0s;
}
I can't seem to figure out what's going on, maybe conflicting CSS somewhere?
I can reproduce, here is a minimal example, (please next time try to make yours as minimal)
.round {
width: 200px;
height: 200px;
overflow: hidden;
border-radius: 50%;
}
.inner {
transition: all 1s;
background: radial-gradient(red, green);
height: 100%;
cursor: pointer;
}
.inner:hover {
transform: scale(2);
}
<div class=round >
<div class=inner ></div>
</div>
This is a Safari bug, your code is fine [should work], and you should report the issue at https://bugs.webkit.org/.
The problem seems to affect only the software rendering, if we force using the GPU rendering, e.g by applying a 0px translateZ on the container, it works as expected:
.round {
width: 200px;
height: 200px;
overflow: hidden;
border-radius: 50%;
transform: translateZ(0px); /* force GPU rendering */
}
.inner {
transition: all 1s;
background: radial-gradient(red, green);
height: 100%;
cursor: pointer;
}
.inner:hover {
transform: scale(2);
}
<div class=round >
<div class=inner ></div>
</div>
So in your code you'd add this on the .img-holder rule.
However note that you probably don't need the prefixes for these properties anymore, and that even if you do need them, you should always add the unprefixed ones too, at the end. Currently your code only has -webkit-transform set, not the unprefixed one. This particular case works, but on some property you'll get different behaviors when the prefixed version is being chosen over the unprefixed one.
I think you need to clear your cache cos I can't notice it here
Tried on a OnePlus with both Chrome and Mozilla, it seems exactly like on desktop.
CSS has a habit of bugging out, try to clear cache line Nasiru stated or try a different browser just for testing
I have an onmouseover and onmouseout image in my html. And it totally does its job. What I do still struggle with is adding a transition to the onmouse stuff so it doesn't change so quickly. I would like it to fade over into the other picture when you hover over the picture. Is something like this possible?
This person did something like that but it didn't work for me :( :
[Change transition time on onmouseover and onmouseout?
Check my code and please help me if there is a simple solution. Best would be without java script...
<html>
<body>
<div class="startpageicons">
<div class="icongestaltung">
<img src="images/startpageicon_draw.png" onmouseover="this.src='images/startpageicon_gestaltungunddesign.png'" onmouseout="this.src='images/startpageicon_draw.png'" style="transition: -webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;">
</div>
</body>
</html>
Changing the src of an image won't trigger css transition. Here is a pure css solution you can try. You can use a div as the container and set the background-image on hover.
.icongestaltung {
background: url(http://www.iconsdb.com/icons/preview/orange/stackoverflow-6-xxl.png) center center no-repeat;
background-size: contain;
width: 150px;
height: 150px;
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
}
.icongestaltung:hover {
background-image: url("http://www.iconsdb.com/icons/preview/gray/stackoverflow-xxl.png");
}
<html>
<body>
<div class="startpageicons">
<div class="icongestaltung"></div>
</div>
</body>
</html>
Hello I would like to transition only my css transform and nothing else. It hard to explain through text so check out my code below:
HTML:
<section class="success">
<ul>
<li>
<div class="circle-spin-wrapper">
<img src="ellipse_sm_blue.png" >
</div>
</li>
</ul>
</section>
CSS:
.circle-spin-wrapper {
transition: all 1s ease;
}
.success li:hover .circle-spin-wrapper {
transform:scale(1.25);
position: relative;
top: 95px;
}
As you can see, I have a div and when you hover over it, it scales by 1.25. It also moves down 95 px by, top: 95px;
The transition works, but it transitions both the scale(1.25) as well as the top: 95px.
I would like to make it so the transition (transition: all 1s ease;) only works on the transform:scale(1.25) and not the top: 95px.
I know it has something to do with the "all" keyword in the transition css, but I dont know what to replace it with to only target the transform.
I tried replacing "all" with "transform" and "scale" and it didn't work.
Does anyone have any suggestions?
Thanks!
I tried replacing "all" with "transform" and "scale" and it didn't work.
Replacing "all" with "transform" is exactly what you should be doing - that will result in the transition applying only to the transform property. It's tough to debug why it isn't working without seeing the rest of the code - can you set up a quick CodePen?
.circle-spin-wrapper {
transition: transform 1s ease;
-webkit-transition: -webkit-transform 1s ease;
}
.success li:hover .circle-spin-wrapper {
transform: scale(1.25);
position: relative;
top: 95px;
}
<section class="success">
<ul>
<li>
<div class="circle-spin-wrapper">
<img src="test.jpg">
</div>
</li>
</ul>
</section>
this should work. note: "-webkit-transition: -webkit-transform 1s ease;" is for safari
.circle-spin-wrapper {
transition: transform 1s ease;
}
But it looks buggy since .circle-spin-wrapper has no width set, so it's the full width of the page, which means .circle-spin-wrapper becomes 125% of the width of the page and the image inside moves out of the page.
Solution? Set a width on .circle-spin-wrapper.
As you said, instead of all in your transition use transform. It is working actually!
Maybe its the vendor prefixes that you are missing. Try adding that too.
.circle-spin-wrapper {
transition: transform 1s ease;
}
.success li:hover .circle-spin-wrapper {
transform:scale(1.25);
position: relative;
top: 95px;
}
<section class="success">
<ul>
<li>
<div class="circle-spin-wrapper">
<img src="http://placehold.it/50x50" >
</div>
</li>
</ul>
</section>
How would I go about hovering over an image that then blurs the background image behind it within css? The way I have it set up now is the background image blurs upon hover.
Here's my css:
.blur img {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.blur img:hover {
-webkit-filter: blur(5px);
}
.wrapper{
width:900x;
height: 100px;
position: absolute;
top: 2400px;
z-index: 50;
}
.logo{
postion: absolute;
margin: 0 auto;
top: 2420px;
z-index: 50;
left: 400px;
}
html:
<div class="blur"><img src="/homepic1.jpg"></div>//This is the image I want blurred
<div class="wrapper">
<div class="row">
<div class="span12 pagination-centered">
<img src="/transparanetsnu.png">//How do I hover over any of these images to trigger a blur on "homepic1.jpg"
</div>
<div class="span4 offset3">
<div class="box2"><img src="/greek_logo.gif"></div>
</div>
<div class="logo"><img src="/UM-Main-Logo-Maroon.gif">
</div>
I think the best way is to use JQuery. All images and add a class like 'blur' to them everytime user hover over one image, but you should remove the class from the one you don't want.
$('.img1').mouseover(function(){
$('img').addClass('blur');
$('.img1').removeClass('blur');
});
Add the effect using css or javascript.
Use jQuery for that purpose.
First of all dowload jQuery from: http://code.jquery.com/jquery-1.10.2.min.js
Then.
$('.yourImage').mouseover(function(){ //'.yourImage' are the last three images in your case.
$('.homepic1').addClass('blur'); //'.homepic1' is the class of first image in your case
});
.addClass('blur') , Will add the class 'blur' from your CSS to that '.homepic1' element, As soon as your mouse hovers over ANY of the three images.