gpt4 book ai didi

javascript - 在 976px 宽度之后添加/删除 CSS 样式?

转载 作者:太空宇宙 更新时间:2023-11-03 19:55:52 25 4
gpt4 key购买 nike

/*Fade in effect & one pager*/
.fullpage-wrapper {
width: 100%!important;
transform: none!important;
}

.fp-section {
width: 100%!important;
position: absolute;
left: 0;
top: 0;
visibility: hidden;
opacity: 0;
z-index: 0;
transition: all .7s ease-in-out;
}

.fp-section.active {
visibility: visible;
opacity: 1;
z-index: 1;
}
/* Remove transition when website is still loading */
body {display:none}
body[class*="fp-viewing-"] {display:block}

我想为移动用户删除宽度低于 976 像素的这些给定样式。我怎样才能在 javascript 或 jquery 中完成这个?也可以让 else 打开吗?

if ($(window).width() < 967) {
*remove these styles but how?*
}
else {
*keep them/or do nothing*
}

最佳答案

你可以只使用 css:

@media only screen and (min-width : 967px) {
/*Your styles */
}

关于javascript - 在 976px 宽度之后添加/删除 CSS 样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46873684/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com