Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions jquery.smartbanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@
var banner = $('#smartbanner');
banner.stop();

if (this.options.layer) {
if (this.options.disableAnimation) {
banner.addClass('shown').css("display", "block");
} else if (this.options.layer) {
banner.animate({top: 0, display: 'block'}, this.options.speedIn).addClass('shown').show();
$(this.pushSelector).animate({paddingTop: this.origHtmlMargin + (this.bannerHeight * this.scale)}, this.options.speedIn, 'swing', callback);
} else {
Expand All @@ -154,7 +156,9 @@
var banner = $('#smartbanner');
banner.stop();

if (this.options.layer) {
if (this.options.disableAnimation) {
banner.removeClass('shown').css("display", "none");
} else if (this.options.layer) {
banner.animate({top: -1 * this.bannerHeight * this.scale, display: 'block'}, this.options.speedIn).removeClass('shown');
$(this.pushSelector).animate({paddingTop: this.origHtmlMargin}, this.options.speedIn, 'swing', callback);
} else {
Expand Down Expand Up @@ -251,6 +255,7 @@
scale: 'auto', // Scale based on viewport size (set to 1 to disable)
speedIn: 300, // Show animation speed of the banner
speedOut: 400, // Close animation speed of the banner
disableAnimation: false, // Disable animation effects
daysHidden: 15, // Duration to hide the banner after being closed (0 = always show banner)
daysReminder: 90, // Duration to hide the banner after "VIEW" is clicked *separate from when the close button is clicked* (0 = always show banner)
force: null, // Choose 'ios', 'android' or 'windows'. Don't do a browser check, just always show this banner
Expand Down