I am stumped at this and hoping someone can help.
I have a page background which is done in HTML and shows off a client’s Instagram photos. Using this plugin: justifiedgrid.com
The client would really like the images to flip on page load like this http://www.starworksartists.com/hair/adir-abergel/instagram/
I have tried adding CSS to the images like so
.jig-loaded img {
transition: 0s cubic-bezier(0.175, 0.885, 0.32, 1.1) !important;
transform: rotateY(0deg) translateX(0px) !important;
opacity: 1;
}
But doesn’t seem to work.
Any help would be appreciated.
You could use css keyframe animation:
The best way to do this would be set the initial state of the images to the transformed version, apply a
transition
to it as well, and then use JavaScript to add a class that sets the transform back to the “normal” state (not transformed).This way it’s easy to keep track of states and you can toggle between the two states with no jumping in between. Demo (the
onload
is handled by JSFiddle in the demo – you’ll need to add it yourself in your code)Otherwise you could use a keyframe animation on load with
animation-direction:forwards
that the goes from the transformed state to the non-transformed state. If all you’re doing is an effect on the initial page load it is fine, but if it’s to be any more interactive you should usetransition
s instead.