//图片高度小于屏幕则需要垂直居中处理
// imageE.style.width = "100%";
imageE.style.top = "50%";
imageE.style.position = "relative";
imageE.style.transform = "translateY(-50%)";
} else {
imageE.style.height = window.innerHeight + "px";
}
};
// imageE.style.width = "100%";
// imageE.style.width = "475px";
// imageE.style.height = window.innerHeight + 'px';
// imageE.style.objectFit= "scale-down";
// imageE.style.height = "100%";
// imageE.style.top = "50%";
// imageE.style.position = "relative";
// imageE.style.transform = "translateY(-50%)";
this.bigImage = imageE;
//添加鼠标滚轮事件缩放图片
if (imageE.addEventListener) {
// IE9, Chrome, Safari, Opera
imageE.addEventListener("mousewheel", this.rollImg, false);
// Firefox
imageE.addEventListener("DOMMouseScroll", this.rollImg, false);
} else {
// IE 6/7/8
imageE.attachEvent("onmousewheel", this.rollImg);
}
imageContainer.appendChild(imageE);
topContainer.appendChild(imageContainer);
main[0].appendChild(topContainer);
//创建点击左右浏览按钮
//左按钮
let imgLeft = document.createElement("img");
imgLeft.src = iconLeft;
imgLeft.style.zIndex = "101";
imgLeft.style.position = "fixed";
imgLeft.style.top = "50%";
imgLeft.style.transform = "translateY(-50%)";
imgLeft.style.left = "12%";
imgLeft.style.cursor = "pointer";
imgLeft.className = "showBigImage";
//添加鼠标点击事件切换图片
imgLeft.addEventListener("click", this.toLeftImage);
//右按钮
let imgRight = document.createElement("img");
imgRight.src = iconRight;
imgRight.style.zIndex = "101";
imgRight.style.position = "fixed";
imgRight.style.top = "50%";
imgRight.style.transform = "translateY(-50%)";
imgRight.style.right = "12%";
imgRight.style.cursor = "pointer";
imgRight.className = "showBigImage";
//添加鼠标点击事件切换图片
imgRight.addEventListener("click", this.toRightImage);
//大图片选转
let imgRotate = document.createElement("img");
imgRotate.id = "rotateImageBtn";
imgRotate.src = iconRotate;
imgRotate.style.zIndex = "102";
imgRotate.style.position = "fixed";
imgRotate.style.top = "5%";
imgRotate.style.right = "5%";
imgRotate.style.transform = "translateY(-50%)";
imgRotate.style.cursor = "pointer";
imgRotate.className = "showBigImage";
//添加鼠标点击事件旋转大图
imgRotate.addEventListener("click", this.rotateImage);
//关闭按钮
let imgClose = document.createElement("img");
imgClose.src = iconClose;
imgClose.style.zIndex = "101";
imgClose.style.position = "fixed";
imgClose.style.top = "5%";
imgClose.style.right = "1%";










