博主网站(未完善)
博主首页

目录

01图标库
02插件安装

01条件渲染
02列表渲染
03模板渲染
04计算属性
05侦听器
06样式绑定
07样式
08事件
09表单输入绑定
10生命周期
11组件
12脚手架
13vue-router
14vuex
15拖拽
16组件间传递

01HTML元素
02CSS样式

01filter、find……
02匿名函数……
03动态拼接地址
04vh、vm
05vue中ref
06js类型判断
07插槽
08富文本编辑器
09javaScript
10watch监听
11依赖注入
12ES6运算符
13flex-direction
14本地存储
15随机颜色
16中间延申
17多次触发问题
18nvm安装
19表单数据动态
20持久化存储
21$nextTick
22::v-deep
23tab失灵
25封装表单验证
26电梯导航栏
27页面滚动渐入动画

css3基础01

01bs列表
02bs栅格
03bs表单
更新中......

js动画实例

<!--<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<style type="text/css">
</style>
</head>
<body>
<div style="position:absolute;left:0;top:0;width:50px;height:50px;background-color:blue;"></div>
<script type="text/javascript">
    var div=document.getElementsByTagName('div')[0];
    var disX,
        disY;
        div.onmousedown=function(e){
            disX=e.pageX-parseInt(div.style.left);
            disY=e.pageY-parseInt(div.style.top);
            document.onmousemove=function(e){
                var event=e||window.event;
                div.style.left=e.pageX-disX+"px";
                div.style.top=e.pageY-disY+"px";
            }
            document.onmouseup=function(){
                div.onmousemove=null;
            }
        }
</script>
</body>
</html>-->
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<style>
  *{
      margin:0px;
      padding:0px;
  }
  div{
      width:100px;
      height:100px;
      background-color:black;
      left:0;
      top:0;
      position:absolute;
      opacity:1;
  }
</style>
<body>
<div></div>
<script>
var div=document.querySelector('div');
animate(div,{
    width:200,
    left:500,
    opacity:20
});
 function animate(el,properties){
     clearInterval(el.timerId);
     el.timerId=setInterval(function(){
         for(var property in properties){
             var current;
             var target=properties[property];
             if(property==='opacity'){
                 current=Math.round(parseFloat(getstyle(el,'opacity'))*100);
             }else{
                 current=parseInt(getstyle(el,property));
             }
         var speed=(target-current)/30;
         speed=speed>0?Math.ceil(speed):Math.floor(speed);
           if(property==='opacity'){
               el.style.opacity=(current+speed)/100;
           }else{
           el.style[property]=current+speed+'px';
           }
     }
     },20)
 }
 function getstyle(el,property){
      if(getComputedStyle){
          return getComputedStyle(el)[property]
      }else{
          return el.currentStyle[property];
      }
  }
</script>
</body>
</html>

 

posted @ 2020-06-04 10:38  !ment  阅读(197)  评论(0编辑  收藏  举报