h5 stellar.js插件的使用 qqTim背景视差滚动效果

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>QQ-Tim</title>
    <link rel="stylesheet" href="css/index.css">
    <!--[if lte IE 8]>
    <script src="js/html5shiv.min.js"></script>
    <![endif]-->
</head>
<body>
<!--导航-->
<nav class="qq_nav">
    <div class="wrapper">
        <a href="#" class="logo"></a>
        <ul class="nav">
            <li><a href="#">首页</a></li>
            <li><a href="#">下载</a></li>
            <li><a href="#">动态</a></li>
        </ul>

        <div class="other">
            <ul>
                <li><a href="#"></a>QQ会员</li>
                <li><a href="#"></a>QQ安全中心</li>
                <li><a href="#"></a>登录</li>
            </ul>
            <span>当前在线人数: 227,763,015</span>
        </div>
        <a href="#" class="register">注册</a>
    </div>
</nav>
<!--展示-->
<section class="qq_banner">
    <img src="images/banner-logo.png" alt="">
    <img src="images/banner-download.png" alt="">
    <img src="images/banner-list.png" alt="">
    <img src="images/banner-product.png" alt="">
</section>
<!--语音-->
<section class="qq_sound">
    <h1>T'm QQ - 每一天,乐在沟通</h1>
    <div class="bg" data-stellar-background-ratio="0.3"></div>
    <div class="content">
        <div class="iphone"></div>
        <h2>沟通,是跨越<br>千山万水的亲切声音</h2>
        <p>无论何时何地你都能自由享受qq在各类<br>终端上带来的高清通话,与好友一起想聊多久聊多久</p>
    </div>
</section>
<!--文件-->
<section class="qq_file">
    <div class="bg" data-stellar-background-ratio="0.3"></div>
    <div class="content">

        <h2>沟通,是跨越<br>千山万水的亲切声音</h2>
        <p>无论何时何地你都能自由享受qq在各类<br>终端上带来的高清通话,与好友一起想聊多久聊多久</p>
        <div class="mac"></div>
    </div>
</section>
<!--兴趣-->
<section class="qq_interest">
    <div class="bg" data-stellar-background-ratio="0.3"></div>
    <div class="content">
        <div class="phone"></div>
        <h2>沟通,是跨越<br>千山万水的亲切声音</h2>
        <p>无论何时何地你都能自由享受qq在各类<br>终端上带来的高清通话,与好友一起想聊多久聊多久</p>

    </div>
</section>
<!--底部-->
<footer class="qq_footer">
    <div class="content">
        <div class="plats">
            <a class="plmb" href="#" target="_blank">QQ 手机版</a>
            <a class="plpc" href="#" target="_blank">QQ PC版</a>
            <a class="plmac" href="#" target="_blank">QQ Mac版</a>
            <a class="plpad" href="#" target="_blank">QQ Pad版</a>
        </div>
        <p>Copyright © 1998- 2017 Tencent. All Rights Reserved.</p>
        <p>腾讯公司 版权所有</p>
    </div>
</footer>

<script src="js/jquery.min.js"></script>
<script src="js/index.js"></script>
<script src="js/jquery.stellar.js"></script>
</body>
</html>

index.css

/*样式初始化*/
* {
    padding: 0;
    margin: 0;
}
body {
    font-size: 14px;
    font-family: "Microsoft YaHei",sans-serif;
}
ul {
    list-style: none;
}
a {
    color: #333;
    text-decoration: none;
}
/*model css*/
.qq_nav {
    height: 150px;
    background: url("../images/nav_bg.png") repeat-x;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
}
.qq_nav .wrapper {
    margin: 0 auto;
    width: 1080px;
    height: 75px;
}
.qq_nav .wrapper .logo {
    width: 100px;
    height: 75px;
    background: url("../images/nav_brand.png") no-repeat center;
    float: left;
}
.qq_nav .wrapper .nav {
    float: left;
}
.qq_nav .wrapper .nav li {
    float: left;
    font-size: 18px;
    line-height: 75px;
    margin-left: 20px;
}
.qq_nav .wrapper .nav li a{
    display: block;
    padding: 0 20px;
}

