Skip to content

Instantly share code, notes, and snippets.

@Kcko
Created May 18, 2017 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kcko/2d7457fc63512562956573569cdbe6c1 to your computer and use it in GitHub Desktop.
Save Kcko/2d7457fc63512562956573569cdbe6c1 to your computer and use it in GitHub Desktop.
Modal object with private functions
function feedbackModalFn(selector){
//var feedbackModal = $('.feedback-modal');
var feedbackModal = $(selector);
var winH;
var topPane;
var feedbackModalHeight;
// private scope
function init()
{
winH = $(window).height();
//topPane = $('.top-pane').height();
topPane = 0;
feedbackModalHeight = winH - topPane;
feedbackModal.height(feedbackModalHeight);
}
// private scope
function show()
{
init();
feedbackModal.animate({
bottom: 0
}, 600);
}
// private scope
function hide()
{
init();
feedbackModal.animate({
bottom: "-" + feedbackModalHeight
}, 600);
}
return {
'init': init,
'show': show,
'hide': hide
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment