under java script- 学习笔记
2009-06-16 am
Event对象关联了所有事件,以提供有关事件的信息,但是对Eevent对象的访问各浏览器却存在着差异.
先来看一个Demo:
<!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="Content-Type" content="text/html; charset=gb2312" />
<title>Event对象支持</title>
</head>
<body >
<div id="face" style="position:absolute;width:18px;height:18px;background-color:#0CC;">
</div>
<div id="info"></div>
<script>
document.getElementById(‘face’).style.position=’absolute’;
function getPos(){
var posx=event.clientX;
var posy=event.clientY;
var str="<p>("+posx+","+posy+")</p>";
document.getElementById(‘info’).innerHTML=str;
document.getElementById(‘face’).style.left=posx+’px’;
document.getElementById(‘face’).style.top=posy+’px’;
}
document.onmousemove=getPos;
</script>
</body>
</html>
Tips:You can change the code before run.
在IE中可以正常的运行,如果您是在FF中运行其代码会出现event is not defined的错误提示.在IE中会把event附加成window对象的一个属性,在作为事件处理的一部分访问时会相应填写Event对象所含的数据.
对于基于Netscape的浏览器,是需要作为函数的一个参数传入.
function getPos(evnt){
[...]
Continue to Read
under 那些事
2009-06-9 pm
原文:http://www.smashingmagazine.com/2009/01/14/web-design-trends-for-2009
1. 凸版印刷
在过去几个月的观察中,最出人意料的趋势,是凸版印刷样式(实际上压上去的字)出现在网页设计中。可能这种趋势产生的最重要的原因是因为,这种印刷 术到现 今已经很少被使用了。凸版印刷以各式各样的风格被用在网站和主题上;尤其是,已经被频繁使用于产品设计和网站的在线服务中。
Continue to Read
under 那些事
2009-06-2 pm
twitter, flickr ,skydrive,bing,live,hotmail今天均不能访问了,而MS停用live.com域名颇及到刚刚上线的BING了实在让人匪夷所思,twitter, flickr也被河蟹.OMG,大中华局域网终于建设完成.
Continue to Read
under 学习笔记
2009-05-15 pm
Yahoo!网站性能最佳体验的34条黄金守则,1、尽量减少HTTP请求次数…
Tags:体验
Continue to Read
under 那些事
2009-04-28 pm
MSDN Library for Visual Studio 2008 SP1 (2008 年 12 月版)
稀里糊涂的装上了2005版的MSDN,今天无意在官方找到了最近版的,做个标记!
Tags:down
Continue to Read
under 那些事
2009-04-4 pm
Google PageRank,似乎最近更新了.blog最近很少更新,降值到了2,朋友的blog降到了0位 变的太突然了
Continue to Read
under 那些事
2009-03-12 pm
还是没有标题吧……
[Audio clip: view full post to listen]
月光海洋
无意中在路上听到
[Audio clip: view full post to listen]
占有
同学推荐,到底是怎样的心情?似乎看到了发生在那个夏天的故事.
[Audio clip: view full post to listen]
第七封信 七封寄不出去的情书 一首未完成的歌 情书
《海角七号》一首未完成的歌
[Audio clip: view full post to listen]
梁静茹 第三者
有段时间一直在听
Continue to Read
under java script- 学习笔记
2009-02-19 pm
刚刚做一个例子,想要用getAttribute()方法获取对象的class属性.本来习惯在FF中测试,使用getAttribute(“className”)却总是无法获得结果,后来在ie中测试可得到结果.原来在FF中可识别getAttribute(“class”)在IE下识别getAttribute(“className”).找了个兼容办法:if (obj.getAttribute(”className”)== “class名字”||obj.getAttribute(”class”) == “class名字”)
Continue to Read