Fix: img modal when window is too narrow

This commit is contained in:
cutls
2020-02-11 01:55:40 +09:00
parent 2732161dd2
commit c8786ca00f
6 changed files with 23 additions and 18 deletions

View File

@@ -128,13 +128,13 @@ function imageXhr(id, key, murl) {
$('#imagemodal').css('bottom', '0')
$('#imagemodal img').css('width', 'auto')
if (height < windowH) {
$('#imagemodal').css('height', height + 60 + 'px')
$('#imagemodal img').css('height', '100%')
$('#imagemodal').css('height', height + 100 + 'px')
$('#imagemodal img').css('height', height + 'px')
if (width > windowW * 0.8) {
$('#imagemodal').css('width', '80vw')
$('#imagemodal img').css('width', '100%')
$('#imagemodal img').css('width', 'auto')
var heightS = ((windowW * 0.8) / width) * height
$('#imagemodal').css('height', heightS + 60 + 'px')
$('#imagemodal').css('height', heightS + 100 + 'px')
} else {
$('#imagemodal').css('width', width + 'px')
}