原生JavaScript小特效

这篇博客探讨了如何利用纯JavaScript来创建各种有趣的特效。内容涉及到背景图片的处理,例如使用'纽扣1.png'和'纽扣2.png'等命名规则的图片进行操作,并提供了实际的图片示例作为展示。
摘要由CSDN通过智能技术生成

这里背景图片命名格式为:纽扣1.png,纽扣2.png
最后有图片示例

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title></title>
  <style type="text/css">
   *{
    margin: 0px;
    padding: 0px;
    list-style: none;
   }
   #box{
    width: 90%;
    height: 700px;
    background: dimgray;
    margin: 13px auto;
    position: relative;
   }
   #backgray{
    position: absolute;
    width: 99%;
    height: 90%;
    background: gainsboro;
    top: 1%;
    left: 0.5%;
   }
   .tl,.tr,.bl,.br{
    border: 1px solid dimgray;
    position: absolute;
    width: 5%;
    height: 10%;
   }
   .tl{
    top: 1.8%;
    left: 0.8%;
    border-bottom: none;
    border-right: none;
   }
   .tr{
    top: 1.8%;
    left: 94.2%;
    border-left: none;
    border-bottom: none;
   }
   .bl{
    top: 88%;
    left: 0.8%;
    border-right: none;
    border-top: none;
   }
   .br{
    top: 88%;
    left: 94.2%;
    border-top: none;
    border-left: none;
   }
   #ul1,#ul2{
    width: 80%;
    height: 35%;
    /* border: #000000 1px solid; */
    position: absolute;
    z-index: 1;
   }
   #ul1{
    top: 15%;
    left: 10%;
   
   }
   #ul2{
    margin-top: 10px;
    top: 49%;
    left: 10%;
   }
   li{
    position: absolute;
    float: right;
    display: inline-block;
    border-radius: 50%;
    background-size: 108% 108%;
   }
   #hidden{
    width: 800px;
    height: 600px;
    position: absolute;
    top: -300px;
    left: 150px; 
    background-size: 100% 100%;
    background-repeat: no-repeat;
    opacity: 0;
    display: none;
   }
   #hiddentop{
    width: 1000px;
    height: 800px;
    background-repeat: no-repeat;
    background-size: 100%;
    position: absolute;
    top: -320px;
    left: -250px;
    transform: translateY(-700px);
   }
   #hiddenmin{
    width: 1000px;
    height: 800px;
    background-repeat: no-repeat;
    background-size: 100%;
    position: absolute;
    top: -310px;
    left: -550px;
    transform: scale(0,0);
   }
   #hiddenlast{
    width: 400px;
    height: 250px;
    background-repeat: no-repeat;
    background-size: 100%;
    position: absolute;
   }
   #hiddenbox{
    width: 400px;
    height: 250px;
    position: absolute;
    t
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值