我试图达到一个类似的效果,下面的例子,网站的标志和菜单图标改变颜色取决于背景背后的每一个元素。
http://www.borngroup.com/work/dkny/
看起来这个更改是通过javascript对每个元素的背景色进行的,但我不知道这是如何实现的。
任何帮助都将不胜感激!
发布于 2015-05-25 01:26:50
我不知道这是否是borngroup正在做的事情,但是您可以通过只使用带有背景图片和背景附件的css来实现这种效果--固定的。
下面是一个简单的演示。
body {
height: 1000px;
}
#one {
background-color:black;
background-image: url('http://d.pr/i/18pT3+');
background-attachment: fixed;
background-repeat: no-repeat;
height:100px;
}
#two {
background-color:yellow;
background-image: url('http://d.pr/i/1capU+');
background-attachment: fixed;
background-repeat: no-repeat;
height:100px;
}https://stackoverflow.com/questions/30429597
复制相似问题