I'm trying to create a horizontal menu that will display a list of icons with centered text underneath.
This is what i have achieved so far:
http://lifeofstrange.com/fade/
I would like the icons to use one image sprite that will fade in/out when you hover, if possible the text underneath will also have the fade effect.
I'm very close to achieving the effect however i'm not sure where the css3 transitions would be in the code,
Your help or assistance is much appreciated.
If you want a fade transition on the arrow and text, then you won't want to be changing the color of the text and the position of the arrow background. What you will want to do is set the background to be the darker arrow, and then when you hover set the opacity of it to say 0.6 or something, and same with the text. If you transitioned the background position you would see a slide effect from one part of the sprite to the other, and this isn't what you want.
ul li a {
-webkit-transition: opacity 0.3s;
-moz-transition: opacity 0.3s;
-o-transition: opacity 0.3s;
transition: opacity 0.3s;
}
ul li a:hover {
opacity: 0.6;
}
Related
I'm a css newbie. How to flip an image linked to url on a html page (not background image) to show some text?
Alternatively for fade out,how to fade an image on hover? this is the code I tried, it doesn't work properly. It's fading the entire container with all the images instead of just 1 image at a time.
.withfadeout {
opacity: 1;
transition: opacity .2s ease-in-out;
-webkit-transition: opacity .2s ease-in-out;
-moz-opacity: 0.2;
}
.withfadeout:hover {
opacity: 0.25;
}
I removed the fadeout class but the site is still fading out everything.
Many thanks.
without jQuery. I think you should give an id to each image
jQuery make that easier.
Okay so what I'm trying to do should be pretty simple (I hope).
I am using a wordpress plugin for my menu and an extension to make it sticky. My menu isn't at the top already, it is below another container, so it becomes sticky when the menu container reaches the top of the browser screen (as it should).
I have a menu item that is hidden when the menu is "not sticky" and then it becomes visible when it is "sticky." Everything works perfectly, however now I want to add a fade in effect preferably only using CSS3 (for simplicity of integration). So the fade in effect should take place when the visibility become visible (see code below, but basically when the menu becomes sticky)
My custom class for the menu item is ".jrm-um-sticky-only"
Here is my code to achieve the appearing/disappearing menu item:
#megaMenu ul.megaMenu li.jrm-um-sticky-only{
display: block !important;
visibility: hidden !important;
opacity: 0 !important;
}
#megaMenu-sticky-wrapper #megaMenu.ubermenu-sticky li.jrm-um-sticky-only{
display: block !important;
visibility: visible !important;
opacity: 1 !important;
}
I tried adding:
-webkit-transition: visibility 0.2s linear, opacity 0.2s linear;
-moz-transition: visibility 0.2s linear, opacity 0.2s linear;
-o-transition: visibility 0.2s linear, opacity 0.2s linear;
to the last selector above (where the opacity is 1), but it didn't work. I also tried setting opacity to 0 along with the above transition code but no avail.
I'm a newbie so sorry if there are errors in my approach here. (not sure if I need the opacity at 0 if the visibility is hidden???)
Thanks!!!!
Maybe you should add your transition rules to the first block
(#megaMenu ul.megaMenu li.jrm-um-sticky-only)
So I'm having an issue with the default modal animation.
I know how to customise the speed of the animation for the fade in animation with the modal window, but there is an issue.
There is a delay between when the .modal-backdrop div fades in, and when the actual .modal div fades in. I realise that this delay is in their originally to account for time for the modal body to slide down from the top.
I have removed the top slide down animation, and just want a simple, quick fade in.
I can't seem to remove this delay, no matter what sort of hackyness I apply to the .modal.fade / .modal.fade.in classes.
Where on does this delay come from in Bootstrap?
If you just remove the slide transition, all else seems to work fine.
http://jsfiddle.net/isherwood/vvsnB/
.modal.fade {
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
I have a problem with the CSS transition property.
I need to declare two transitions for a section-tag. Every transition with the section should have a duration of 1s, only the background should have a duration of 0.3s
So my CSS-transition code would look like that:
section{
background: black;
transition: all 1s ease, background 0.3s ease;
}
section:hover{
background: green;
transform: translateY(100px);
}
But when I hovering the link now, the background get animated in 1s and it blinks strangely.
Here the codepen Demo
Someone know why this happend? And how can I realize my goal?
And yes, I need the all property!
EDIT
Just found a strange one. In the linked codepen above, it blinks. But when I animate also the padding, it stop blinking! But the background will be animated in 1s...
Here's the second demo
I have tried this in code pen, the problem not in the transition property.
Better you use div tag for the link background and create separate transition for that.
Surely div tag will give the best solution for your problem.
The problem occurred because as you hover over the element, it starts moving downwards.
When the element is not hovered, it would revert back.
Now as you hover, the elements starts moving and then loses the hover immediately which causes it to return to original state but again gains the hover effect as it again receives the mouse-over event which also cause blink, and the strange phenomenon you observed.
If you place mouse close towards the bottom, you observe the desired effect.
The fix should be that you write a hover for the container that contains these elements and apply the effect to these elements.
Besides you've applied transition in only 1 state which also may be the reason for blink;
try using transitions to both the statements like below:
section{
width:300px;
height:300px;
background:black;
color:white;
transition: background 0.3s ease, all 3s ease;
}
section:hover{
background:green;
transition: background 0.3s ease, all 3s ease;
}
Is there any way I can use CSS3 to fade in and out a solid white background of a <div>?
the content should remain visible so just the background should fade.
Any ideas using css3 transitions/transforms?
thank you for your help.
Sure, you can use the transition property directly on the background-color:
div {
background-color: white;
/* transition the background-color over 1s with a linear animation */
transition: background-color 1s linear;
}
/* the :hover that causes the background-color to change */
div:hover {
background-color: transparent;
}
Here's an example of a red background fading out on :hover.
You may find this useful for examples of image and background color fades: -
http://nettuts.s3.amazonaws.com/581_cssTransitions/demos.html
However using CSS 3 to do the transition will limit the effect to browsers that don't support it.
You could have two divs in one container div. The first div contains the white background, the second one gets the content.
Then, use a CSS3 transform to animate the opacity of the first div to zero.