【发布时间】:2019-05-17 17:25:15
【问题描述】:
我希望固定元素 #logoimode3 在某些部分显示/隐藏。
示例: 在#section1 和#section3 上显示#logoimode3 在#section2 上隐藏#logoimode3
所以固定元素必须在蓝色部分消失。 而不是再次显示在绿色部分。 我希望我的徽标在滚动第 2 部分时消失。
<!DOCTYPE html>
<html>
<head>
<style></style>
<script></script>
</head>
<body>
<img id="logoimode3" class="logo3" style="position:fixed;top:0px;left:0px;" src="https://imode.info/imode/slike/ikone/IMODE_znak-01.svg" alt="logo" height="" width="30px">
<section id="section1" style="background: red; height:100vh;"></section>
<section id="section2" style="background: blue; height:100vh;"></section>
<section id="section3" style="background: green; height:100vh;"></section>
</body>
<footer></footer>
</html>
【问题讨论】:
-
你的脚本在哪里?
-
你的页脚和图片标签应该在正文中
-
这是一个错误。
-
--> 这只适用于在页脚区域隐藏它
-
这不起作用:
标签: javascript jquery html css