Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dynamicdriverepo/sugarbar
Sugar Bar adds a drop down bar to the top of your page that's shown in a non intrusive manner, only when the page is scrolled and past the designated threshold
https://github.com/dynamicdriverepo/sugarbar
Last synced: about 1 month ago
JSON representation
Sugar Bar adds a drop down bar to the top of your page that's shown in a non intrusive manner, only when the page is scrolled and past the designated threshold
- Host: GitHub
- URL: https://github.com/dynamicdriverepo/sugarbar
- Owner: dynamicdriverepo
- Created: 2015-06-26T20:46:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-26T20:46:43.000Z (over 9 years ago)
- Last Synced: 2023-04-06T14:07:00.883Z (over 1 year ago)
- Language: JavaScript
- Size: 97.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sugar Drop Down Bar #
*Description:* Sugar Bar adds a drop down bar to the top of your page that's shown in a non intrusive manner, only when the page is scrolled and past the designated threshold (ie: > 50px from the top of the page). It is ideal for pushing content that's optional yet merits user attention, such as an opt-in box or advertisement. The content inside the Sugar Bar can either be defined inline on the page, or inside a separate file and embedded via Ajax. A "close" button inside the Bar when clicked on dismisses the bar either just once, or for the entire user session.
## Directions ##
*Step 1:* This script uses the following external files:
+ jQuery 1.11 or above (served via Google CDN)
+ sugarbar.css.js
+ sugarbar.css
+ sugarcontent.htm (external file containing sugar bar markup)*Step 2:* Add the below code to the HEAD section of your page:
/***********************************************
* Sugar Bar- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
var mysugarbar
jQuery(function(){ // on DOM load
mysugarbar = new sugarbar({
sugarbarid: 'sugarbar',
externalfile: 'sugarcontent.htm',
persistclose: false
})
})
*Step 3:* Make sure your page contains the following in the HEAD section:
## Sugar Drop Down Bar ##
See script project page for additional details on setup and documentation: