无缝轮播的案例:

  <!DOCTYPE html>
  <html>
  <head>
    <meta charset="UTF-8">
    <title>无缝轮播</title>
    <style>
      *{
        margin:0;
        padding:0;
      }
      div{
        width:1000px;
        height:200px;
        position:relative;
        top:20px;
        left:100px;
        border:red 5px solid;
        overflow: hidden;
      }
      ul{
        width:2000px;
        height:200px;
        list-style: none;
        position:absolute;
        top:0;
        left:-1020px;
      }
      ul>li{
        width:200px;
        height:200px;
        float:left;
      }
    </style>
  </head>
  <body>
    <div>
      <ul id="ul">
        <li style="background:pink"></li>
        <li style="background:blue"></li>
        <li style="background:orange"></li>
        <li style="background:black"></li>
        <li style="background:green"></li>
        <li style="background:pink"></li>
        <li style="background:blue"></li>
        <li style="background:orange"></li>
        <li style="background:black"></li>
        <li style="background:green"></li>
      </ul>
    </div>
  </body>
  </html>
  <script>
    var ul=document.getElementById("ul")
    var t=null;
    var num=1;
    t=setInterval(function(){
      if (ul.offsetLeft<-ul.offsetWidth/2)
        {
        ul.style.left=0+"px";
        }
      ul.style.left=(ul.offsetLeft-num)+"px";
    },100/6)
  </script>

  无缝轮播的解析:
    1.无论什么时候,ul.offsetleft++ 无论什么时候,他的ul都要走
    2.初始值,设立,直接设到第二板块那里
    3.可以理解成,每次只走第二板块,因为每次需要第二板块 去覆盖掉,第一次模块走的东西
    4.造成的视觉错觉

  css3无缝轮播案例 

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="rem插件.js"></script>
<style>
*{
margin:0;
padding:0;
}
html{
font-size:100px;
overflow-x:hidden;
}
body{
font-size:14px;
}
div,ul,li,img{
margin:0;
padding:0;
}
.box{
width:100%;
height:1.17rem;
}
.clearfix:after{
content:"";
display:block;
height:0;
visibility:hidden;
clear:both;
}
.content{
width:500%;
height:1.17rem;
}
.content div{
width:20%;
height:1.17rem;
float:left;
} </style>
</head>
<body>
<div class="box">
<div class="content">
<div style="background:#cccccc"></div> <!-- 第三张-->
<div style="background:#ffb72b"></div> <!-- 第一张-->
<div style="background:lightblue"></div> <!-- 第二张-->
<div style="background:#cccccc"></div> <!-- 第三张-->
<div style="background:#ffb72b"></div> <!-- 第一张-->
</div>
</div>
</body>
</html>
<script>
var t=null,index=1;
var box=document.querySelector(".box");
var wid=box.offsetWidth;
var content=document.querySelector(".content");
content.style.transform="translateX(-"+(wid)+"px)";
t=setInterval(function(){
index++;
addtransition()
content.style.transform="translateX(-"+(wid*index)+"px)";
},2000)
//过度函数
function addtransition(){
content.style.transition="all .5s linear";
content.style.webkitTransition="all .5s linear";
}
function removetransition(){
content.style.transition="none";
content.style.webkitTransition="none";
}
content.addEventListener("transitionend",function(){
if(index>3){
index=1;
removetransition()
content.style.transform="translateX(-"+(wid*index)+"px)";
}
})
</script>

无缝轮播的案例 及css3无缝轮播案例的更多相关文章

  1. 基于css3的轮播效果

    花了一上午来调整页面在ie10上的显示问题,sass编译生成的css文件在ie内核下一直不能正确加载,果然兼容性的问题还需要好好研究.转入正题,用css3实现轮播效果主要是基于css3的framewo ...

  2. CSS3实现轮播图效果

    CSS3实现轮播图主要是由css:background-position和css3:animation实现.且实现此轮播需要一张四个图横着相连的图片. 注(Internet Explorer 10.F ...

  3. css3动画使用技巧之—JQ配合css3实现轮播之animation-delay应用

    <!DOCTYPE html> <html> <head> <title>css3动画使用技巧之—JQ配合css3实现轮播之animation-dela ...

  4. CSS3图片轮播效果

    原文:CSS3图片轮播效果 在网页中用到图片轮播效果,单纯的隐藏.显示,那再简单不过了,要有动画效果,如果是自己写的话(不用jquery等),可能要费点时间.css3的出现,让动画变得不再是问题,而且 ...

  5. 纯CSS3实现轮播图

    前言 纯css3实现的轮播图效果,和JavaScript控制的相比,简单高效了很多,但是功能也更加单一,只有轮播不能手动切换. 用什么实现的呢?页面布局 + animation动画 HTML部分 &l ...

  6. 纯css3无缝滚动

    纯css3无缝向左滚动: HTML: <div class="marqueCon"> <div class="marque"> < ...

  7. css3实现轮播图

    css3动画属性简写: animation: name  duration  timing-function  delay  iteration-count  direction  fill-mode ...

  8. 鹅厂优文|主播pk,如何实现无缝切换?

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文作者,rexchang(常青),腾讯视频云终端技术总监,2008 年毕业加入腾讯,一直从事客户端研发相关工作,先后参与过 PC QQ.手 ...

  9. js 实现图片间隔循环轮播以及没有间隔的循环轮播

    链接地址:http://blog.sina.com.cn/s/blog_75cf5f32010199dn.html 最近做了个图片循环轮播的功能.就是几张图片不断的循环滚动显示. 感觉这个方法不错所以 ...

随机推荐

  1. JAVA总结--dubbo与zookeeper

    读累了就看看实操https://www.cnblogs.com/huasky/p/10214642.html 一.SOA 概念:SOA:Service-Oriented Architecture,面向 ...

  2. DB2创建库 数据恢复

    例:数据库:PRODB2用户 :DB2ADMIN/DB2ADMIN备份库路径:D:/bank 一.恢复数据库1.启动数据库运行->db2cmd->db2Db2=>start db m ...

  3. Spring Boot 集成 Ehcache 缓存,三步搞定!

    作者:谭朝红 www.ramostear.com/articles/spring_boot_ehcache.html 本次内容主要介绍基于Ehcache 3.0来快速实现Spring Boot应用程序 ...

  4. java基础常问面试题

    1.面向对象和面向过程的区别 面向过程 :面向过程性能比面向对象高. 因为类调用时需要实例化,开销比较大,比较消耗资源,所以当性能是最重要的考量因素的时候,比如单片机.嵌入式开发.Linux/Unix ...

  5. java 接口 以及 与抽象类的区别

    狭义概念 : Java 中的 interface 广义概念 : 对外提供规则的都是 接口 接口的定义方式 :  interface 接口名 { } 用类实现接口:       class 类名 imp ...

  6. 09-js定时器、函数

    # js定时器 通过使用 JavaScript,我们有能力作到在一个设定的时间间隔之后来执行代码,而不是在函数被调用后立即执行.我们称之为计时事件. **定时器在javascript中的作用** 1. ...

  7. 跨域问题解决----NO 'Access-Control-Allow-Origin' header is present on the requested resource.Origin'http://localhost:11000' is therfore not allowed access'

    NO 'Access-Control-Allow-Origin' header is present on the requested resource.Origin'http://localhost ...

  8. Groovy基本语法

    官方文档 注释(Comments) 和Java一样,支持单行(使用//).多行(/* */)和文档注释(使用/** */). Shebang line UNIX系统支持一种特殊的单行注释叫作Sheba ...

  9. [好好学习]在VMware中安装Oracle Enterprise Linux (v5.7) - (1/5)

    在想到Oracle Enterprise Linux,第一时间就是在Oracle官网上找到资源,但是,出现以下图片

  10. open, creat - 用来 打开和创建 一个 文件或设备

    SYNOPSIS 总览 #includ e <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int o ...