12 2011 档案

摘要:<!DOCTYPE HTML><html><head><title>soul42</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312" ><STYLE type="text/css"> * { margin:0; padding:0;} body{width:100%;height:100%;} #list{width:500px;float:left;po 阅读全文
posted @ 2011-12-28 23:01 深蓝色梦想 阅读(320) 评论(0) 推荐(0) 编辑
摘要:<!doctype html><html> <head> <style> .box{background:red;padding:5px 0;height:25px} #pop{height:100px;width:400px;background:orange} </style> </head> <body id="body"> <div id="box" class="box"> <a href="">目 阅读全文
posted @ 2011-12-27 13:49 深蓝色梦想 阅读(189) 评论(0) 推荐(0) 编辑
摘要:<!doctype html><html> <head> <style type="text/css"> *{margin:0;padding:0;} ul{list-style:none;display:none} ul ul{list-style:none;position:absolute;left:100px;top:0;display:none} .menu{float:left;width:100px;margin-right:15px} li{widt... 阅读全文
posted @ 2011-12-27 13:46 深蓝色梦想 阅读(231) 评论(0) 推荐(0) 编辑
摘要:讲解之前先来讲讲性能.如果一个整体页面里有大量的按钮.我们就要为每一个按钮绑定事件处理程序.这样就会影响性能了.首先每个函数都是对象,对象就会占用很多内存.内存中的对象越多,性能就越差.其次,dom访问次数增多,就会导致延迟加载页面.事实上,从如何来利用好事件处理程序,还是有很好的解决方案的.一、事件委托对事件处理程序过多的问题解决的方案就是事件委托技术.事件委托技术利用了事件冒泡.只需指定一个事件处理程序.我们可以为某个需要触发事件的父元素来绑定事件处理程序.HTML代码:<ul id="mylist"> <li id="li_1"& 阅读全文
posted @ 2011-12-10 00:20 深蓝色梦想 阅读(1786) 评论(6) 推荐(1) 编辑