随笔分类 - js简单特效
摘要:<style> * { margin: 0; padding: 0; } h1 { width: 700px; margin: 100px auto 10px; } div { width: 700px; min-height: 30px; margin: 0 auto; } #hd { width
阅读全文
摘要:<body> <table> <thead> <tr> <th>周天</th> <th>周一</th> <th>周二</th> <th>周三</th> <th>周四</th> <th>周五</th> <th>周六</th> </tr> </thead> <tbody id="tb"></tbody>
阅读全文
摘要:html代码: <div class="bar"> <div class="line"> <div class="dot"></div> </div> </div> //js: // 获取进度条 var bar = document.querySelector(".bar"); var line =
阅读全文
摘要:运用到的知识点:setInterval定时器;clearInterval清除定时器;offset系列中offsetLeft; 原理分析: 首先我们创建一个animate(obj,target)函数,这个函数用来封装我们的缓动效果,其中两个形参分别是要运动的对象元素obj和它的最终位置target;
阅读全文
摘要:首先先了解鼠标的三个事件: mousedown:鼠标按下时触发事件。 mousemove:鼠标移动时出发的事件。 mouseup:鼠标弹起时触发的事件。 原理: 通过鼠标按下触发事件获取鼠标在盒子中的位置,既鼠标坐标减去盒子的坐标得到鼠标在盒子中的坐标x,y;鼠标的坐标为e.pageX,e.page
阅读全文