无缝轮播图(Jquery)

无缝轮播图(Jquery)

实现功能(无缝轮播图Jquery)

利用移动定位进行无缝滚动,大体实现点击切换图片,每张图片对应一个小圆点,并且小圆点点击可以进行切换。鼠标移入停止图片轮播

强调

jquery引入本地引入,你可以在网上导入
全局由index贯穿
动画中的回调函数
flag标识,进行判断动画在执行中还是执行结束
对于图片切换到第一张还是最后一张的处理

css代码片段

* {
   
    padding: 0;
    margin: 0;
}
html,
body {
   
    height: 100%;
    overflow: hidden;
}
body{
   
    background: rgba(0, 0, 0, 0.2);
}
.box {
   
    width: 1000px;
    height: 80%;
    margin: 50px auto;
    position: relative;
    overflow: hidden;
    box-shadow: 2px 2px 15px #333333;
}

ul {
   
    height: 100%;
    position: absolute;
    display: flex;
}

ol,
ul,
li {
   
    list-style: none;
}

li {
   
    flex-shrink: 0;
    width: 1000px;
    height: 100%;
}

li>img {
   
    width: 100%;
    height: 100%;
}

button {
   
    width: 70px;
    height:50px;
    color: #f5f5f5;
    position: absolute;
    z-index: 3;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.2);
    border-radius:0 5px 5px 0;
    opacity: 0;
    border: none;
    cursor: pointer;
    outline: none;
    transition: all 1s;
}
.box:hover button{
   
    opacity: 1;
}
button:hover{
   
    background: rgba(0, 0, 0, 0.5);
}
.left{
   
    border-radius:0 5px 5px 0;
}
.right {
   
    border-radius:5px 0px 0px 5px;
    right: 0;
}
ol{
   
    width: 120px;
    display:<
  • 8
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值