search

Home  >  Q&A  >  body text

javascript - A small effect on the mobile terminal

Scroll down and the background image shrinks.

Question: How to write this animation more smoothly (mobile version),

过去多啦不再A梦过去多啦不再A梦2869 days ago903

reply all(2)I'll reply

  • 为情所困

    为情所困2017-05-16 13:27:36

    If you want the animation to be smooth, you can add css attributes to the DOM element where the animation is located: transition: all .8s ease;

    Syntax: transition: property duration timing-function delay
    transition-property: specifies the css property name for setting the transition effect
    transition-duration: specifies how many seconds or milliseconds it takes to complete the transition effect
    transition-timing-function: specifies the transition function, stipulates The speed curve of the speed effect
    transition-delay: Specify the delay time before the onset of appearance
    The default values ​​are: all 0 ease 0

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 13:27:36

    The requirements are not clear. When scrolling up, slowly cover the top background image at the back, and finally keep half of the background image visible. If this is the case, there is no need to do animation

    reply
    0
  • Cancelreply