出现在滚动问题上

时间:2016-12-11 11:39:16

标签: javascript jquery html css

我写了这个简单的css js和html出现在滚动上它仍然不会在html中运行?也许它的方式我在我的HTML连接它,但似乎很好我已经搜索了许多网站,以确认其正确...我不知道我哪里出错了。

.aboutfilmandcrew {
  width: 100%;
  float: left;
  background-color: green;
}




#filminfo{

    padding:1em;
    border:.1em solid rgb(230, 230, 230);
    margin: 2em;
    width: 40%;
    float: left;    
}

#crew{


    padding:1em;
    border:.1em solid rgb(230, 230, 230);
    margin: 2em;
    width: 40%;
    float: right;

}

        <div class="aboutfilmandcrew">

      <div id="filminfo"> 
        Neuromancer, a novel written by William Gibson in 1984, takes place in the near future in a cyberpunk setting. Cyberpunk is a genre that focuses on future societies where technology has advanced, but crime and corruption have as well. Common features include globe-spanning mega-corporations, cybernetically enhanced mercenaries, and the importance of technology as a tool for crime.
        The story follows the experiences of Case, an out-of-work hacker who is contacted by a mysterious new employer called Armitage. Along with Molly, a mercenary cyborg, and a thief/illusionist named Peter Riviera, Case participates in a series of data thefts for their employer.  Based on the novel, and helmed by master director Ridley Scott, NEUROMANCER features a star studded cast that includes Ryan Gosling, Lucy Liu, Hayden Christensen and Benedict Cumberbatch.

            <br/>
            <h4> GENRES </h4>
            Sci fi/Adventure
          </p>

        </div><!---aboutfilm-->

      <div id="crew">
        <p>Director Ridley Scott </p>
        <p> Screenplay by Drew Goddard </p>
        <p> Based on the Novel By William Gibson </p>
        <p> Producers Simon Kinberg, Ridley Scott, Michael Schaefer, Aditya Sood, Mark Huffam </p>
        <p> Actors Ryan Gosling, Lucy Liu, Hayden Christensen and Benedict Cumberbatch </p>



        </div><!---crew-->
    </div><!---aboutfilmandcrew-->



$(document).scroll(function() {
  var y = $(this).scrollTop();

  if (y > 200) {
    $('.aboutfilmandcrew').fadeIn();
  } else {
  console.log("<");
    $('.aboutfilmandcrew').fadeOut();
  }
});

1 个答案:

答案 0 :(得分:-1)

$(document)更改为$(window),它应该开始有效。