js实现无限不间断单方向滑动

本文通过JavaScript和CSS3展示了如何创建一个无限不间断的单方向水平滑动效果。代码示例详细解释了实现这一功能的关键步骤,适用于网页中的轮播图或展示区。
摘要由CSDN通过智能技术生成

代码如下:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.box{
    
				width: 800px;
				height: 500px;
				border: 1px solid #000000;
				position: relative;
				margin: 0 auto;
				padding: 0;
				overflow: hidden;
			}
			.roll_box{
    
				height: 100%;
				position: relative;
				margin: 0 auto;
				padding: 0;
				float: left;
			}
			.roll_box>ul{
    
				padding: 0;
				margin: 0;
				display: flex;
				flex-flow: row nowrap;
			}
			.roll_box>ul>li{
    
				width: 200px;
				height: 100%;
				padding: 0;
				list-style: none;
				border: 1px solid #000000;
				box-sizing: border-box;
			}
			.li_head{
    
				width: 100%;
				height: 200px;
				background: #504044;
				display: flex;
				justify-content: center;
				align-items: center;
				position: relative;
			}
			.li_center{
    
				width: 100%;
				height: 50px;
				background: #d1c5ca;
				text-align: center;
				line-height: 50px;
				font-size: 16px;
			}
			.li_footer{
    
				width: 100%;
				height: 250px;
				background: #2fc1ff;
			}
			.hexa{
    
				width: 96px;
				height: 120px;				
				overflow: hidden;
				transform: rotate(120deg);
				margin: auto;
				position: relative;
				
			}
			.hexa_child{
    
				width: 100%;
				height: 100%;				
				transform: rotate(-60deg);
				overflow: hidden;
				
			}
			.hexa_child_child{
    
				width: 100%;
				height: 100%;				
				transform: rotate(-60deg);
				overflow: hidden;
				background-color: red;
				
			}
			.hexa_text{
    
				position: absolute;
				left: 50%;
				top: 50%;
				transform: translateY(-50%) translateX(-50%);
			}
		</style>
	</head>
	
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值