Socket
Socket
Sign inDemoInstall

jquery.announcement

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jquery.announcement

Adds a fixed widget at the bottom of your browser screen to display announcements.


Version published
Weekly downloads
26
increased by2500%
Maintainers
1
Install size
1.03 MB
Created
Weekly downloads
 

Readme

Source

jQuery plugin Announcement

Adds a fixed widget at the bottom of your browser screen to display announcements.

Screenshot

Demo

http://baivong.github.io/announcement/

Installation

Get the latest release of this plugin on Release page or use the command line:

Bower

$ bower install jquery.announcement

npm

$ npm install jquery.announcement

Usage

Announcement depends on jQuery. Include Announcement script and stylesheet in your document:

<!-- Add jQuery 1.7+ library -->
<script src="jquery.js" type="text/javascript"></script>

<!-- Add jQuery plugin Announcement -->
<link href="jquery.announcement.css" rel="stylesheet" type="text/css">
<script src="jquery.announcement.js" type="text/javascript"></script>

Create list elements will contain the content you wish to display within the Announcement.

<ul class="newsticker">
    <li>News content 1</li>
    <li>News content 2</li>
    <li>News content n</li>
</ul>

... then in your code do:

$(function() {
    $('.newsticker').announcement();
});

Configuration

NameTypeDefaultDescription
titleString'Announcement'Display after the announcement widget is minimized.
showToggleBooleantrueDisplay maximize/minimize button.
showCloseBooleanfalseDisplay close button.
autoHideString, Number'auto'Timer minimizes. Can be numeric or 'auto'. Set 0 to disable.
autoCloseString, Number0Timer close. Can be numeric or 'auto'. Set 0 to disable.
positionString'bottom-right'bottom-left or bottom-right
widthString, Number300Width of announcement. Can be numeric or 'auto'.
heightString, Number'auto'Height of announcement. Can be numeric or 'auto'.
zIndexNumber99999Set CSS z-index property of the announcement widget.
speedNumber10Slideshow speed in seconds. Set 0 to disable.
effectString'fading'fading, zoom-in, zoom-out, rotate-left, rotate-right, move-top, move-right, move-bottom, move-left, skew-top, skew-right, skew-bottom, skew-left, random, shuffle

Publish method

Get plugin instance

var instance = $('.newsticker').data('plugin_announcement');
.active(index)

Show announcement according to index

instance.active(0);
.start()

Start slideshow

instance.start();
.stop()

Stop slideshow

instance.stop();
.toggle()

Minimize/maximize Announcement widget

instance.toggle();
.close()

Remove Announcement widget

instance.close();
.autoResize()

Update size of the widget when window size changes

instance.autoResize();
.getCookie(name)

Get cookie has name is jquery.announcement

instance.getCookie('jquery.announcement');
.setCookie(name, value, exdays, path)

Set cookie to hide Announcement widget

instance.setCookie('jquery.announcement', 'hidden', 1);

Remove cookie

instance.setCookie('jquery.announcement', '', -1);

.detectCSSFeature(name)

Detecting browser supports CSS feature

instance.detectCSSFeature('transform');

Thanks to

jQuery boilerplate team and a bunch of awesome contributors.

License

MIT License © Zzbaivong

Keywords

FAQs

Last updated on 10 Aug 2016

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