I’ve got an image on a page, which is linked to a project page – I’ve got it set to zoom in and blur on focus which is working really well, but it shrinks back down. Ideally id want it to stay zoomed and blured, then the click fires so the page changes, without the user seeing the image shrink back down.
This is my current code:
.project-zoom {
transition: transform 1s, filter 1s ease-in-out;
margin: 0 auto;
}
.project-zoom:active {
-ms-transform: scale(10); /* IE 9 */
-webkit-transform: scale(10); /* Safari 3-8 */
transform: scale(10);
filter: blur(2px);
}
So firstly, I need to add a delay so that when I click the image it does the image zoom first.
Then once the image has zoomed, I want it to stay zoomed.
Is it possible?
I’m guessing I’ll need to add a delay to the click with js or jquery, although if its possible in css then that would be much better.
2
Answers
If you want to make it stay, then you should add :focus instead of :active on .project-zoom class
As per Taufik’s answer if you want it to stay use
:focus
.If you also need a delay on following the link you can do this with JS by replacing the link’s default behaviour with one which waits for transition to complete: