javascript - css3 transition is not smooth in safari -
i'm rebuilding someone's else css3 transition make work across safari, chrome, , firefox. in version (mouse on package images), transition works in safari, not in other two: elements stuck in "up" position. in version, transition runs smoothly in ff , chrome, jerky in safari (plus it's not rotating). ideas? css below.
.package-down { display: block; position: relative; height: 100%; float: left; width: 33.333%; margin: 0 0 0 0; transform: rotate(0deg) ; -webkit-transition: margin .1s ease, transform .25s ease; -moz-transition: margin .1s ease, transform .25s ease; -o-transition: margin .1s ease, transform .25s ease; transition: margin .1s ease, transform .25s ease; } .package-up { display: block; position: relative; height: 100%; float: left; width: 33.333%; margin: -50px 0 0 0; transform: rotate(-2deg); -webkit-transition: margin .1s ease, transform .25s ease-out; -moz-transition: margin .1s ease, transform .25s ease-out; -o-transition: margin .1s ease, transform .25s ease-out; transition: margin .1s ease, transform .25s ease-out; }
i'm astonished jquery hover function work @ all, because you'd need mouseenter -> addclass
, mouseleave -> removeclass
, might me not being aware of how jquery's .hover()
works.
nonetheless, there absolutely no need jquery or javascript change styles on mouseover
. have pseudo-selector :hover purpose: put styles want transition
.package-down:hover { /* properties transition */ }
next, not repeat styles element has , not change.
last, if problem not property transition taking equal amount of time, don't specify so:
transition: margin .1s ease, transform .25s ease-out;
this make margin changes take 0.1s, rotation take 0.25s.
please describe more concisely transition look/perform like.
also, please aware not doing css animation here, css transition. read more differences here:
Comments
Post a Comment