Ok, so I don't understand why this doesn't ease out, only in: (for quick view, just paste it in http://htmledit.squarefree.com, for instance)
<style>
#over {
background: url(http://th01.deviantart.net/fs71/150/f/2013/005/0/6/dal_shabet__have__don_t_have_by_awesmatasticaly_cool-d5qkzu8.jpg);
height:150px;
width:150px;
}
#in {
background: url(http://www.mygrafico.com/images/uploads/thumbs/thumb_revidevi_CoolMonsterTruck.jpg);
height:150px;
width:150px;
}
#in:hover {
opacity: 0;
transition: opacity .3s ease-in-out;
}
</style>
<div id="over">
<div id="in"></div
</div>
I'm not sure exactly what you're asking, but I think you are saying that the transition is only occurring in on a mouse over, and not when you mouse out (it just snaps back to the way it was before, instead of transitioning). You need to add your transition property to #in, rather than #in:hover. The transition is only occurring when your #in element is being hovered over. Move the css for the transition under #in and it will work on mouse over and mouse out. You want to leave your desired css for the hover state under #in:hover, in this case, the opacity change, but the actual transition css property will go under #in.
To make it a little more clear:
#in {
background: url(http://www.mygrafico.com/images/uploads/thumbs/thumb_revidevi_CoolMonsterTruck.jpg);
height:150px;
width:150px;
transition: opacity .3s ease-in-out; /* add this here */
}
#in:hover {
opacity:0;
/* and we've removed it from here */
}
The thing to know is that ease-in-out has nothing to do with when it will transition. It may seem that way, that ease-in is on hover, and ease-out is on mouseout, but actually, ease-in-out means that it will ease in and out slowly, rather than something like ease-in, which eases into the transition slowly and then speeds up towards the end. It relates to the style of the transition itself, rather than when it will occur.
Maybe you already understood that, but based on your question it seems you were confused there.
I found #welbornio 's answer worked for me, however ease-in-out didn't work perfectly at first. When applied to the 'img' the ease effect only worked intermittently. I found that in order for the effect to work everytime, I had to apply the ease-in to the 'img' and the ease-out to the 'hover'. I'm not sure why this was happening but that's a solution if anyone runs into the same issue.
Related
Hopefully the title makes this fairly self-explanatory.
Just a bit of background, I create and launch an aurelia modal dialog which appears on top of the parent window from where it is launched.
Is there a way to make the background (parent) window appear faded. I have done something similar in .NET environments, and just wanted to know if anything similar is achievable in aurelia?
Some example aurelia-dialog links:
https://www.tutorialspoint.com/aurelia/aurelia_dialog.htm
https://aurelia.io/docs/plugins/dialog#using-the-plugin
The answer to my question turned out to be on one of the aurelia forums:
https://github.com/aurelia/dialog/issues/84#issuecomment-239429527
It's a case up updating your css to include the background / opacity settings as follows:
ai-dialog-overlay.active {
background-color: black;
opacity: .5;
}
Having said this please be aware a breaking change had since been introduced whereby 'ai-dialog' was renamed to 'ux-dialog':
https://discourse.aurelia.io/t/trouble-with-aurelia-dialog-not-displaying-correctly/1382
So the code for your css should now read:
ux-dialog-overlay.active {
opacity: 0.6;
background-color: gray;
}
I found that this was all that was needed to make the background fade on opening the aurelia-based modal dialog, as well as un-fading on closing.
When using TREEVIEW with doxygen, the bar separating the box on the left stops part of the way down the page.
Is there a way to fix this so that the separator always extends to the bottom of the page?
In my Doxyfile, I don't see any options that can control this. It also appears that the doxygen homepage has the same issue (although it is less obvious due to the color scheme). Is this just a bug in doxygen?
This look to me like a bug in doxygen, when people use very small letters or have a very large screen / canvas.
In the generated html/navtree.css we have the block:
.ui-resizable-e {
background-image:url("splitbar.png");
background-size:100%;
background-repeat:no-repeat;
background-attachment: scroll;
cursor:ew-resize;
height:100%;
right:0;
top:0;
width:6px;
}
and I think this would be better when the: background-repeat:no-repeat; is set to background-repeat:repeat;,
so:
.ui-resizable-e {
background-image:url("splitbar.png");
background-size:100%;
background-repeat:repeat-y;
background-attachment: scroll;
cursor:ew-resize;
height:100%;
right:0;
top:0;
width:6px;
}
As a solution / workaround, for your own generated output, one can set the HTML_EXTRA_STYLESHEET with an extra stylesheet overruling the default stylesheet setting so e.g. HTML_EXTRA_STYLESHEET = my_navtree.css and place in the my_navtree.css the following code:
.ui-resizable-e {
background-repeat:repeat-y;
}
I've just pushed a proposed patch for the master repository of doxygen (pull request 6455, https://github.com/doxygen/doxygen/pull/6455): "Truncated split bar in HTML output between treeview and normal text area", this pull request has been integrated into the development master of doxygen.
Can we shift arrow icon to right in sap.m.Panel in SAPUI5, I tried to search it through its documentation but unable to find it. Please suggest if it is possible to do SO by some customization of control.
Not the preferred way upto my knowledge and I don't know any other way to do it.
.sapMPanelWrappingDiv .sapUiIconPointer{
right : 0;
}
Use right : 0!important; if not working with above code.
First things first: I don't think this is a good decision UX-wise...
Anyways you have several choices to achieve this from trivial to complex:
Use CSS to position icon to the right as mentioned by santhosh
Hide the expand icon via CSS (display: none;) and use the headerToolbar aggregation. In there you can do what you want and place a button to the right with a press-listerner expanding/collapsing the panel
Override sap.m.PanelRenderer.renderHeader and adjust the icon placement right in the renderer
Here is my CSS solution (which I would go for):
.sapMPanel.myPanelIconRight .sapMPanelExpandableIcon {
right: 0;
-webkit-transform: translateY(-50%) rotate(180deg);
-ms-transform: translateY(-50%) rotate(180deg);
transform: translateY(-50%) rotate(180deg);
}
.sapMPanel.myPanelIconRight .sapMPanelWrappingDiv .sapMPanelHdr,
.sapMPanel.myPanelIconRight .sapMPanelWrappingDivTb .sapMIBar.sapMTB {
padding-right: 0;
margin-right: 3rem;
}
Please note the class I myPanelIconRight attached to the sap.m.Panel control to separate our custom styling from the UI5 CSS.
BR
Chris
I'm implementing some custom components for openui5/sapui5.
For the component, I want to have a css animation when it is initially loaded.
This is quite straight forward as I add the following css:
#-webkit-keyframes card-in-animation {
from {
-webkit-transform: translateY(50em) rotate(5deg);
opacity:0;
}
}
.card {
animation:card-in-animation 0.7s .2s ease-out both;
-webkit-animation:card-in-animation 0.7s .2s ease-out both;
}
The problem arises when the component is re-rendered for some reason by the openui5 framework.
The DOM elements are then destroyed and new ones are created.
This causes the animation to triggered once again.
To see this in practice:
Go to http://elsewhat.github.io/openui5-cards/cdn/latest/example3.html
The initial animation is triggered as wanted
Click on the menu icon in the top right corner of any card
A new unwanted animation is triggered
What's the preferred method of avoiding this in openui5?
Inside of your renderer you can set an flag that this control/component is rendered once.
second time you'll run into this renderer you'll check this flag and doesn't render this specific class.
if(!oControl._renderedOnce) {
oRm.addClass('rotate');
oControl._renderedOnce = true;
}
oRm.writeClasses();
Not sure how to overcome the unwanted re-rendering, but would it be an option to remove the animation class after the cards are rendered? (You may need to trigger it after a few seconds after onLoad for all cards to be set in place)
Something like this:
$("<element_of_your_cards>").removeClass("card")
Using keyframes, it is possible to animate an element as soon as it is inserted into the DOM. Here's some sample CSS:
#-moz-keyframes fadeIn {
from {opacity:0;}
to {opacity:1;}
}
#-webkit-keyframes fadeIn {
from {opacity:0;}
to {opacity:1;}
}
#keyframes fadeIn {
from {opacity:0;}
to {opacity:1;}
}
#box {
-webkit-animation: fadeIn 500ms;
-moz-animation: fadeIn 500ms;
animation: fadeIn 500ms;
}
Is there some similar functionality available to apply an animation (via CSS, no JavaScript) to an element right before it is removed from the DOM? Below is a jsFiddle I made to play around with this idea; feel free to fork it if you know of a solution.
jsFiddle - http://jsfiddle.net/skoshy/dLdFZ/
Create another CSS animation called fadeOut, say. Then when you want to remove the element, change the animation property on the element to that new animation, and use the animationend event to trigger the actual removal of the element once the animation is done:
$('.hide').click(function() {
if (!$(this).hasClass('disabled')) {
$('#fill').css('-webkit-animation', 'fadeOut 500ms');
$('#fill').bind('webkitAnimationEnd',function(){
$('#fill').remove();
$('.show, .hide').toggleClass('disabled');
});
}
});
See also my updated version of your jsFiddle. That works for me in Safari, at least.
Well, you should be using a class instead of that .css().
I don't think jQuery has any "real" support for CSS animations yet, so I don't think you can get rid of that webkitAnimationEnd. In Firefox it's just called animationend.
I'm pretty sure there's no way to do this in just CSS.
I've been working on a component library for javascript and I ran into this problem myself. I have the benefit of being able to throw a ton of javascript at the problem, but since you're already using a bit, consider the following for a gracefully degrading solution:
On removal of any component/dom node, add a class called 'removing'.
Then in the css you can define your animation using that class:
.someElement.removing {
-webkit-animation: fadeOut 500ms;
-moz-animation: fadeOut 500ms;
animation: fadeOut 500ms;
}
And back in the javascript, just after you add the 'removing' class, you should be able to check for the 'animation' css property, and if it exists, then you know that you can hook on 'animationEnd' and if it doesn't, then just remove the element right away. I remember testing this a while back, it should work; I'll see if I can dig up the example code.
Update:
I've dug up this technique and started writing a really cool plugin for jQuery that allows you to use CSS3 animations for DOM elements that are being removed. No additional Javascript required: http://www.github.com/arthur5005/jquery.motionnotion
It's very experimental, use at your own risk, but would love some help and feedback. :)
ideally for something like fadeIN and fadeOUT you should be using css transitions not css animations..