npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jquery.simplemarquee

v0.3.0

Published

A jQuery plugin that aims to provide a scrolling marquee similar to the good old winamp player

Downloads

87

Readme

jquery.simplemarquee

A jQuery plugin that aims to provide a scrolling marquee similar to the good old winamp player.
The main goal of this plugin is simplicity, so it has very little options but it works nicely.

Why?

I've tried jQuery.Marquee which provides similar functionality but:

  • It has unnecessary cruft to support older browsers
  • Does not use transform: translate(x,y) when moving text, causing unnecessary reflows
  • Has some bugs, the most important one leaks <style> tags because they are not removed on destruction

So I've decided to implement my own since it was an easy task anyway.

Demo

Check out the demo.
This same demo is available in the test/demo.html file.

API

.simplemarquee([options])

Setups the marquee with the given options.
Once initialized, you can't change the options.

Available options:

  • speed: The speed in pixels per second, defaults to 100.
  • direction: The direction, defaults to left (available: left, right, top and bottom)
  • cycles: Number of cycles before pausing, defaults to 1 (pass Infinity to cycle continously)
  • space: The space in px between the duplicated contents, defaults to 40
  • delayBetweenCycles: The delay between each cycle in ms, defaults to 2000
  • handleHover: Pause/restart on hover, defaults to true
  • handleResize: Update marquee on resize, defaults to true
  • easing: The timing function used for the CSS animation, defaults to linear
$('.some-el').simplemarquee();

If scrolling is not necessary, the plugin will add has-enough-space class to the element.

.simplemarquee('update', [restart])

Updates the marquee, including calculations made.
If restart is true, the cycles will be restarted.

$('.some-el').simplemarquee('update');

.simplemarquee('pause')

Pauses the marquee.
Emits a pause event.

$('.some-el').simplemarquee('pause');

.simplemarquee('resume')

Resumes the marquee.
Emits a resume event.

$('.some-el').simplemarquee('pause');

.simplemarquee('toggle')

Toggle between the pause/resume methods.

$('.some-el').simplemarquee('toggle');

.simplemarquee('destroy')

Destroy marquee, releasing all events and leaving the element just like it was before.

$('.some-el').simplemarquee('destroy');

Events

  • cycle - Fired before each cycle
  • finish - Fired when all cycles are done
  • pause - Fired when paused
  • resume - Fired when resumed

How to use

Simply include the jquery.simplemarquee.js file after jQuery is loaded.
This plugin also integrates with AMD (no shim required) and CommonJS.

This plugin makes use of CSS transforms, so it's usage is limited to IE >= 10.

Tests

No tests yet :(