Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ brings this feature to older iOS versions, Android devices and for Windows Store
speedOut: 400, // Close animation speed of the banner
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
force: null, // Choose 'ios', 'android' or 'windows'. Don't do a browser check, just always show this banner
onShow: function() {}, // fired when banner is displayed
onHide: function() {}, // fired when banner is closed
})

[1]: http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
6 changes: 5 additions & 1 deletion jquery.smartbanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@
, show: function(callback) {
$('#smartbanner').stop().animate({top:0},this.options.speedIn).addClass('shown')
$('html').animate({marginTop:this.origHtmlMargin+(this.bannerHeight*this.scale)},this.options.speedIn,'swing',callback)
this.options.onShow()
}

, hide: function(callback) {
$('#smartbanner').stop().animate({top:-1*this.bannerHeight*this.scale},this.options.speedOut).removeClass('shown')
$('html').animate({marginTop:this.origHtmlMargin},this.options.speedOut,'swing',callback)
this.options.onHide()
}

, close: function(e) {
Expand Down Expand Up @@ -189,7 +191,9 @@
speedOut: 400, // Close animation speed of the banner
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
force: null, // Choose 'ios', 'android' or 'windows'. Don't do a browser check, just always show this banner
onShow: function() {}, // fired when banner is displayed
onHide: function() {}, // fired when banner is closed
}

$.smartbanner.Constructor = SmartBanner
Expand Down