I have tried hunting for this answer, and I am hoping that upon looking for it I havent missed an obvious answer. I have a website, www.silenticonstudio.com, that before I forwarded the address, and used its host site the transition was working in Chrome. Once it became forwarded, it stopped working. It works in Firefox, IE, but not android browswer. It works on chrome on my phone, but not IE mobile. Anyone have any answers? What am I missing? I would be greatly appreciative.
CSS:
{
/*gallery*/
img.floatLeft {
float: left;
margin: 20px;
border:groove;
padding-right:15 px;}
.imagebox { float: left; width: 180px; margin-right: 20px; }
#gallery {width:740px; height:400px; position:relative; z-index:100; padding-right:10px;margin-bottom:150px}
#gallery ul {list-style:none; padding:0; margin:0; width:180px; float:right;}
#gallery ul li {display:inline; width:60px; height:60px; float:left;}
#gallery ul li a {display:block; width:50px; height:50px; text-decoration:none; padding:4px; border:1px solid #fff;}
#gallery ul li a img {width:50px; height:50px; border:0;
-o-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-icab-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-khtml-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-moz-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-webkit-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
}
#gallery ul li a b {position:absolute; visibility:hidden; left:0; top:5px; display:block; width:560px; height:350px; ;
filter: alpha(opacity=0); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); opacity:0;
-webkit-transition: 0.6s ease-in-out;
-moz-transition: 0.6s ease-in-out;
-o-transition: 0.6s ease-in-out;
-ms-transition: 0.6s ease-in-out;
-khtml: 0.6s ease-in-out;
transition: 0.6s ease-in-out;
}
#gallery ul li a b img {
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
-khtml: scale(0);
transform: scale(0);
-webkit-transition: 0.6s ease-in-out;
-moz-transition: 0.6s ease-in-out;
-o-transition: 0.6s ease-in-out;
-ms-transition: 0.6s ease-in-out;
-khtml: 0.6s ease-in-out;
transition: 0.6s ease-in-out;
}
#gallery ul li a:hover {white-space:normal; outline:0;}
#gallery ul li a:hover b {filter: alpha(opacity=100); filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); opacity:1; visibility:visible;}
#gallery ul li a:hover b img {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
-khtml: scale(1);
transform: scale(1);
}
#gallery ul li a b i {display:block; width:570px; height:360px; text-align:center; display:table-cell; vertical-align:middle;}
#gallery ul li a b i img {width:auto; height:auto;/* border:1px solid #000; padding-left:50px;*/
-o-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-icab-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-khtml-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-moz-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
-webkit-box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
}
Simply try something like this
HTML
<ul>
<li>blah</li>
<li>blah2</li>
</ul>
CSS
ul li:nth-child(1){
background-color: #ff0000;
}
ul li:nth-child(2){
background-color: #00ff00;
}
li {
display: inline-block;
height: 20px;
width: 100px;
text-align: center;
transition:width 2s;
-moz-transition:width 2s; /* Firefox 4 */
-webkit-transition:width 2s; /* Safari and Chrome */
-o-transition:width 2s; /* Opera */
}
li:hover {
width: 300px;
}
Related
This is my website http://demo.themevan.com/citynews/ when you check it on android + firefox, click the menu button(top left of the top bar), the side menu will be opened, then click any menu link, you will found they are not clickable.
I guess this is a CSS issue, but I still can't find the reason, please help!
CSS:
.pushy{
position: fixed;
width: 300px;
height: 100%;
top: 0;
z-index: 9998;
background: #222;
font-size: 0.9em;
font-weight: bold;
-webkit-box-shadow: inset -10px 0 6px -9px rgba(0, 0, 0, .7);
-moz-box-shadow: inset -10px 0 6px -9px rgba(0, 0, 0, .7);
box-shadow: inset -10px 0 6px -9px rgba(0, 0, 0, .7);
overflow: hidden;
-webkit-overflow-scrolling: touch; /* enables momentum scrolling in iOS overflow elements */
}
.pushy a{
display: block;
width:100%;
position:relative;
z-index:9999;
color: #b3b3b1;
padding: 10px 30px;
border-bottom: 1px solid rgba(0, 0, 0, .1);
border-top: 1px solid rgba(255, 255, 255, .1);
text-decoration: none;
font:normal 1.5rem "Roboto Slab","Open Sans",Arial;
}
.pushy a:hover{
background: #333;
color: #FFF;
}
.pushy ul{
margin:0;
padding:0;
}
.pushy ul li{
list-style:none;
margin-bottom:0
}
.pushy ul.sub-menu{
text-indent:15px;
}
.pushy ul.sub-menu ul{
text-indent:30px;
}
/* Menu Movement */
.pushy-left{
-webkit-transform: translate3d(-300px,0,0);
-moz-transform: translate3d(-300px,0,0);
-ms-transform: translate3d(-300px,0,0);
-o-transform: translate3d(-300px,0,0);
transform: translate3d(-300px,0,0);
}
.pushy-open{
-webkit-transform: translate3d(0,0,0);
-moz-transform: translate3d(0,0,0);
-ms-transform: translate3d(0,0,0);
-o-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.container-push, .push-push{
-webkit-transform: translate3d(300px,0,0);
-moz-transform: translate3d(300px,0,0);
-ms-transform: translate3d(300px,0,0);
-o-transform: translate3d(300px,0,0);
transform: translate3d(300px,0,0);
}
/* Menu Transitions */
.pushy, #body-container, .push{
-webkit-transition: -webkit-transform .2s cubic-bezier(.16, .68, .43, .99);
-moz-transition: -moz-transform .2s cubic-bezier(.16, .68, .43, .99);
-o-transition: -o-transform .2s cubic-bezier(.16, .68, .43, .99);
transition: transform .2s cubic-bezier(.16, .68, .43, .99);
}
/* Site Overlay */
.site-overlay{
display: none;
}
.pushy-active .site-overlay{
display: block;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 9997;
background-color: rgba(0,0,0,0.5);
-webkit-animation: fade 500ms;
-moz-animation: fade 500ms;
-o-animation: fade 500ms;
animation: fade 500ms;
}
#keyframes fade{
0% { opacity: 0; }
100% { opacity: 1; }
}
#-moz-keyframes fade{
0% { opacity: 0; }
100% { opacity: 1; }
}
#-webkit-keyframes fade{
0% { opacity: 0; }
100% { opacity: 1; }
}
#-o-keyframes fade{
0% { opacity: 0; }
100% { opacity: 1; }
}
/* Example Media Query */
#media screen and (max-width: 768px){
.pushy{
font-size: 1.0em;
}
}
You have a problem $(".pushy").niceScroll({ inside citynew.js.
You should remove the entire on('click') to make it works.
I have this example JSFIDDLE contains a circle, but I'm having trouble to make it responsive according to it's content, in the above example when the content is long, it overflows the circle.
.cd-single-point {
margin:50px;
position: absolute;
border-radius: 50%;
}
.cd-single-point > a {
position: relative;
text-align:center;
padding:2px;
text-decoration: none;
z-index: 2;
display: block;
width: 20px;
height: 20px;
border-radius: inherit;
background: #d95353;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.cd-single-point::after {
/* this is used to create the pulse animation */
content: '';
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
top: 0;
left: 0;
border-radius: inherit;
background-color: transparent;
-webkit-animation: cd-pulse 2s infinite;
-moz-animation: cd-pulse 2s infinite;
animation: cd-pulse 2s infinite;
}
How can I achieve this only with css?
You could use the padding technique on a pseudo element to keep the aspect ratio of the circle and make it responsive according to it's content :
DEMO
HTML :
<div class="wrap">
<div class="in">+46546546</div>
</div>
CSS :
.wrap{
color: #fff;
position:relative;
display:inline-block;
}
.in{
padding:60% 10%;
margin-top:-0.6em;
}
.in:after{
content:'';
position:absolute;
top:0; left:0;
width:120%;
padding-bottom:120%;
background-color:#D95353;
border-radius:50%;
z-index:-1;
}
How about this fiddle? http://jsfiddle.net/ctwheels/bgut7411/9/
HTML
<ul>
<li>
<div class="cd-single-point"> <a class="cd-img-replace" href="#">
<div class="takeNumber">+99</div>
</a>
</div>
</li>
<!-- .cd-single-point -->
</ul>
CSS
/* --------------------------------
Primary style
-------------------------------- */
html * {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
font-size: 100%;
font-family:"Roboto", sans-serif;
color: #33435a;
background-color: #3c4f6a;
}
.cd-single-point {
margin:50px;
position: absolute;
border-radius: 50%;
}
.cd-single-point > a {
position: relative;
text-align:center;
padding:5px;
text-decoration: none;
z-index: 2;
display: block;
min-width: 20px;
min-height: 20px;
border-radius: inherit;
background: #d95353;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.cd-single-point::after {
/* this is used to create the pulse animation */
content:'';
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
top: 0;
left: 0;
border-radius: inherit;
background-color: transparent;
-webkit-animation: cd-pulse 2s infinite;
-moz-animation: cd-pulse 2s infinite;
animation: cd-pulse 2s infinite;
}
#-webkit-keyframes cd-pulse {
0% {
-webkit-transform: scale(1);
box-shadow: inset 0 0 5px 5px rgba(217, 83, 83, 0.8);
}
50% {
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
}
100% {
-webkit-transform: scale(1.6);
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0);
}
}
#-moz-keyframes cd-pulse {
0% {
-moz-transform: scale(1);
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
}
50% {
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
}
100% {
-moz-transform: scale(1.6);
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0);
}
}
#keyframes cd-pulse {
0% {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
}
50% {
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0.8);
}
100% {
-webkit-transform: scale(1.6);
-moz-transform: scale(1.6);
-ms-transform: scale(1.6);
-o-transform: scale(1.6);
transform: scale(1.6);
box-shadow: inset 0 0 1px 1px rgba(217, 83, 83, 0);
}
}
.takeNumber {
color:white;
font-family:Verdana;
font-size:12px;
padding-top:3px;
}
JS
var numItems = $(".cd-single-point").length;
var myHeight, myWidth;
for (i = 0; i < numItems; i++) {
myWidth = $(".cd-single-point>a:eq(" + i + ")").width();
myHeight = $(".cd-single-point>a:eq(" + i + ")").height();
if (myWidth > myHeight) {
$(".cd-single-point>a:eq(" + i + ")").css({
height: myWidth + "px"
});
}
if (myWidth < myHeight) {
$(".cd-single-point:eq(" + i + ")>a").css({
width: myHeight + "px"
});
}
$(".takeNumber:eq(" + i + ")").css({
"line-height": myWidth - parseInt($(".cd-single-point>a:eq(" + i + ")").css("padding"), 10) + "px"
});
}
If you're not opposed to some javascript you could check the width of the contents and then set an equivalent height.
$(function(){
var elementWidth = $(".takeNumber").width();
$(".cd-img-replace").css("height", elementWidth);
});
FIDDLE
Demo
css
.cd-single-point {
height: 30px;
min-width: 30px;
width: auto;
line-height: 30px;
text-align: center;
margin:50px;
position: absolute;
border-radius: 50%;
}
.cd-single-point > a {
display: block;
height: 30px;
min-width: 30px;
width: auto;
line-height: 30px;
text-align: center;
position: relative;
text-decoration: none;
z-index: 2;
border-radius: inherit;
background: #d95353;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.takeNumber {
color:white;
font-family:Verdana;
font-size:12px;
padding: 0 5px;
}
I'm helping a friend out with a website and she has pretty specific type of button in mind:
"I would like the buttons to be hexagon shape, with a photo in the middle and actually depress as clicked before moving to the portfolio page."
I've managed to create a rounded square that depresses using CSS and HTML pretty easily, however I can't work out a hexagon. Anyone offer some help here?
Fiddle
HTML:
<a href="#" class="button">
<span>
<p> Jorgie</p></span>
</a>
CSS:
.button {
display: inline-block;
margin: 30px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: 0 8px 0 #463E3F, 0 15px 20px rgba(0, 0, 0, .35);
-moz-box-shadow: 0 8px 0 #463E3F, 0 15px 20px rgba(0, 0, 0, .35);
box-shadow: 0 8px 0 #463E3F, 0 15px 20px rgba(0, 0, 0, .35);
-webkit-transition: -webkit-box-shadow .1s ease-in-out;
-moz-transition: -moz-box-shadow .1s ease-in-out;
-o-transition: -o-box-shadow .1s ease-in-out;
transition: box-shadow .1s ease-in-out;
font-size: 20px;
color: #fff;
}
.button span {
display: inline-block;
background-color: black;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
-webkit-box-shadow: inset 0 -1px 1px rgba(255, 255, 255, .15);
-moz-box-shadow: inset 0 -1px 1px rgba(255, 255, 255, .15);
box-shadow: inset 0 -1px 1px rgba(255, 255, 255, .15);
font-family: 'Pacifico', Arial, sans-serif;
line-height: 1;
text-shadow: 0 -1px 1px rgba(175, 49, 95, .7);
-webkit-transition: background-color .2s ease-in-out, -webkit-transform .1s ease-in- out;
-moz-transition: background-color .2s ease-in-out, -moz-transform .1s ease-in-out;
-o-transition: background-color .2s ease-in-out, -o-transform .1s ease-in-out;
transition: background-color .2s ease-in-out, transform .1s ease-in-out;
}
.button:hover span {
background-image:url(jorgie.jpg);
background-repeat:no-repeat;
background-position:center;
text-shadow: 0 -1px 1px rgba(175, 49, 95, .9), 0 0 5px rgba(255, 255, 255, .8);
}
.button:active, .button:focus {
-webkit-box-shadow: 0 8px 0 #463E3F, 0 12px 10px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 8px 0 #463E3F, 0 12px 10px rgba(0, 0, 0, .3);
box-shadow: 0 8px 0 #463E3F, 0 12px 10px rgba(0, 0, 0, .3);
}
.button:active span {
-webkit-transform: translate(0, 4px);
-moz-transform: translate(0, 4px);
-o-transform: translate(0, 4px);
transform: translate(0, 4px);
}
Here is a hexagon shaped button adapted from the soluion described in this question : Button with pointed edges and shadow :
The hexagon is made with skewed pseudo elements the shadow is made with box-shadows and the transition on the click event is made with CSS:
DEMO
HTML :
<div class="button top">
<div class="button bottom"></div>
</div>
CSS :
.top{
position:relative;
top:0;
margin-left:150px;
width: 45px;
height: 60px;
-webkit-transition: top .1s;
-ms-transition: top .1s;
transition: top .1s;
}
.button:before, .button:after{
position: absolute;
width:70%; height:50%;
content: "";
z-index:-1;
}
.top:before {
left:0; top:0;
-webkit-transform:skewX(-20deg);
-ms-transform:skewX(-20deg);
transform:skewX(-20deg);
background: #469BF9;
box-shadow: -5px 10px 0px -5px #104f96;
z-index:-2;
}
.top:after {
right:0; top:0;
-webkit-transform:skewX(20deg);
-ms-transform:skewX(20deg);
transform:skewX(20deg);
background: #469BF9;
box-shadow: 5px 10px 0px -5px #104f96;
z-index:-2;
}
.bottom:before{
left:0; top:50%; transitions.
-webkit-transform:skewX(20deg);
-ms-transform:skewX(20deg);
transform:skewX(20deg);
background: #1E80F7;
box-shadow: -4px 5px 0px 0px #104f96;
}
.bottom:after{
right:0; top:50%;
-webkit-transform:skewX(-20deg);
-ms-transform:skewX(-20deg);
transform:skewX(-20deg);
background: #1E80F7;
box-shadow: 4px 5px 0px 0px #104f96;
}
.button:after, .button:before{
-webkit-transition: box-shadow .1s;
-ms-transition: box-shadow .1s;
transition: box-shadow .1s;
}
.top:active{
top:5px;
}
.button:active:after, .button:active:before, .button:active .button:before, .button:active .button:after {
box-shadow: 0px 0px 0px 0px #104f96;
}
To my knowledge,a hexagon with full image requires multiple divs as follows
JSfiddle Demo
HMTL
<div class="hexagon">
<div class="hexagon-in1">
<div class="hexagon-in2">
</div>
</div>
</div>
CSS
.hexagon {
-webkit-transform: rotate(120deg);
-moz-transform: rotate(120deg);
-o-transform: rotate(120deg);
transform: rotate(120deg);
cursor: pointer;
width: 400px;
height: 200px;
margin: 25px;
visibility: hidden;
overflow: hidden;
}
.hexagon-in1 {
width: 100%;
height: 100%;
-webkit-transform: rotate(-60deg);
-moz-transform: rotate(-60deg);
-o-transform: rotate(-60deg);
transform: rotate(-60deg);
overflow: hidden;
}
.hexagon-in2 {
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-position: 50%;
background-image: url(http://placekitten.com/241/241);
visibility: visible;
-webkit-transform: rotate(-60deg);
-moz-transform: rotate(-60deg);
-o-transform: rotate(-60deg);
transform: rotate(-60deg);
}
.hexagon-in2 a {
display: block;
}
Actual 'button down' effects might a little harder.
Frankly, I'd be looking to use an actual image here..rather than unsemantic 'styling' divs for this button.
For hexagon button, here's a FIDDLE
<div id="hexagon"></div>
#hexagon {
width: 100px;
height: 55px;
background: red;
position: relative;
}
#hexagon:before {
content: "";
position: absolute;
top: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-bottom: 25px solid red;
}
#hexagon:after {
content: "";
position: absolute;
bottom: -25px;
left: 0;
width: 0;
height: 0;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
border-top: 25px solid red;
}
I have a tooltip box and it is working fine. Now I want to add some fade in fade out once the tool-tip box pops in and out.
<a class="tooltip" title="This is some information for our tooltip." href="#"><img id="graph_one" alt="" src="https://www.onlandscape.co.uk/wp-content/uploads/2013/09/Doug-Chinnery-ICM-Images-4-45x45.jpg" class="graph one"> </a>
Demo : http://jsfiddle.net/squidraj/FHUbA/
How about this?
http://jsfiddle.net/FHUbA/14/
.tooltip:after{
opacity: 0;
-webkit-transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
transition: opacity .25s ease-in-out;
background: #333;
background: rgba(0, 0, 0, .8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: attr(title);
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
}
.tooltip:hover:after {
opacity:1;
}
What about this one:
http://jsfiddle.net/Roobyx/FHUbA/45/
(you can fix the styles afterwards)
HTML:
<a class="has-tooltip" href="#">
<span class="tooltip">This is some information for our tooltip.</span>
<img id="graph_one" class="graph one" src="https://www.onlandscape.co.uk/wp-content/uploads/2013/09/Doug-Chinnery-ICM-Images-4-45x45.jpg" />
</a>
CSS:
a[title].tooltip {
width:45px;
height:90px;
}
.tooltip {
display: inline-block;
position: relative;
}
.has-tooltip {
color: #555;
font-size: 16px;
display: block;
margin: 150px 75px 10px 75px;
padding: 5px 5px;
position: relative;
text-align: center;
width: 200px;
-webkit-transform: translateZ(0); /* webkit flicker fix */
-webkit-font-smoothing: antialiased; /* webkit text rendering fix */
}
.has-tooltip .tooltip {
background: #000;
bottom: 100%;
color: #fff;
display: block;
left: -10px;
margin-bottom: 15px;
border-radius: 5px;
opacity: 0;
padding: 20px;
position: absolute;
visibility: hidden;
width: 100%;
-webkit-transform: translateY(10px);
-moz-transform: translateY(10px);
-ms-transform: translateY(10px);
-o-transform: translateY(10px);
transform: translateY(10px);
-webkit-transition: all .25s ease-out;
-moz-transition: all .25s ease-out;
-ms-transition: all .25s ease-out;
-o-transition: all .25s ease-out;
transition: all .25s ease-out;
-webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-ms-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-o-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
}
.has-tooltip .tooltip:before {
bottom: -20px;
content: " ";
display: block;
height: 20px;
left: 0;
position: absolute;
width: 100%;
}
.has-tooltip .tooltip:after {
border-left: solid transparent 10px;
border-right: solid transparent 10px;
border-top: solid #000 10px;
bottom: -10px;
content: " ";
height: 0;
left: 50%;
margin-left: -13px;
position: absolute;
width: 0;
}
.has-tooltip:hover .tooltip {
opacity: 1;
visibility: visible;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
}
For the life of me I can't figure out how to correct this. I am trying to replicate the effect from http://css-tricks.com/examples/DifferentTransitionsOnOff/ for my Wordpress image grid (code from here https://gist.github.com/matthiaspabst/1959566). 180x150 is my wp post_thumbnail image size.
Trial and error is not getting me anywhere for the past 2 hours. Here is my amateurish attempt at it http://jsfiddle.net/9F3aF/. Please help.
HTML
<div class="gridcontainer">
<div class="griditemleft">
<div class="postimage">
<img width="180" height="134" src="http://www.football-quebec.com/IMG/cache-180x134/arton1095-180x134.jpg" class="attachment-post-thumbnail wp-post-image" alt="lions" />
</div>
</div>
</div>
CSS
/* Thumbnail Grid */
.gridcontainer {}
.gridcontainer .griditemleft, .gridcontainer .griditemright {float: left; width: 210px; height:164px;}
.griditemleft .postimage img, .griditemright .postimage img {
display: block;
position: relative;
padding: 10px 10px 10px 10px;
border: 5px solid #aefbae;
background-image: -moz-linear-gradient(top, #5be93a, #278312);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #5be93a),color-stop(1, #278312));
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
-webkit-transform: rotate(720deg) rotateY(0);
-webkit-transition: all 0.5s;
-webkit-transition-timing-function: cubic-bezier(1, 0.8, 0.5, 1);
-webkit-transition-delay: 0.5s;
-moz-transform: rotate(720deg);
-moz-transition: all 0.5s;
-moz-transition-timing-function: cubic-bezier(1, 0.8, 0.5, 1);
-moz-transition-delay: 0.5s;
-o-transform: rotate(720deg);
-o-transition: all 0.5s;
-o-transition-timing-function: cubic-bezier(1, 0.8, 0.5, 1);
-o-transition-delay: 0.5s;
-webkit-box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.griditemleft .postimage img:hover, .griditemright .postimage img:hover {
-webkit-transition: padding 0.2s, top 0.2s;
-webkit-transform: rotate(0deg) rotateY(0);
-webkit-transition-delay: 0;
-moz-transition: padding 0.2s, top 0.2s;
-moz-transform: rotate(0deg);
-moz-transition-delay: 0;
-o-transition: padding 0.2s, top 0.2s;
-o-transform: rotate(0deg);
-o-transition-delay: 0;
z-index: 1;
padding: 20px 20px 20px 20px;
margin: -10px 0 0 -10px;
background-image: -moz-linear-gradient(top, #5be93a, #5be93a, #278312);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #5be93a),color-stop(0.2, #5be93a),color-stop(1, #278312));
width: 180px; height:134px;
}
.griditemleft .postimage img:after, .griditemright .postimage img:after {
background: url(noise.png) center center;
z-index: -1;
position: absolute;
}
.griditemleft .postimage img:before, .griditemright .postimage img:before {
z-index: -2;
-webkit-transition: all 0.2s;
-webkit-transform: rotate(0deg) rotateY(0);
-webkit-transition-delay: 0;
-moz-transition: all 0.2s;
-moz-transform: rotate(0deg) rotateY(0);
-moz-transition-delay: 0;
-o-transition: all 0.2s;
-o-transform: rotate(0deg) rotateY(0);
-o-transition-delay: 0;
position: absolute;
}
.griditemleft .postimage img:hover:before, .griditemright .postimage img:hover:before {
-webkit-box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
-moz-box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
position: absolute;
}
.griditemleft .postimage img:active, .griditemright .postimage img:active {
-webkit-box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
-moz-box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}
P.S. Is there any useless css in there?
Thanks
Try removing this line from your class that starts with ".griditemleft .postimage img:hover"...
margin: -10px 0 0 -10px;
I did it here. Is this what you were going for? http://jsfiddle.net/gEYxr/