Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1261552
  • 博文数量: 315
  • 博客积分: 10397
  • 博客等级: 上将
  • 技术积分: 3731
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 21:21
文章分类

全部博文(315)

文章存档

2015年(10)

2014年(3)

2013年(2)

2012年(8)

2011年(8)

2010年(29)

2009年(59)

2008年(77)

2007年(119)

分类: 系统运维

2007-10-27 06:59:27

Ext真是一个眩目的js类库,功能暂且不说,光是它的特效,就看的让人流口水,闲话少说,开始学习
1、调用Ext时,必须有OnReady函数,一切从此开始,获取页面元素有两种方法,一是该元素的id,二是针对所有该标签的元素产生作用及DOM节点  Ext.element很是重要。
Ext.onReady(function() {
 // Note: For the purposes of following along with the tutorial, all
 // new code should be placed inside this method.
 
 //alert("Congratulations!  You have Ext configured correctly!");
 var myDiv = Ext.get('myDiv');
 myDiv.highlight();      //黄色高亮显示然后渐退
 myDiv.addClass('red');  // 添加自定义CSS类 (在ExtStart.css定义)
 myDiv.center();         //在视图中将元素居中
 myDiv.setOpacity(.25);  // 使元素半透明
 Ext.get('myButton').on('click', function(){
  alert("You clicked the button");
 });
 var paragraphClicked = function() {
  alert("You clicked a paragraph");
 }
 Ext.select('p').on('click', paragraphClicked);
 
});
阅读(848) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~