私のページにはモーダルウィンドウが設定されていますが、うまく機能しますが、ウィンドウのサイズを変更する必要があります。残念ながら、私は単にエラーが表示されます:ウィンドウサイズを変更するとウィンドウサイズが変わる "キャッチされていないタイプエラー"
Uncaught TypeError: Object # has no method 'outerHeight'
「this」は間違って使用していますか?
$(window).resize(function() {
//If mask is open, resize modal elements
if ($('#modalMask').is(':visible')) {
//Resize and position modal windows
//Get window dimensions
var mWinHeight = $(window).height();
var mWinWidth = $(window).width();
//Make sure all open modal windows are centred
$('.modalWindow:visible').each(function (i) {
var $this = $(this);
$this.css('top', mWinHeight/2-(this.outerHeight()/2));
$this.css('left', mWinWidth/2-(this.outerWidth()/2));
});
}
});
私はばかです。ありがとう! –
誰にでも起こります。心配ない。 – sje397