【博主推荐】html好看的图片轮播多种风格(源码)

您所在的位置:网站首页 晨练照片好看的图片 【博主推荐】html好看的图片轮播多种风格(源码)

【博主推荐】html好看的图片轮播多种风格(源码)

2024-07-17 07:26:08| 来源: 网络整理| 查看: 265

html好看的图片轮播多种风格 所有轮播图动态效果展示1.普通自带按钮切换轮播图1.1 效果展示1.2 源码 2.自动切换图片2.1 效果展示2.2 源码 3.鼠标拖动切换图片3.1 效果展示 4.数字按钮拖动切换图片4.1 效果展示 5.图片带缩略图5.1 效果展示 6.上下拖动切换图片6.1 效果展示 7. 3D切换图片7.1 效果展示 8.带文字的轮播图8.1 效果展示 9.轮播过渡切换特效9.1 效果展示 10.横向滚动图片10.1 效果展示 11.基本轮播图11.1 效果展示 12.三维切换轮播图12.1 效果展示 13.书本切换轮播图13.1 效果展示 源码下载好的html源码下载

多种轮播效果图,支持配置,可以自动切换,鼠标拖动,角标按钮切换,不一样的切换效果,可以直接嵌入项目使用,简单灵活。

代码结构 在这里插入图片描述 所有轮播图动态效果展示

xcLeigh - 轮播图

1.普通自带按钮切换轮播图 纯css写的轮播图,仅支持按钮切换 1.1 效果展示

在这里插入图片描述

1.2 源码 xcLeigh - 轮播图 /*使轮播图弹性布局,居中设置最小高度*/ body{ display: flex; justify-content: center; margin:0px;padding:0px; align-items: center; /* 1vh 意味着值为视口高度的 1%,vh 则与设备视口的高度有关 */ min-height: 100vh; } /* 定义一个图片轮播区域 */ ul.slides{ position: relative; width: 600px; height: 280px; list-style: none; margin: 0; padding: 0; background-color: #eee; overflow: hidden; } /* 设置每个图片的从左往右弹性盒子排版以及水平垂直居中 */ li.slide{ margin: 0; padding: 0; width: inherit; height: inherit; position: absolute; top: 0; left: 0; display: flex; justify-content: center; align-items: center; /* font-family: Helvetica; font-size: 120px; color: #fff; */ transition: .5s transform ease-in-out; } /* 为6个li添加背景图 */ .slide:nth-of-type(1){ background:url(img/p1.jpg) no-repeat; background-size: cover; background-position: top; } .slide:nth-of-type(2){ background:url(img/p2.jpg) no-repeat; background-size: cover; background-position: top; left: 100%; } .slide:nth-of-type(3){ background:url(img/p3.jpg) no-repeat; background-size: cover; background-position: top; left: 200%; } .slide:nth-of-type(4){ background:url(img/p4.jpg) no-repeat; background-size: cover; background-position: top; left: 300%; } .slide:nth-of-type(5){ background:url(img/p5.jpg) no-repeat; background-size: cover; background-position: top; left: 400%; } /* 设置按钮作为相对定位和覆盖图片区域 */ input[type="radio"]{ position: relative; z-index: 100; display: none; } /* 设置与label相关联的按钮的位置 */ .controls-visible{ position: absolute; width: 100%; bottom: 12px; text-align: center; } /* 设置这一组6个label的排列方式并且设置它们的初始样式为白色带有白色边框(以便于选中的变化效果明显) */ .controls-visible label{ display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #fff; margin: 0 5px; border: 2px solid #fff; } /* 当点击label同时按钮被选中时,与之联动定位的label样式发生改变 */ .slides input[type="radio"]:nth-of-type(1):checked~ .controls-visible label:nth-of-type(1) { background-color: #333; } .slides input[type="radio"]:nth-of-type(2):checked~ .controls-visible label:nth-of-type(2) { background-color: #333; } .slides input[type="radio"]:nth-of-type(3):checked~ .controls-visible label:nth-of-type(3) { background-color:#333; } .slides input[type="radio"]:nth-of-type(4):checked~ .controls-visible label:nth-of-type(4) { background-color: #333; } .slides input[type="radio"]:nth-of-type(5):checked~ .controls-visible label:nth-of-type(5) { background-color: #333; } /* 当按钮radio被选中时,后面的兄弟元素向左移动一个图片区域距离 */ .slides input[type="radio"]:nth-of-type(1):checked~.slide{ transform: translateX(0%); } .slides input[type="radio"]:nth-of-type(2):checked~.slide{ transform: translateX(-100%); } .slides input[type="radio"]:nth-of-type(3):checked~.slide{ transform: translateX(-200%); } .slides input[type="radio"]:nth-of-type(4):checked~.slide{ transform: translateX(-300%); } .slides input[type="radio"]:nth-of-type(5):checked~.slide{ transform: translateX(-400%); } 2.自动切换图片 JS+CSS写的自动切换图片 2.1 效果展示

在这里插入图片描述

2.2 源码 /* 标签选择器 */ p { text-align: center; font-size: 25px; color: cadetblue; font-family: fantasy; } /* id选择器 */ #hr1 { background-color: cadetblue; height: 2px; width: 75%; } /* 类选择器 */ .imgbox { border-top: 5px solid cadetblue; /* 避免因窗口变化影响图片效果 */ width: 60%; height: 40%; margin: 0 auto; } .img { width: 60%; height: 40%; margin: 0 auto; display: none; } xcLeigh - 轮播图 img1 img2 img3 img4 img5 // index:索引, len:长度 var index = 0, len; // 类似获取一个元素数组 var imgBox = document.getElementsByClassName("img-slide"); len = imgBox.length; imgBox[index].style.display = 'block'; // 逻辑控制函数 function slideShow() { index ++; // 防止数组溢出 if(index >= len) index = 0; // 遍历每一个元素 for(var i=0; i


【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


    图片新闻

    实验室药品柜的特性有哪些
    实验室药品柜是实验室家具的重要组成部分之一,主要
    小学科学实验中有哪些教学
    计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
    实验室各种仪器原理动图讲
    1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
    高中化学常见仪器及实验装
    1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
    微生物操作主要设备和器具
    今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
    浅谈通风柜使用基本常识
     众所周知,通风柜功能中最主要的就是排气功能。在

    专题文章

      CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