摘要:
window.onscroll = function(){ var div2 = document.getElementById("div2"); var _top = document.body.scrollTop || document.documentElement.scrollTop; if 阅读全文
摘要:
window.onload = function(){ var fdiv = document.getElementById("filldiv"); var percent = document.getElementById("percent"); var timer = setInterval(f 阅读全文
摘要:
window.onload = function(){ var num = 5; var div = document.getElementById("ad"); var t = setInterval(function(){ if(num == 0) { clearInterval(t); div 阅读全文
摘要:
<!DOCTYPE html> <html lang=""> <head> <meta charset="utf-8"> <title></title> <style> * { margin: 0;padding: 0;} html,body { width: 100%;height: 100%;} 阅读全文
摘要:
var total = 3600; var t = setInterval(function(){ total--; if(total == 0){ clearInterval(t); return; } console.log( formatNumber(parseInt(total/60)) , 阅读全文
摘要:
setInterval(function(){ var now = new Date(); var hour = now.getHours(); var min = now.getMinutes(); var sec = now.getSeconds(); var n1 = parseInt(hou 阅读全文
摘要:
/** * draggbale 拖拽元素 * 1.0版本 * 使用方式: * draggable(ele, { * x : false, //表示水平方向是否可拖拽 * y : true, //表示垂直方向是否可拖拽 * limit : true, //表示活动范围是否限制在定位父元素内 * pad 阅读全文
摘要:
document.onmousemove = function(e){ e = e || event; box.style.left = e.clientX + "px"; box.style.top = e.clientY + "px"; } 阅读全文
摘要:
//event对象,只存在于事件函数中 //无法自己创建event对象,由浏览器生成,我们只管拿来用就可以 var btn = document.getElementsByTagName("button")[0]; document.onmousemove = function(evt){ //al 阅读全文
摘要:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.o 阅读全文