New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gifplayer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gifplayer

Customizable jquery plugin to play and stop animated gifs. New: Video support (webm, mp4)

  • 0.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53
increased by23.26%
Maintainers
1
Weekly downloads
 
Created
Source

gifplayer

Bower version

Customizable jquery plugin to play and stop animated gifs. Similar to 9gag's. New: Video support (webm, mp4)

###Basic Usage

  1. Add a preview of the gif or video file to your website
  2. Specify a ‘data-src’ attribute with the path to the animated gif or video, or simply have an image with the same name and the .gif extension in the same folder of the ‘preview’ image
  3. Include jquery.js, jquery.gifplayer.js and gifplayer.css on your site
  4. Call the .gifplayer() method for the desired images
<img class="gifplayer" src="media/banana.png" />
 
<script>
	$('.gifplayer').gifplayer();
</script>

###Options

Options can be setup in two ways:

  1. Setup as an object when initializing the plugin:
$('.banana').gifplayer({ label: 'play' });
  1. Setup as data attributes in the preview image:
<img class="banana" src="banana.png" data-label="play">
OptionValuesDefaultAllowed values
labelA value for the label in the circle over the image‘gif’
playOnEvent that triggers playing the animated gif'click''click', 'hover'
modeLoad an animated gif file or a video'gif''gif', 'video'
gifSource for the gif fileDefault option is the same name of the preview imagem replacing extension to .gif
mp4Source for the mp4 video file (video mode)Default option is the same name of the preview imagem replacing extension to .mp4
webmSource for the webm video file (video mode)Default option is the same name of the preview imagem replacing extension to .webm
waitWould you wait until the animation file has been fully loaded to play, or start playing right awayfalsetrue, false

###Methods (beta)

Use these methods to play and stop the player programatically

$('#banana').gifplayer('play');
$('#banana').gifplayer('stop');

###Events (beta)

Use events to do awesome things

$('#banana').gifplayer({
    onPlay: function(){
        console.log('GIF started',this);
    },
    onStop: function(){
        console.log('GIF stopped',this);
    },
});

Keywords

FAQs

Package last updated on 30 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc