css-transitions

Weird CSS3 Transition (flickering)

与世无争的帅哥 提交于 2019-11-28 16:41:55
When I hover unto my button, it gives a white flash first when starting the transition. Why does it sort of flickers when I apply a css3 transition to my button? My browser is Google Chrome See here <button>Log In</button>​ CSS: button { background: #ff3019; background: -moz-linear-gradient(top, #ff3019 0%, #cf0404 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff3019), color-stop(100%,#cf0404)); background: -webkit-linear-gradient(top, #ff3019 0%,#cf0404 100%); background: -o-linear-gradient(top, #ff3019 0%,#cf0404 100%); background: -ms-linear-gradient(top,

CSS how to make an element fade in and then fade out?

元气小坏坏 提交于 2019-11-28 16:41:30
I can make an element with an opacity of zero fade in by changing its class to .elementToFadeInAndOut with the following css: .elementToFadeInAndOut { opacity: 1; transition: opacity 2s linear; } Is there a way I can make the element fade out after it fades in by editing css for this same class? Thank you very much for your time. Gildas.Tambo Use css @keyframes .elementToFadeInAndOut { opacity: 1; animation: fade 2s linear; } @keyframes fade { 0%,100% { opacity: 0 } 50% { opacity: 1 } } here is a DEMO .elementToFadeInAndOut { width:200px; height: 200px; background: red; -webkit-animation:

Seeking an elegant, CSS-only method for hiding/showing auto-height content (with transitions)

杀马特。学长 韩版系。学妹 提交于 2019-11-28 16:21:44
I'd like a method that uses only CSS transitions, to effectively (and attractively) hide/show content on hover. The caveat being that I wish to keep dynamic (auto) height. It seems that the optimal route would be to transition between a fixed height:0 , to a height:auto , but alas this is not yet supported by transitions in browsers. A clarification in response to the comments :: This isn't so much a question of waiting until all living browsers are CSS3 compatible, but rather addressing a perceived shortcoming of CSS3 itself (eg. the lack of height:0 > height:auto ) I've explored a few other

How to build floating menu bar when scroll down

这一生的挚爱 提交于 2019-11-28 16:20:21
问题 When I scrolled down site display black menu bar at the top look like float bar. but I think there's jquery involved with this. I have tried CSS but seems not working for me like the way i want it to #menucontainer { position:fixed; top:0; height: 250px } #firstElement { margin-top: 250px } Here is the website basic idea of what I would like the menu to be like: http://avathemes.com/WP/Hexic/ 回答1: Wrap your menu in an div or section with an ID or class. #yourID.fixed { position: fixed; top: 0

Disable/turn off inherited CSS3 transitions

无人久伴 提交于 2019-11-28 16:07:28
问题 So i have the following css transitions attached to the a element: a { -webkit-transition:color 0.1s ease-in, background-color 0.1s ease-in ; -moz-transition:color 0.1s ease-in, background-color 0.1s ease-in; -o-transition:color 0.1s ease-in, background-color 0.1s ease-in; transition:color 0.1s ease-in, background-color 0.1s ease-in; } Is there a way to disable these inherited transitions on specific a elements? a.tags { transition: none; } Doesn't seem to be doing the job. 回答1: The use of

Create easy function 40% off set

荒凉一梦 提交于 2019-11-28 14:39:57
I have animation follows this timing function: cubic-bezier(0.25, 0.1, 0.25, 1.0) I want to mod this function so i just get the ending 40% of it. To make things easy lets just say I want the end 50% of the function. How can I do this. So graphically this is what it is: https://developer.mozilla.org/files/3429/cubic-bezier,ease.png and I want to to make a cubic-bezier with parameters such that graphically we only see the top portion, so what we see from 0.5 to 1 (on the yaxist) porition of this graph, i want to make that same line but from 0 to 1. Please help me how to make this function. If

Background-size transitions in Chrome 51 - a bug or a feature?

↘锁芯ラ 提交于 2019-11-28 13:38:07
Background-size transitions are no longer working in Chrome 51 . I know that it was never supposed to work (see this ), but it did and still many people used it. I'm talking about percentage transitions on hover. I'm wondering if this is a bug in the new Chrome (which is possible, since this version brings a lot of new stuff), or they've decided to remove that transition for good? No issues in other browsers. div { background: url(http://cdn2.business2community.com/wp-content/uploads/2014/12/Super-Mario-no-longer-the-007.jpg) no-repeat center center; background-size: 50%; display: inline-block

very simple JavaScript / jQuery example: unexpected evaluation order of instructions

橙三吉。 提交于 2019-11-28 13:31:46
I am surprised by the fact that a CSS3 transition rule applied via jQuery after a jQuery-based CSS property change actually animates this property change. Please have a look at http://jsfiddle.net/zwatf/3/ : Initially, a div is styled by two classes and has a certain height (200px) due to the default CSS properties of these two classes. The height is then modified with jQuery via removal of one class: $('.container').removeClass('active'); This reduces the height from 200px to 15px. After that, a transition rule is applied to the container via addition of a class: $('.container').addClass('all

Weird behavior when rotating an element on hover

删除回忆录丶 提交于 2019-11-28 12:28:51
问题 Given these two examples. Using Hover div { position: absolute; width: 150px; height: 40px; background: orange; left: 50%; top: var(--top); transition: transform 2s; transform: translateX(-50%); text-align: center; line-height: 40px; font-size: 1.2em; } div:hover { transform: translateX(-50%) rotate(var(--deg)); } div:nth-child(1) { --deg: 180deg; --top: 20%; } div:nth-child(2) { --deg: -180deg; --top: 40%; } div:nth-child(3) { --deg: 360deg; --top: 60%; } <div>180deg</div> <div>-180deg</div>

CSS Transition from display none to display block and vice versa

删除回忆录丶 提交于 2019-11-28 12:14:39
I know this question has probably been asked million times here in SO, but Ive tried most of the solution, I just dont know why it dont work for me. So I have a dropdown with display initially targeted to none . When I click on it, it shows nice transition. (So far so good). But when I click on it again to go hide the dropdown, it hides immediately, but I dont want that. I want to hide with similar transition that was assigned to show. Here is my code for CSS: .dropdown-menu { padding: 0 0; display: none; -webkit-animation: slide-down .3s ease-out; -moz-animation: slide-down .3s ease-out; }