why is animate( opacity:1 ) making my font-weight change? - jquery-animate

I have a slider where i make the content fade in and out starting with opacity:0; and then it runs this function. When this happens my text's font-weight shows up normal for the first 499 milliseconds then it jolts to bold at the end of the animation. Any clue as to why it does that and how to fix it?
s2.animate({
opacity:1
},500)

Related

QML (KDE Plasmoid): Can't get seamless scrolling text to loop accordingly

I'm working on a plasmoid for KDE Plasma and can't figure out how to implement a scrolling header bar, similar to ones you see at the bottom of the screen on news channels. I want to have a line of text which horizontally scrolls inside a colored box at a fixed speed, looping forever and seamlessly starting over once it reaches the end. I figured out the basic part of the looping transition, allowing the text to move outside of its box then come out the other end:
Rectangle {
width: myItem.width
height: myItem.height
color: myColor
Text {
width: myItem.width
wrapMode: "NoWrap"
maximumLineCount: 1
color: theme.textColor
text: "Whatever goes here."
SequentialAnimation on x {
running: true
loops: Animation.Infinite
NumberAnimation { from: -myItem.width; to: myItem.width; duration: 1000; easing.type: Easing.InOutQuad }
PauseAnimation { duration: 250 }
}
}
}
But this doesn't take into account the length of the text string in order to adjust the start / end position and duration to its real width. It also requires moving the text completely out of bounds then back in, leaving the box empty for one frame... I wonder if there's a way to make it connect seamlessly. It also doesn't notice when I resize the plasmoid and adapt the animation range, only the scale detected at the start is taken into account. How do you suggest redoing that definition to work around scale issues and get consistent results with any box size and text length?

Safari a:hover changing sibling in fixed element

I am making a simple fixed SoMe sharing button set for a blog. Everything is fine and dandy except in Safari. Hovering over one of the buttons changes the background-color of the siblings to a color I do not specify anywhere in my CSS. This behavior goes away as soon as I change the wrapper from fixed to relative/static/absolute.
Has anyone ever run into this?
Am I doing something wrong?
If not, is there a hack/fix/workaround?
HTML:
<div id="share-links">
<a class="share-twitter" href="#">a</a>
<a class="share-facebook"href="#">a</a>
<a class="share-linkedin" href="#">a</a>
</div>
CSS:
#share-links{
left:0;
top:5em;
position:fixed;
}
#share-links a{
display:block;
height:2em;
width:2em;
color:white;
background-color:#a16159;
}
#share-links a:hover{
background-color:#8a392e;
}
Fiddle: https://jsfiddle.net/u6vzq192/26/
I discovered this problem in a slightly different situation. I have pagination dots in a fixed div using links like you have set up. I am adding a class to the links with Javascript which in turn changes the background color. Every time this happens the background colors of all the other links go crazy. I believe that it is a rendering bug in Safari inverting the background of the links when one changes.
After much experimentation with your example I discovered that it stops if either the links themselves are much larger or the container is much larger. Since setting the links to be giant buttons affects design, it seems the best solution is to set the container to be larger. Since your example is a vertical set of links you would set the height of the container to be something much larger than the links. I used height: 100%; but a large px should work too. If you had links laid out horizontally you might need to make that width: 100%; instead.
CSS:
#share-links{
left:0;
top:5em;
position:fixed;
height: 100%;
}
#share-links a{
display:block;
height:2em;
width:2em;
color:white;
background-color:#a16159;
}
#share-links a:hover{
background-color:#8a392e;
}
I encountered a similar problem. As well as being fixed, one of the inside elements had transform:rotate 90 deg and had a hover effect that changed its position slightly (pulled out from the side of the screen). The background color of this element and its sibling were the same, and both would flicker randomly when elements on the page were changed / rendered.
I finally found a combination of styles that stopped the background colour flickering altogether.
I added the following to the parent element from here: https://stackoverflow.com/a/27863860/6260201
-webkit-transform:translate3d(0,0,0);
-webkit-transform-style: preserve-3d;
That stopped the flickering of the transformed/sliding element.
And I added the following to the remaining element from here: https://stackoverflow.com/a/19817217/6260201
-webkit-backface-visibility: hidden;
This then stopped the flickering of the background colour for the sibling element.

Can't scroll inside a div after applying -webkit-transform in Safari

I am building a slide menu.
The menu is long and I need to be able to scroll inside of it, so I have set overflow-y: scroll on it.
I am using -webkit-transform (and variants on other browsers) as the transition property.
Now I can't scroll inside the div, using the scrollwheel when on top of the div will make the whole page scroll.
If I change the menu's behavior and transition the right property (setting the menu to right: -320px and animating it back to right: 0), the scroll works.
This bug only happends in Safari, it works fine in Chrome and other browsers. Also works on iOS.
Anybody know a workaround? Anyone experienced this issue before? I can't seem to find any info on it. Thank you.
I had the same issue with the difference that I use an animation instead of a transition and overflow: auto instead of overflow: scroll.
This fixed the issue for me (el is the DOM element to which the animation is applied):
function fixSafariScrolling(event) {
event.target.style.overflowY = 'hidden';
setTimeout(function () { event.target.style.overflowY = 'auto'; });
}
el.addEventListener('webkitAnimationEnd', fixSafariScrolling);

Background image on :hover does'nt show

I'm trying to apply a background image on a menu li on a :hover, however, it doesn't seem to recognize/show the image. It does respond to a color as background on the hover, which is in the same background line in the CSS.
I've made a jsfiddle with the code narrowed down to basics:
Obviously the image wouldn't show in this Fiddle, i'm using a local image.
As you can see, it does respond to the background colors, but not to the images.
Where am I going wrong here?
this works:
.logo li:hover
{
background:navy url('http://upload.wikimedia.org/wikipedia/commons/5/51/Google.png');
display: inline-block;
}
your doesnt work because you are setting
background-image:url('paper.gif');
and then you do this:
background: navy;
this way you are reseting the background canceling previous values
see updated fiddle
http://jsfiddle.net/YgxmU/
You did small mistake following will give your result
background: navy url('paper.gif');
Your mistake is you have given as
background-image:url('paper.gif');
background: navy;
the background property override the background-image:url('paper.gif');

Safari force scroll

html {overflow-y:
scroll;height:101%;overflow-y:hidden;}
To force scrolling, when I view one my sites on my Mobile phone the bottom gets cut off, but looks fine in FirefoxF/IE.
Any ideas?
It should be enough to say:
html { overflow-y: scroll; }
but I would also try
body { overflow-y: scroll; }
The overflow-y:hidden; would clip the contents that exceed the size of the element. The default should be automatic to allow scrolling but setting it to overflow-y:scroll; or overflow:scroll; (which would allow vertical and horizontal scrolling) should make it work.