Skip to content

benjasHu/jquery-sticky-alert

 
 

Repository files navigation

#jquery-sticky-alert A minimal jQuery plugin to add a sticky alert bar to the top of your website. Inspired by this pen on CodePen. A demo can be found running at http://sticky.longren.io, which is hosted on GitHub Pages.


##Installation

Include jquery.stickyalert.js after jQuery:

<script src="/path/to/jquery.stickyalert.js"></script>

Also include jquery.stickyalerts.css:

<link href="/path/to/jquery.stickyalert.css" rel="stylesheet" type="text/css" />

##Usage

I usually add this in my <header> area, after jQuery and jquery.stickyalert.js have been loaded.

$(document).ready(function() {
  $('#alert-container').stickyalert({
    barFontColor:'#eee',
    barColor:'#222',
    barText:'Hey, need some web work done? Give me a shout!',
    barTextLink:'http://longren.io/work-with-me/'
  });
});

You'll also need a div with id alert-container, according to the usage example above, at least:

<div id="alert-container"></div>

Your alert-container will contain the sticky alert. :)

##Issues If you nocitce any problems, plese submit an issue.

##How to Contribute

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

##A Screenshot jQuery Sticky Alert Screenshot

About

A minimal jQuery plugin to add a sticky alert bar to the top of your website. Demo at http://sticky.longren.io/

Resources

License

Stars

Watchers

Forks

Packages

No packages published