-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
To get leanModal working as a zepto plugin, a few small changes are needed:
// Zepto doesn't have $.fn.extend()
//$.fn.extend({
$.fn.leanModal = function(options) {
and
// Zepto doesn't have .outerWidth(), and modal_height not used!
//var modal_height = $(modal_id).outerHeight();
//var modal_width = $(modal_id).outerWidth();
var el = $(modal_id);
el.css({'display': 'block', 'opacity': 0});
var modal_width = (typeof el.outerWidth != 'function') ? el.width() : el.outerWidth();
.width() returns 0 if the modal is display:none, so 'display' it first, but transparent.
})(window.jQuery || window.Zepto);
You will need the core zepto.js library, as well as the zepto.fx.js and zepto.fx_methods.js plugins, for the fadeIn/Out animation to work.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels