zoukankan      html  css  js  c++  java
  • transition实现图片轮播

    <!DOCTYPE html>

    <html>

    <head>

    <meta charset="utf-8" />

    <title>css3 通过transform属性实现DIV元素的旋转</title>

    <style>
    #content{800px;margin: 30px auto;position: relative;}
    input[type="radio"]{display: none;}
    input[type="radio"]~img{ 800px;position: absolute;top:0px;left:0px;opacity: 0;height: 500px;transform:scale(1.1);transition:all 2s;}
    input:checked +label + img{opacity: 1;transform:scale(1.0);}
    input:checked +label img{border: 8px solid #FFDA34; opacity: 1.0; transition: all 2s;}
    label {display: inline-block; 134px;margin: 5px 8px;}
    label img{ opacity:0.5; 134px; margin-top:500px;height: 75px;border:8px solid #000;}
    </style>

    </head>

    <body>

    <div class="aimateStyle">

    </div>

    <div id = "content">
    <input type = "radio" name="carousel" id = "list1" checked>
    <label for="list1">
    <img src="http://p0.meituan.net/deal/d1d4b099f0f6258296f20b4782c479a254150.jpg%40450w_280h_1e_1c_1l%7Cwatermark%3D1%26%26r%3D1%26p%3D9%26x%3D5%26y%3D5%26relative%3D1">
    </label>
    <img src="http://p0.meituan.net/deal/d1d4b099f0f6258296f20b4782c479a254150.jpg%40450w_280h_1e_1c_1l%7Cwatermark%3D1%26%26r%3D1%26p%3D9%26x%3D5%26y%3D5%26relative%3D1">

    <input type = "radio" name="carousel" id = "list2">
    <label for="list2">
    <img src="http://p1.meituan.net/deal/12cf752971008356d4c77685356aa9e355639.jpg%40450w_280h_1e_1c_1l%7Cwatermark%3D1%26%26r%3D1%26p%3D9%26x%3D5%26y%3D5%26relative%3D1">
    </label>
    <img src="http://p1.meituan.net/deal/12cf752971008356d4c77685356aa9e355639.jpg%40450w_280h_1e_1c_1l%7Cwatermark%3D1%26%26r%3D1%26p%3D9%26x%3D5%26y%3D5%26relative%3D1">

    <input type = "radio" name="carousel" id = "list3">
    <label for="list3">
    <img src="http://p0.meituan.net/deal/723ef89c388ea1dba03e021291b153e953366.jpg%40450w_280h_1e_1c_1l%7Cwatermark%3D1%26%26r%3D1%26p%3D9%26x%3D5%26y%3D5%26relative%3D1">
    </label>
    <img src="http://p0.meituan.net/deal/723ef89c388ea1dba03e021291b153e953366.jpg%40450w_280h_1e_1c_1l%7Cwatermark%3D1%26%26r%3D1%26p%3D9%26x%3D5%26y%3D5%26relative%3D1">
    </div>

    <script type="text/javascript">
    window.onload = function(){
    var i = 0;
    setInterval(function(){
    document.getElementsByTagName('input')[i%3].checked = true;
    i++;
    }, 2500);
    }
    </script>
    </body>

    </html>

    实现效果静态图

  • 相关阅读:
    Oracle基础操作
    Linux的常用命令
    Javascript 上课笔记
    Linux操作指令
    css样式分类
    DW
    标准sql执行顺序
    Mysql数据库
    模拟课----需求文本
    php 发送邮件
  • 原文地址:https://www.cnblogs.com/liangxuru/p/5955558.html
Copyright © 2011-2022 走看看