随笔分类 -  div+css

完美拖拽+拖动改变Div的宽高+关闭按钮[带演示](转)
摘要:演示地址:http://www.corange.cn/demo/3767/index.html<!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.org/1999/xhtml"> <head> <meta http-equiv="Conten 阅读全文
posted @ 2012-04-12 17:23 slc 阅读(534) 评论(0) 推荐(0)
鼠标点击div区域之外的地方后隐藏div(转)
摘要:用div做了一个code选择器,但div打开之后我想实现点击其他区域就可以自动隐藏的效果,最后解决方法:第一步:在js中定义一个变量用来保存鼠标是否在div中这个状态:var isOut=true;(默认不再区域中)第二步:在div中加上onmouseover和onmouseout事件,用来控制变量isOut:<div id="codediv" onmouseover="isOut=false" onmouseoout="isOut=true"/>第三步:在显示div的事件中加入取消事件冒泡的语句:(因为这个事件也会触发d 阅读全文
posted @ 2012-03-15 15:28 slc 阅读(1658) 评论(0) 推荐(0)