This commit is contained in:
@@ -237,18 +237,26 @@ $(function () {
|
|||||||
// });
|
// });
|
||||||
initFooter();
|
initFooter();
|
||||||
|
|
||||||
const resize = function () {
|
const resize = function () {
|
||||||
const width = $(window).width();
|
const width = $(window).width();
|
||||||
const num = width / 1400;
|
const num = width / 1400;
|
||||||
if (1000 < width && width < 1440) {
|
if (1000 < width && width < 1440) {
|
||||||
$("section").attr(
|
// 为了避免首页 3D 粒子地球被横向压扁,这里不再对首页 banner 区域做 scaleX,仅对其他 section 生效
|
||||||
"style",
|
$("section")
|
||||||
"width:1400px;transform: scaleX(" + num + ");transform-origin: 0 0;"
|
.not(".banner")
|
||||||
);
|
.each(function () {
|
||||||
} else {
|
this.style.width = "1400px";
|
||||||
$("section").attr("style", "");
|
this.style.transform = "scaleX(" + num + ")";
|
||||||
}
|
this.style.transformOrigin = "0 0";
|
||||||
};
|
});
|
||||||
|
} else {
|
||||||
|
$("section").each(function () {
|
||||||
|
this.style.width = "";
|
||||||
|
this.style.transform = "";
|
||||||
|
this.style.transformOrigin = "";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
resize();
|
resize();
|
||||||
window.addEventListener("resize", resize);
|
window.addEventListener("resize", resize);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user