- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建一个响应式 Angular 网站 ( can be viewed here ) 并构建了一个指令来处理我网站的 header 。但是,CSS 转换有一些奇怪的行为。
我将首先回顾一下应该发生的事情:
最后,所有元素都位于所需位置,但有时动画有效,有时则无效。
这可能与在 Angular 指令中应用范围更新的方式有关,但我认为这可能与 CSS 过渡有关,因为它们仍处于试验阶段。以下是我的这个标题的 CSS:
#headerDiv {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
background-color: orange;
z-index: 100;
overflow: hidden;
-webkit-transition: all 600ms ease;
-moz-transition: all 600ms ease;
-ms-transition: all 600ms ease;
transition: all 600ms ease;
}
.headerUnexpanded {
height: 50px;
}
.headerExpanded {
height: 150px;
}
#headerCenter {
position: absolute;
top: 0px;
bottom: 0px;
left: 50%;
right: 50%;
overflow: visible;
}
#headerIcon {
margin: auto;
position: absolute;
left: 0;
bottom: 5px;
right: 0;
width: 40px;
height: 40px;
background-color: green;
}
#headerHome {
margin: auto;
position: absolute;
width: 100px;
height: 40px;
background-color: blue;
-webkit-transition: all 600ms ease;
-moz-transition: all 600ms ease;
-ms-transition: all 600ms ease;
transition: all 600ms ease;
}
#headerHome.here {
top: 5px;
right: 175px;
}
#headerHome.gone {
top: 5px;
right: 300px;
}
#headerHome.expand {
top: 55px;
right: 50px;
}
#headerProjects {
margin: auto;
position: absolute;
width: 100px;
height: 40px;
background-color: blue;
-webkit-transition: all 600ms ease;
-moz-transition: all 600ms ease;
-ms-transition: all 600ms ease;
transition: all 600ms ease;
}
#headerProjects.here {
top: 5px;
left: 175px;
}
#headerProjects.gone {
top: 5px;
left: 300px;
}
#headerProjects.expand {
top: 55px;
left: 50px;
}
#headerResume {
position: absolute;
top: 5px;
bottom: 0;
right: 50px;
width: 100px;
height: 40px;
background-color: blue;
}
#headerContact {
position: absolute;
top: 5px;
bottom: 0;
left: 50px;
width: 100px;
height: 40px;
background-color: blue;
}
谢谢
最佳答案
对于您的第一个问题,您能否将导航器的最小宽度设置为 700 像素或您想要的值。
对于单击绿色按钮时所有按钮移动的问题,我应该做的是在标题栏下方创建一个 divm。因此,当您单击绿色按钮时,该栏会向下滑动。
希望本文能对您有所帮助。
关于CSS Transitions 仅在等待后才起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25468326/
尝试添加动画以替换 fragment 时抛出该异常。根据这个答案,stackoverflow ,过渡框架不能应用于 fragment ,但这篇文章表明你可以 How to use Material T
还有其他一些类似的问题,但都涉及 Android 支持库。我正在使用新的 androidx 库。 将 androidx 生命周期依赖项从 2.2.0-alpha03 更新到 2.2.0-alpha04
这个问题在这里已经有了答案: What is an optional value in Swift? (15 个答案) When two optionals are assigned to an i
Tailwind 提供了多个实用程序来控制哪些 CSS 属性转换,在这些属性中有 transition 和 transition-all。 我去检查了两个类的 CSS 属性,这里它们的顺序相同。 tr
Tailwind 提供了多个实用程序来控制哪些 CSS 属性转换,在这些属性中有 transition 和 transition-all。 我去检查了两个类的 CSS 属性,这里它们的顺序相同。 tr
这是一个由两部分组成的问题: 哪种应用样式优先:CSS 中的 -webkit-transition 规则或 jQuery 中类似的 $.css() 方法? 如果我还在 jQuery 中使用 .css
我想知道为什么在 FireFox 中使用 transition: all 0.5s ease-out; 时我会看到元素上的闪烁效果(截至本文撰写时的最新版本)。很难解释,但请在此处查看实际示例:htt
我对 css3 过渡属性的渲染速度有疑问。 假设我有一些元素: div, span, a {transition: all} div {margin: 2px} span {opacity: .5}
我对 css3 过渡属性的渲染速度有疑问。 假设我有一些元素: div, span, a {transition: all} div {margin: 2px} span {opacity: .5}
我目前正在用 Html 制作我的第一个网站,javascript 作为前端将首先出现。 我正在尝试创建一个折叠侧边栏,当我单击顶部导航右侧的按钮时会出现该侧边栏,但我对过渡效果有疑问,因为它会将所有内
我有一个 Activity ,一次托管一个 fragment ,并在两个 fragment 之间交换。 fragment A 使用按钮启动 fragment B, fragment B 使用按钮或后退
我正在尝试创建一种效果: 光标悬停在一个框上 横杆滑出 随着滑动 Action 缓和,标题出现 光标离开方框 随着栏向后滑动,标题开始消失 横杆完成向后滑动 但是,当光标离开框时,会再次调用延迟,因此
让我提供一些背景信息:我正在构建一个选项卡式应用程序,允许用户查找和查看我们服务器上托管的一些视频。每个选项卡都以不同的方式对视频进行分组,导航栏中有一个分段控件,用户可以使用该控件更精确地对列表进行
原始问题...更新了以下工作代码: 我有一个在 ajax 加载事件期间出现的加载图像。图像通过向 body 元素添加或删除“加载”类来显示/隐藏。目前,加载图像将背景大小设置为从 0% 到 100%
我对 css3 过渡属性的渲染速度有疑问。 假设我有一些元素: div, span, a {transition: all} div {margin: 2px} span {opacity: .5}
当我继续学习前端开发和练习 Sass 优化我的 CSS 代码时,我又遇到了另一种情况。 在互联网上进行研究和教程后,我在 Sass 中设置了名为“transition”的全局混合。代码如下所示: @m
关于 Chrome 和 css 转换的问题太多了,我不确定以前是否有人问过这个问题。 我的情况是这样的:我的布局基本上是左右分页。右侧的一框内容需要显示在左侧的内容之上(这个我没有发言权,桌面和移动之
我在两个 Activity 之间的共享元素中使用了自定义 Transition。 我的转换不起作用,因为 TransitionValues 参数在 captureStartValues 和 这两种方法
我在 google Chrome 和 Safari 上运行我的应用程序,两者都兼容 webkit。我正在使用 -webkit-transition 构建一个滚动的 div。 当我将文档类型指定为 HT
以下代码在 chrome 中产生了预期的结果,即;直接向所有元素添加过渡延迟。 $('.front-nav .sub-menu').each(function() { var transiti
我是一名优秀的程序员,十分优秀!