Zurb のReveal Pluginを使用して表示される要素があり、モーダル ウィンドウの配置方法に問題があります。
要素をページの中央、折り目の上に配置するようです。ただし、スクロールしなければ見えない位置にあるリンクによってモーダル ウィンドウがアクティブ化されている場合、ユーザーはウィンドウを見ることができません。ページ全体ではなく、現在のスクロール位置に基づいて要素を中央に配置する方法はありますか?
私が知る限り、プラグインの関連するソース コードは次のとおりです。
変数セット (ln 41):
var modal = $(this),
topMeasure = parseInt(modal.css('top'), 10),
topOffset = modal.height() + topMeasure,
locked = false,
modalBg = $('.reveal-modal-bg'),
closeButton;
Div のアニメーション化 (ln 61)
function openAnimation() {
if (!locked) {
lockModal();
if (options.animation === "fadeAndPop") {
modal.css({
'top': $(document).scrollTop() - topOffset,
'opacity': 0,
'visibility': 'visible'
});
modalBg.fadeIn(options.animationSpeed / 2);
modal.delay(options.animationSpeed / 2).animate({
"top": $(document).scrollTop() + topMeasure + 'px',
"opacity": 1
}, options.animationSpeed, function () {
modal.trigger('reveal:opened');
});
}
//etc...