PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, July 18, 2022

[FIXED] How to make GIF animate on scroll only?

 July 18, 2022     animated-gif, gif, jquery, scroll     No comments   

Issue

I am building a Wordpress site that incorporates an animated GIF and I am trying to get the GIF to animate only when the user is scrolling.

The page is basically ready – http://www.fi1000.com/wp/ – but the GIF would work a lot better if it's only animating on window scroll.

I am just wondering if anyone out there might have an idea for a jQuery or CSS3 fix to achieve this? Not looking for the GIF to do anything except to not animate unless the user is scrolling.

The plugin I'm using to make the GIF move positions on scroll is called Skrollr https://github.com/Prinzhorn/skrollr

Thanks for reading!


Solution

You could use javascript and display a static image when stationary, then switch to the animated image during the onScroll event.



Answered By - Lance
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing