• stellar插件小例子


    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
    body {
    font-size: 100px;
    color: white;
    text-shadow: 0 1px 0 black, 0 0 5px black;
    text-align: center;
    line-height: 600px;
    }
    p {
    padding: 0 0.5em;
    margin: 0;
    }
    .content {
    background-attachment: fixed;

    }
    #content1 {
    background-image: url("images/1.jpg");
    }
    #content2 {
    background-image: url("images/2.jpg");
    }
    #content3 {
    background-image: url("images/3.jpg");
    }
    #content4 {
    background-image: url("images/4.jpg");
    }
    .slow {
    position: absolute;
    top: 600px;
    left: 200px;
    }
    .fast {
    position: absolute;
    top: 600px;
    right: 200px;
    }
    </style>

    </head>
    <body>
    <div class="content" id="content1" data-stellar-background-ratio="0.3">
    <p>TEXT HERE</p>
    </div>
    <div class="content" id="content2" data-stellar-background-ratio="0.3">
    <p>TEXT HERE</p>
    </div>

    <div class="content" id="content3" data-stellar-background-ratio="0.3">
    <p class="one">TEXT HERE</p>
    </div>
    <div class="content" id="content4" data-stellar-background-ratio="0.3">
    <p >TEXT HERE</p>
    </div>
    </body>
    <script src="js/jquery.min.js"></script>
    <script src="js/jquery.stellar.min.js"></script>
    <script>
    $(function() {
      // 让content 的高度Wie为当前屏幕的高度
      $(".content").height($(window).height());
      $.stellar({
        horizontalScrolling: false, // 设置垂直 视差滚动效果 不是水平的
        responsive: true,
        //data-stellar-background-ratio="0.03" 设置背景滚动速度,要写在html中,不能写在这里
      });
    })
    </script>
    </html>

  • 相关阅读:
    sql增删改查-转载
    委托和事件 链接
    三层架构-转载
    ToList()方法
    Invoke--转载
    C# 6.0新特性---语法糖
    索引器
    HBase学习总结(1)
    教程-关于Owner和Parent的区别
    问题-在TreeView使用时,发现选中的树节点会闪烁或消失
  • 原文地址:https://www.cnblogs.com/pxxdbk/p/12680862.html
Copyright © 2020-2023  润新知