my visitors with the Iphone (Safari browser) complain that my menu isn't working. So I tried it in an emulator and found that there is not working hover or transition. On Android it's working all great.
/* Content menu */
.navigation_bg {
width:100%;
height:65px;
background:#272d33;
display:block;
}
.navigation_content {
min-width:400px;
height:65px;
max-width:1200px;
background:#272d33;
margin:0 auto;
text-align:center;
display: table;
width:100%;
overflow:hidden;
}
a.navigation {
display: table-cell;
vertical-align: middle;
border:0px;
text-align:center;
width:140px;
height:65px;
text-transform:uppercase;
font-weight:normal;
background:transparent;
overflow: hidden;
font-size:14px;
word-wrap: break-word;
padding-top:5px;
-webkit-transform: translateY(0px);
transform: translateY(0px);
}
a.navigation img {
height:35px;
width:35px;
}
a.navigation::after {
content: '';
display: block;
width: 100%;
height: 5px;
background: #f23030;
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
position:relative;
top:23px;
}
a.navigation:hover::after {
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
a.navigation:focus::after {
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
a.navigation:active::after {
-webkit-transform: translateY(-5px);
transform: translateY(-5px);
}
.mobile_menu {
display:none;
min-width:400px;
max-width:750px;
width:100%;
height:65px;
background:transparent url('../img/menu.png') no-repeat;
background-position: right 10px center;
}
#media only screen and (max-width: 750px) {
.mobile_menu {
display:block;
}
.navigation_content {
display:block;
background:#272d33;
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
height:305px;
}
a.navigation::after {
top:10px;
}
a.navigation {
min-width:400px;
width:100%;
display:block;
padding-top:10px;
height:40px;
background:#272d33;
}
a.navigation img {
height:25px;
width:25px;
}
.navigation_bg {
height:65px;
overflow:hidden;
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
}
.navigation_bg:hover {
height:305px;
background:#f23030;
}
}
/* End Content menu */
<div class='navigation_bg'>
<div class='mobile_menu'>
</div>
<div class='navigation_content'>
<a href='/novinky' class='navigation white'>Novinky</a>
<a href='/navody' class='navigation white'>Návody</a>
<a href='/forum' class='navigation white'>Fórum</a>
<a href='' class='navigation white'>---</a>
<a href='/ostatni' class='navigation white'>Ostatní</a>
<a href='/social' class='navigation'><img src='img/yt.png' alt='Youtube'> <img src='img/fb.png' alt='Facebook'></a>
</div>
</div>
Do you have any idea where the problem could be?
There is an issue with hovering status and transition rendering iOs Safari. Note that busing an :hover pseudo-class is a non complient way to make menu works.
For example 2 ways to make a menu :
1. Use a label (linked to a hidden checkbox) and place it your toggle button
2. Use javascript to make menus toggle a class
Related
I'm trying to make this Edge animate animation http://www.instagib.dk/mainlinks.html into pure css. I don't know if it possible, but it could be awesome for some tips or help.
I have a fiddle, where I'm trying to do it.
"http://jsfiddle.net/MikkelMadsen/9KjL8/"
HTML:
<div class="product-wrap">gå til varen
<div class="produkt-img-bg">
<div class="produkt-img"><img src="http://www.instagib.dk/anatomical_sole.png" width="300" height="140"/>
</div>
</div>
<div class="produkt-text">Anatomical</div>
<div class="slide">
<div class="slide-hover"></div>
</div>
</div>
CSS:
product-wrap {
width:300px;
height:290px;
display: table-cell;
vertical-align: bottom;
}
.produkt-img-bg {
width:300px;
height:155px;
background:url(http://www.instagib.dk/anatomical_bg.png) no-repeat;
}
.produkt-img{
width:300px;
height:140px;
}
.produkt-img:hover{
-webkit-transition: opacity 1s linear;
-moz-transition: all 0.5s linear;
-ms-transition: all 0.5s linear;
-o-transition: all 0.5s linear;
transition: all 0.5s linear;
filter: alpha(opacity=30);
opacity:0.5;
background-color:#57b6dd;
}
.produkt-img img {
width:300px;
height:140px;
-webkit-transition: all 0.5s ease; /* Safari and Chrome */
-moz-transition: all 0.5s ease; /* Firefox */
-ms-transition: all 0.5s ease; /* IE 9 */
-o-transition: all 0.5s ease; /* Opera */
transition: all 0.5s ease;
}
.produkt-img:hover img {
width:300px;
height:140px;
-webkit-transform:scale(1.1); /* Safari and Chrome */
-moz-transform:scale(1.1); /* Firefox */
-ms-transform:scale(1.1); /* IE 9 */
-o-transform:scale(1.1); /* Opera */
transform:scale(1.1);
}
.produkt-text{
width:300px;
height:123px;
}
.slide{
width:300px;
height:12px;
background-color:#B8B7B7;
}
.slide-hover{
width:300px;
height:12px;
}
.slide-hover:hover{
-webkit-animation: slider 0.5s normal forwards linear;
-moz-animation: slider 0.5s normal forwards linear;
-o-animation: slider 0.5s normal forwards linear;
animation: slider 0.5s normal forwards linear;
animation-iteration-count: 1;
width:300px;
height:12px;
background-color:#000;
}
#-webkit-keyframes slider {
from {
width: 0%;
}
to {
width: 100%;
}
}
Hoping for css wizard to help me out:)
You Effect converted into css >> Hover Effect
HTML
<div class="product-wrap">
<div class="image-wrap">
<div class="img-container">
<div class="produkt-img">
<img src="http://www.instagib.dk/anatomical_sole.png" width="300" height="140">
<div class="title">Arch Mid<br> <span class="subtitle">Subtitile</span>
</div>
<div class="overlay">Product Name</div>
</div>
<div class="pricetag">250,00 Kr.</div>
<div class="graybar"></div>
<div class="blackbar"></div>
</div>
</div>
css
.product-wrap {
background:url(http://www.instagib.dk/anatomical_bg.png) no-repeat;
width:300px;
height:290px;
display: table-cell;
vertical-align: bottom;
position:relative;
border:1px solid #ccc;
transition:all 0.4s ease-out;
font-family:sans-serif;
transition:all 1s ease;
cursor:pointer;
}
.product-wrap:hover img {
transform:scale(1.1);
transition:all 0.42s ease;
}
.product-wrap:hover .overlay {
opacity:1;
}
.product-wrap:hover .blackbar {
width:100%;
}
.image-wrap {
width:300px;
height:155px;
}
.produkt-img {
position:absolute;
top:0;
transition:all 1s ease;
}
.product-wrap img {
transition:all 0.42s ease;
}
.overlay {
position:absolute;
top:0;
width:100%;
height:98%;
background:rgba(123, 217, 253, 0.6);
opacity:0;
transition:all 0.6s ease;
color:#fff;
font-size:28px;
line-height:5;
vertical-align:middle;
text-align:center;
}
.graybar {
position:absolute;
bottom:0;
right:0;
height:13px;
width:100%;
background-color:#cecece;
}
.blackbar {
position:absolute;
bottom:0;
left:0;
height:13px;
width:0%;
background-color:#000;
transition:all 0.3s ease-in;
}
.pricetag {
padding-right:2px;
position:absolute;
bottom:13px;
left:0;
height:30px;
width:100%;
font-size:22px;
text-align:right;
}
.title {
padding-right:2px;
position:absolute;
bottom:13px;
top:160px;
left:0;
height:30px;
width:100%;
font-size:35px;
text-align:center;
}
.subtitle {
color:#ccc;
font-size:18px;
}
I'm trying to do an image hover effect in which a link move from top:0 to top:40%.The problem is that the link appear directly on top:40% when I hover the image. This is my code:
<div class="featured">
<div class="img-hover">
<i></i>
</div>
<img src=""/>
</div>
.featured .img-hover {
width:100%;
float:left;
height:100%;
position:absolute;
display:none;
background:rgba(26, 188, 156, 0.6);
}
.featured:hover .img-hover {
display:block;
}
.featured .img-hover a{
width:50px;
height:50px;
float:left;
position:absolute;
top:0;
font-size:2rem;
line-height: 4rem;
opacity:1;
margin-right:20px;
border-radius:50px;
border:2px solid #fff;
color:#fff;
text-align:center;
transition: all 0.5s ease-out;
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
}
.featured:hover .img-hover a{
top:40%;
}
Your transition is on the a tag, it works better on just the ".featured .img-hover" level. Also, the transition of the "display:none" wasn't working well. I updated it to transition from opacity 0 to 1, and it looks better. Below is the JSFiddle and minorly updated CSS. Take a look and tweak if you'd like.
http://jsfiddle.net/UVjFz/
.featured .img-hover {
width:100%;
float:left;
height:100%;
position:absolute;
opacity:0;
background:rgba(26, 188, 156, 0.6);
}
.featured:hover .img-hover {
display:block;
}
.featured .img-hover a{
width:50px;
height:50px;
float:left;
position:absolute;
top:0;
font-size:2rem;
line-height: 4rem;
opacity:1;
margin-right:20px;
border-radius:50px;
border:2px solid #fff;
color:#fff;
text-align:center;
transition: all 0.5s ease-out;
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
}
.featured:hover .img-hover a{
top:40%;
}
.featured:hover .img-hover {
display:block;
opacity:1;
}
.featured .img-hover {
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
}
I m trying to achieve this.
The smooth hover animation is not applied and the image goes up beyond the div (as shown in pic) in Chrome.
ASPX:
<div class="favDiv">
<table width="100%" cellspacing="15">
<tr>
<td width="30%">
<div class="grid effect">
<figure>
<asp:Image ID="img" runat="server" width="100%" height="150px"
Imageurl="~/abc.jpg"/>
<figCaption>
<h5>Test</h5>
</figCaption>
</figure>
</div>
</td>
<td width="70%"></td>
</tr>
</table>
</div>
CSS:
.favDiv
{
//to centre div in the page
display:inline-block;
position:fixed;
top:0;
bottom:0;
left:0;
right:0;
width:65%;
height:65%;
margin:auto;
}
.grid
{
border:1px solid gray;
height:150px;
}
figure
{
padding:0;
margin:0;
position:relative;
}
figCaption
{
position:absolute;
top:0;
left:0;
width:100%;
background:#2c3f52;
color:#ed4e6e;
}
figCaption h5
{
margin:0;
padding:0;
color:#fff;
}
.effect figure
{
overflow:hidden;
}
.effect figure:hover img
{
-webkit-transform:translateY(-50px);
-moz-transform:translateY(-50px);
}
.effect figCaption
{
height:50px;
width:100%;
top:auto;
bottom:0;
opacity:0;
-webkit-transform:translateY(100%);
-moz-transform:translateY(100%);
-webkit-transition:transform 0.4s, opacity 0.1s 0.3s;
-moz-transition:transform 0.4s, opacity 0.1s 0.3s;
}
.effect figure:hover figCaption
{
opacity:1;
-webkit-transform:translateY(0px);
-moz-transform:translateY(0px);
-webkit-transition:transform 0.4s, opacity 0.1s 0.3s;
-moz-transition:transform 0.4s, opacity 0.1s 0.3s;
}
What am i missing here?
Your code is not working because Tympanus wrote styles for non-touch devices. Its defined by mordernizr (Automatically add class to body).
I have modified the fiddle. Now its working fine.
Working Demo
HTML
<div class="favDiv">
<table width="100%" cellspacing="15">
<tr>
<td width="70%">
<div class="grid cs-style-3">
<figure>
<img src="http://tympanus.net/Tutorials/CaptionHoverEffects/images/3.png" alt="img03">
<figcaption>
<h3>test</h3>
</figcaption>
</figure>
</div>
</td>
<td width="70%"></td>
</tr>
</table>
</div>
CSS
.grid {
padding: 20px 20px 100px 20px;
max-width: 1300px;
margin: 0 auto;
list-style: none;
text-align: center;
}
.grid li {
display: inline-block;
width: 440px;
margin: 0;
padding: 20px;
text-align: left;
position: relative;
}
.grid figure {
margin: 0;
position: relative;
}
.grid figure img {
max-width: 100%;
display: block;
position: relative;
}
.grid figcaption {
position: absolute;
top: 0;
left: 0;
padding: 20px;
background: #2c3f52;
color: #ed4e6e;
}
.grid figcaption h3 {
margin: 0;
padding: 0;
color: #fff;
}
/* Caption Style 3 */
.cs-style-3 figure {
overflow: hidden;
}
.cs-style-3 figure img {
-webkit-transition: -webkit-transform 0.4s;
-moz-transition: -moz-transform 0.4s;
transition: transform 0.4s;
}
.cs-style-3 figure:hover img {
-webkit-transform: translateY(-30px);
-moz-transform: translateY(-30px);
-ms-transform: translateY(-30px);
transform: translateY(-30px);
}
.cs-style-3 figcaption {
height: 30px;
width: 100%;
top: auto;
bottom: 0;
opacity: 0;
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(100%);
transform: translateY(100%);
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: -webkit-transform 0.4s, opacity 0.1s 0.3s;
-moz-transition: -moz-transform 0.4s, opacity 0.1s 0.3s;
transition: transform 0.4s, opacity 0.1s 0.3s;
}
.cs-style-3 figure:hover figcaption {
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
transform: translateY(0px);
-webkit-transition: -webkit-transform 0.4s, opacity 0.1s;
-moz-transition: -moz-transform 0.4s, opacity 0.1s;
transition: transform 0.4s, opacity 0.1s;
}
.cs-style-3 figcaption a {
position: absolute;
bottom: 20px;
right: 20px;
}
How do I add a transition to this rollover?
Here is my css so far:
.img-container {
width: 401px;
height: 267px;
position: relative;
}
.img-container:hover .square-icon {
display: block;
}
.square-icon {
opacity: .5;
position:absolute;
bottom:0;
left:0;
width:100%;
height:100%;
background: url(images/zoom-icon.png) center center no-repeat;
background-color: #FF3860;
cursor:pointer;
display:none;
}
And here is the html:
<div class="img-container">
<img alt="lorem" width="401" height="267" src="images/450-300-13.png">
<div class="square-icon"></div>
</div>
I know I need to add:
transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
-webkit-transition: opacity .25s ease-in-out;
But I'm not sure where to add it?
You need to set the two states (normal and hover) of .square-icon to have different levels of opacity and then you can transition on opacity.
See my jsBin demo here
.img-container:hover .square-icon {
opacity: 1;
}
.square-icon {
position:absolute;
bottom:0;
left:0;
width:100%;
height:100%;
background: url(images/zoom-icon.png) center center no-repeat;
background-color: #FF3860;
cursor:pointer;
opacity: 0;
transition: display 2s ease-in-out;
-moz-transition: opacity 2s ease-in-out;
-webkit-transition: opacity 2s ease-in-out;
}
I'm having trouble aligning li elements to the left on tabs, as they are centered. I was wondering if someone could help me out.
I've tried a few things but always end up breaking the code.
Also, as a plus, the effects for fadein on divs don't seem to work on opera and firefox.
Here's the jsfiddle: http://jsfiddle.net/guisasso/6f6PY/
CSS
.tabs {
border-bottom:3px #f2f2f2 solid;
}
.tabs li {
list-style:none;
display:inline;
color:#08c;
}
.tabs a {
padding:5px 20px;
display:inline-block;
background:#ffffff;
text-decoration:none;
color:#08c;
top: 3px;
font-size: 22px;
line-height: 140%;
padding-top: 10px;
background: #ffffff;
box-sizing: border-box;
position: relative;
border-radius: 4px 4px 0 0;
margin-bottom:3px;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.tabs a.active {
background: #ffffff;
border-bottom:3px orange solid;
color:#000000;
top:0px;
}
.tabs a:hover {
background: #f2f2f2;
top: 0px;
border-bottom:3px orange solid;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
#tab1, #tab2, #tab3, #tab4 {
animation: fadein 1s;
-moz-animation: fadein 1s; /* Firefox */
-webkit-animation: fadein 1s; /* Safari and Chrome */
-o-animation: fadein 1s; /* Opera */
}
#keyframes fadein {
from {
opacity:0;
}
to {
opacity:1;
}
}
#-moz-keyframes fadein { /* Firefox */
from {
opacity:0;
}
to {
opacity:1;
}
}
#-webkit-keyframes fadein { /* Safari and Chrome */
from {
opacity:0;
}
to {
opacity:1;
}
}
#-o-keyframes fadein { /* Opera */
from {
opacity:0;
}
to {
opacity: 1;
}
}
HTML
<ul class="tabs">
<li><a href='#tab1'>Tab #1</a></li>
<li><a href='#tab2'>Tab #2</a></li>
<li><a href='#tab3'>Tab #3</a></li>
<li><a href='#tab4'>Tab #4</a></li>
</ul>
<div id="tab1">111111111111111 11111111111111111 1111111111111111111 1111111111111</div>
<div id="tab2">222222222222222 22222222222222222 2222222222222222222 2222222222222</div>
<div id="tab3">333333333333333 33333333333333333 3333333333333333333 3333333333333</div>
<div id="tab4">444444444444444 44444444444444444 4444444444444444444 4444444444444</div>
Thanks
Add to .tabs:
padding-left: 0;
Change in .tabs a:
padding: 5px 20px;
to
padding: 5px 20px 5px 0;
It doesn't get any lefter than that.
Fiddle: http://jsfiddle.net/PRL5H/