I’m looking for a way to use CSS3 Transition to create a smooth page scrolling. I know how to do it using javascript but if there’s a way to do it with CSS3, i will prefer it for performance purpose.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
transform: translate(x,y)to simulate “scrolling”, and this can be animated using transitions viatransition-property: all; Note, you will have to add the appropriate vendor prefix, as with much of CSS3 at the moment.References: Mozilla Dev Center: transform, Mozilla Dev Center: CSS Transitions
P.S. use percentages carefully with
transform: translate()— depending on how your element is wrapped, -100% can mean next ‘display-height’ section of content