.qq_nav .wrapper .nav li a:active,
.qq_nav .wrapper .nav li a:hover {
    background: #12b7f5;
}
.qq_nav .wrapper .register {
    float: right;
    height: 36px;
    width: 96px;
    text-align: center;
    line-height: 36px;
    font-size: 16px;
    background: #12b7f5;
    color: #fff;
    border-radius: 18px;
    margin-top: 19px;
}
.qq_nav .wrapper .other {
    float: right;
    width: 250px;
    height: 75px;
}
.qq_nav .wrapper .other ul {
    /*float: right;*/
    width: 250px;
}
.qq_nav .wrapper .other ul li {
    float: right;
    margin-left: 30px;
}
.qq_nav .wrapper .other ul li a {
    font-size: 14px;
    text-shadow: 0 0 2px #333;
    height: 50px;
    line-height: 50px;
}
.qq_nav .wrapper .other span {
    float: right;
}
.qq_banner{
    height: 880px;
    background: url("../images/banner-bg.jpg") no-repeat center top;
    padding-top:150px;
}
.qq_banner img {
    /*块独占一行*/
    display: block;
    margin: 20px auto 0;
}
.qq_banner img:last-child {
    /*让图片的宽度虽现在高度自由等比缩放*/
    width: 100%;
    /*只有图片会自适应宽度和高度,规定了宽度长度会跟着变,不然右边会超出一个屏幕*/
}
.qq_sound{}
.qq_sound h1 {
    height: 300px;
    background: url("../images/sound-text.png") no-repeat center/cover;
    font-size: 0;
}
.qq_sound .bg {
    height: 500px;
    background: url("../images/sound-bg.jpg") no-repeat center/cover;
}
.qq_sound .content {
    height: 500px;
    width: 980px;
    margin: 0 auto;
    position: relative;
}
.qq_sound .content .iphone{
    position: absolute;
    top: -200px;
    width: 700px;
    height:700px;
    /*背景图向上顶格*/
    background: url("../images/sound-phone.png") no-repeat center top/cover;
}
.qq_sound .content h2 {
    float: right;
    padding-top: 100px;
    width: 500px;
    text-align: right;
    font-size: 40px;
}
.qq_sound .content p {
    width: 500px;
    float: right;
    text-align: right;
    padding-top:50px;
    text-shadow: 0 0 2px #333;
    font-size: 18px;
}
.qq_file .bg {
    height: 500px;
    background: url("../images/file-bg.jpg") no-repeat center/cover;
}
.qq_file .content {
    height: 500px;
    width: 980px;
    margin: 0 auto;
    position: relative;
}
.qq_file .content .mac{
    background: url("../images/file-mac.png") no-repeat center/cover;
    width: 600px;
    height: 340px;
    position: absolute;
    right: -60px;
    top: 100px;
}
.qq_file .content h2 {
    float: left;
    padding-top: 100px;
    width: 500px;
    text-align: left;
    font-size: 40px;
}
.qq_file .content p {
    padding-top: 50px;
    float: left;
    width: 500px;
    text-align: left;
    font-size: 18px;
    text-shadow: 0 0 2px #333;
}

.qq_interest h1 {
    height: 300px;
    /*background: url("../images/interest.png") no-repeat center/cover;*/
    font-size: 0;
}
.qq_interest .bg {
    height: 500px;
    background: url("../images/interest-bg.jpg") no-repeat center/cover;
}
.qq_interest .content {
    height: 500px;
    width: 980px;
    margin: 0 auto;
    position: relative;
}
.qq_interest .content .phone{
    position: absolute;
    top: 0;
    left: 0;
    width: 350px;
    height:500px;
    /*背景图向上顶格*/
    background: url("../images/interest-phone.png") no-repeat center top/cover;
}
.qq_interest .content h2 {
    float: right;
    padding-top: 100px;
    width: 500px;
    text-align: right;
    font-size: 40px;
}
.qq_interest .content p {
    width: 500px;
    float: right;
    text-align: right;
    padding-top:50px;
    text-shadow: 0 0 2px #333;
    font-size: 18px;
}


.qq_footer{
    height: 250px;
    background: #2a2a2a;
    font-size: 12px;
    text-align: center;
    padding-top: 50px;
    color: #666;
}
.plats{
    width: 800px;
    height: 150px;
    margin: 0 auto;
    display: block;
}
.plats a {
    float: left;
    background: transparent url(../images/footer.png) no-repeat 10px 0;
    text-align: center;
    font-size: 12px;
    color: #666;
    padding-top: 50px;
    width: 80px;
    margin: 0 60px;
}
.plats a:hover {
    color: #12b7f5;
}
.plats a.plmb {
    background-position: 0 0;
}
.plats a.plmb:hover {
    background-position: 0 -93px;
}
.plats a.plpc {
    background-position: -105px 0;
}
.plats a.plpc:hover {
    background-position: -105px -93px;
}
.plats a.plmac {
    background-position: -210px 0;
}
.plats a.plmac:hover {
    background-position: -210px -93px;
}
.plats a.plpad {
    background-position: -326px 0;
}
.plats a.plpad:hover {
    background-position: -326px -93px;
}

.qq_sound .bg,.qq_file .bg,.qq_interest .bg{
    background-attachment: fixed;
}

index.js

$(function(){
    $.stellar({ horizontalScrolling: false, responsive: true });
});

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值