Socket
Socket
Sign inDemoInstall

title-marquee

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    title-marquee

stick a scrolling marquee in your page title


Version published
Weekly downloads
0
Maintainers
1
Install size
4.18 kB
Created
Weekly downloads
 

Readme

Source

title-marquee.js

Scrolling text in your browser's title ♫ ♪

Install

npm install title-marquee

or clone this repo.

Usage

This plugin follows the CommonJS spec, so you can bundle and require it on the browser with browserify or the like.

<script>
var tm = require('title-marquee');

// Scroll text
tm('Get Low - Lil Jon and the Eastside Boyz');

// Scroll in reverse
tm({ text: 'Someone Like You - Adele', type: 'reverse' });

// Scroll left and right
tm({ text: 'Cool Kids - Echosmith', type: 'bounce' });

// Faster!!!!
tm({ text: 'Heartless - Kanye West', speed: 150 });

// Or use engrish
tm({ text: 'Hot in Herrre - Nelly', speed: 'slow' });

// Other stuff
tm.pause();
tm.resume();
tm.toggle();
tm.text('Change the title to this text right here');

</script>

Consecutive calls to title-marquee will replace the current title.

Default Options

{
  buffer: 10,       // # chars shown
  type: 'scroll',   // 'scroll' | 'reverse' | 'bounce'
  speed: 'normal',  // 'slow' | 'normal' | 'fast' | time in ms
}

API

tm(options)

Pass in an options hash or just a string to kick off the scrolling.

.pause()

Pauses that shit

.resume()

Resume the scrolling

.toggle()

Too lazy to care? Flip a switch.

.text(str)

Updates the text in place without resetting the scroll offset. This is great for making live updates. For example, frequently updated things like displaying currently playing song or the number of active users.

Manual Build

npm run build

License

MIT

Keywords

FAQs

Last updated on 27 Dec 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc