zoukankan      html  css  js  c++  java
  • scroll运用、图片悬浮

    scroll 滚动条 长话短说进入正题:

    scrollTOP==0 内容置于顶部;

    scrollTOP()>=$(document).height-$(window).height 内容置于底部

    之后我写了一个效果,在鼠标滚动120像素时,content层显示,小于120像素,content层隐藏

    <!--html-->

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script class="jquery library" src="jquery/jquery-1.8.2.min.js" type="text/javascript"></script>
    <title>对联广告</title>
    </head>
    <body style="height:1000px;">
    <div class="content">
    </div>
    </body>
    </html>

    <!--css-->

    *{margin:0;padding:0;}

    .content{200px;height:400px;background:#fff;display:none;position:fixed;left:0;top:30px;_position:absolute;_top:expression((offsetParent.srollTop)+0);_left:expression((offsetParent.scrollLeft)+0);z-index:999;}

    <!--js-->

    window.onscroll=function(){
    var t=document.documentElement.scrollTop||document.body.scrollTop
    if(t>120){
    $(".content").fadeIn();
    }else{
    $(".content").fadeOut();
    }
    }

  • 相关阅读:
    Hadoop2.8.2 运行wordcount
    RHEL7.2 安装Hadoop-2.8.2
    RHEL7.2 SSH无密码登录非root用户
    python day 1 homework 2
    python day 1 homework 1
    python三种格式化输出
    windwos 10 安装flask
    ubunit 16 安装pip
    Axure 8 Tab制作
    JavaScript平台Platypi悄然登场
  • 原文地址:https://www.cnblogs.com/fs521cw/p/4092754.html
Copyright © 2011-2022 走看看