Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Add events on show and on hide #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add events on show and on hide #34

wants to merge 1 commit into from

Conversation

ghn
Copy link

@ghn ghn commented Oct 16, 2013

example:

$.smartbanner({
onShow: function() {
console.log("banner is displayed");
},
onHide: function() {
console.log("banner is closed");
}
})

@ghn
Copy link
Author

ghn commented Dec 2, 2013

@jasny any news?

@jasny
Copy link
Owner

jasny commented Dec 2, 2013

I need time to work on a new version on this plugin. I might include it then. On the other hand, you don't have these event when a smartbanner is shown in IOS 6.

@jasny
Copy link
Owner

jasny commented May 10, 2014

I don't like really like the callbacks, but I'll add triggers instead.

It will work as following:

$(document).on('show.smartbanner', function(e) {
    console.log("Before show");
    if (false) e.preventDefault(); // Can cancel show
});

$(document).on('shown.smartbanner', function() {
    console.log("Is shown");
});

$(document).on('hide.smartbanner', function() {
    console.log("Before hide");
    if (false) e.preventDefault(); // Can cancel hide
});

$(document).on('hidden.smartbanner', function() {
    console.log("Is hidden");
});

@jasny jasny added this to the Version 2.0 milestone May 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants