Can i stop “flickering” on :hover?
# June 3, 2013 at 4:39 am
Howdy yall, so i was going to participate in that shopping cart weekly challenge then realized i really wont have the time. However, i came up with a cool little shopping cart icon/design thing that i think is somewhat nifty.
The problem i am having is that when i hover over the icon, the page “flickers” white. I have some JS controlling the icon but with JS disabled it still happens and JS is not touching the hover state.
I am thinking it may have something to do with transform and scale?
Has anyone ran into this issue previously?
Here is my CodePen. It is NOT part of the contest, just saying…# June 3, 2013 at 7:14 am
Original Code: (Lot’s of flicker on hover)
-webkit-transition: -webkit-transform 200ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
-moz-transition: -moz-transform 200ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
-o-transition: -o-transform 200ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
transition: transform 200ms cubic-bezier(0.175, 0.885, 0.320, 1.275);
Changed To: (Still flickers, cut back of about 50%)
-webkit-transition: -webkit-transform 200ms ease-in-out;
-moz-transition: -moz-transform 200ms ease-in-out;
-o-transition: -o-transform 200ms ease-in-out;
transition: transform 200ms ease-in-out;
}# June 3, 2013 at 7:30 am
I tested it on Firefox, both an hour ago and now. No flickering at all, hovering, clicking, selecting, resizing the browser, Ctrl-+ing – nothing causes the flickering, not on the Firefox, that is.
EDIT: In Chrome :hover is not a problem, clicking causes hell of a flickering though :O (I just noticed that’s because you disabled the cubic-bezier transform)
> I have some JS controlling the icon but with JS disabled it still happens and JS is not touching the hover state.
Well, I tried disabling the JS anyways and… flickering stops :D# June 3, 2013 at 7:43 am
@jimmyniceguy, hey thanks for running some tests, yeah i am running Latest Chrome (Win7) and when i had original cubic-bezier and that is the browser i am having problems with (i should have mentioned that).
I did fix it by changing the easing type, but the spinning (onClick) wasn’t flickering for me… *If it’s not one thing, it’s another lol*
I will run a test but the flickering is probably because of the GODDAMN SVG! Since firefox wont allow me to use icon fonts on my server that is what i resorted to, just an SVG.
@CrocoDillon, yeah man totally a copy/paste/edit-in-between mistake. Possibly doesn’t like the value above 1, i didnt even try just setting the values to 1. Ill try that.
Thanks guys for helping me out.# June 3, 2013 at 7:52 am
@jimmyniceguy, yeah agreed! like i mentioned before, i copied and pasted it inside of JSFiddle and there was no flickering. I am really curious to see what is causing it though so than i could write a plugin for CodePen to prevent it lol…
Actually, it is kind of weird, if you look at the jsFiddle i made, the SVG doesn’t even show up lol..
I going to have to create some conditionals for online text editors i use lol..
You must be logged in to reply to this topic.