首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >斯克罗尔褪色文本不能工作,但所有其他Skrollr元素都能工作

斯克罗尔褪色文本不能工作,但所有其他Skrollr元素都能工作
EN

Stack Overflow用户
提问于 2014-04-02 05:29:34
回答 1查看 1.5K关注 0票数 0

在我的网站上的一些元素上使用skrollr有一些问题。它适用于背景,但我试图淡入和淡出一个div与文字,它是行不通的.我一定是做错了什么,所以我制造了一个花招来说明这个问题。希望有人知道我做错了什么。

HTML代码

代码语言:javascript
复制
<div class="container" id="test">
  <div class="section"></div>
</div>
<div class="container" id="info">
  <div class="section-wrapper">
    <div class="row section" data-center="background-position: 0 50%;" data-bottom-top="background-position: 0px 40%;" data-anchor-target="#info">
      <div id="info-wrapper" class="col-md-6 col-md-offset-5" data-center="opacity: 1" data-bottom-top="opacity: 1;" data-anchor-target="info-wrapper">
        <h2>Test</h2>
        <p>This text isn't fading in or out... What is wrong?</p>
      </div>
    </div>
  </div>
</div>

CSS

代码语言:javascript
复制
html {
overflow-y: scroll;
}

.navbar {
opacity:0.9;
filter:alpha(opacity=90); /* For IE8 and earlier */
}

#top-nav .active {
border-bottom: 3px #643b8d solid;
}

.section {
/*margin-top: -50px;*/
padding-top: 50px;
margin: 10px 0;
}

#test .section {
background:url(http://ihatetomatoes.net/demos/parallax-scroll-effect/img/bcg_slide-5.jpg) no-repeat center;
background-size: cover;
background-attachment: fixed;
height: 750px;
width: 100%;
position: relative;
}

#info .section {
background:url(http://ihatetomatoes.net/demos/parallax-scroll-effect/img/bcg_slide-5b.jpg) no-repeat center;
background-size: cover;
background-attachment: fixed;
height: 750px;
width: 100%;
position: relative;
}

#info-wrapper {
background-color: rgba(255,255,255,0.75);
opacity: 0;
}

这里的例子

谢谢

EN

回答 1

Stack Overflow用户

发布于 2014-04-02 06:34:20

异常:找不到锚定目标“信息包装器”

这是data-anchor-target="#info-wrapper"而不是data-anchor-target="info-wrapper"。除此之外,这两个关键帧都定义了opacity:1

更正:http://jsfiddle.net/ak7Bg/1/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22802303

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档