zoukankan      html  css  js  c++  java
  • 百叶窗 蒙版 图层

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
    *{
    margin:0;
    padding:0;
    }
    .box{
    margin:0 auto;
    600px;
    height: 436px;
    overflow: hidden;
    position: relative;
    }
    .box img{
    position: absolute;
    top:0;
    left:0;
    cursor: pointer;
    }
    .box img:nth-child(2){
    left: 100px;
    }
    .box img:nth-child(3){
    left: 200px;
    }
    .box img:nth-child(4){
    left: 300px;
    }
    .box img:nth-child(5){
    left: 400px;
    }
    .box img:nth-child(6){
    left: 500px;
    }
    .compare{
    370px;
    height: 436px;
    background: url("imasges/chanpin_image03.jpg");
    position: relative;
    margin-left: 100px;
    }
    .up{
    20px;
    height: 436px;
    background: rgba(230,230,200,0.2);
    border-left: 3px #000 solid;
    box-shadow:5px 5px 5px rgba(0, 0, 0, 0.6);
    margin-bottom: 20px;
    position: absolute;
    top:0;
    right:0;
    }
    .box2{
    1100px;
    margin: 0 auto;
    }
    </style>
    <script src="js/jquery-1.12.4.min.js"></script>
    <script>
    $(function () {
    $('.box img').mouseenter(function () {
    var index = $(this).index();
    $('.box img').each(function (i,el) {
    if(i<=index){
    $(el).stop(true).animate({
    'left':(i*48)+'px'
    },600)
    }else if(i>index){
    $(el).stop(true).animate({
    'left':((i-1)*48+360)+'px'
    },600)
    }
    })
    }).mouseleave(function () {
    $('.box img').each(function (i,el) {
    $(el).stop(true).animate({
    'left':i*100+'px'
    },100)
    })
    });

    // mask 蒙版
    $('.compare').mouseenter(function () {
    $(this).mousemove(function (event) {
    event=event||window.event;
    $('.up').css('width',(parseFloat($('.box2').css('margin-left'))+parseFloat($('.compare').css('margin-left'))+370)-event.pageX);
    })
    }).mouseleave(function () {
    $('.up').css('width','20px');
    })
    })
    </script>
    </head>
    <body>
    <div class="box">
    <img src="imasges/chanpin_image01.jpg" width="360px"/>
    <img src="imasges/chanpin_image02.jpg" width="360px"/>
    <img src="imasges/chanpin_image03.jpg" width="360px"/>
    <img src="imasges/chanpin_image04.jpg" width="360px"/>
    <img src="imasges/chanpin_image05.jpg" width="360px"/>
    <img src="imasges/chanpin_image06.jpg" width="360px"/>
    </div>
    <div class="box2">
    <div class="compare">
    <div class="up"></div>
    </div>
    </div>
    </body>
    </html>
  • 相关阅读:
    AS3邮件
    JavaScript中this关键字使用方法详解
    AS3嵌入字体
    xp双击打不开jar包解决方案
    查询在表1表2中都存在,在表3中不存在的SQL(前提:表结构相同)
    这是否为复制Bug?求解!
    批处理添加允许弹出临时窗口站点
    SQL Server 合并IP
    C#学习笔记一(变量、属性、方法,构造函数)
    SQLServer事务的隔离级别
  • 原文地址:https://www.cnblogs.com/xiaoxiongv1/p/8034652.html
Copyright © 2011-2022 走看看