Yahoo! UI Library 的介绍

1,Yahoo! UI Library 的介绍

1.1 简介

Yahoo! User Interface Library(简称yui) 是一个使用Javascrīpt编写的工具和控件库。它利用DOM脚本,DHTML和AJAX来构造具有丰富交互功能的Web程序。yui也包含几个核心的CSS文件。yui中的所有组件已经以开源的形式发布,它们遵循BSD协议并且可以免费使用。可以从Sourceforge站点下载完整的项目文件,同时包含相关文档和示例。

yui项目开发人员的BLOG:YUI Blog,交流社区:ydn-javascrīpt on Yahoo! Groups。

准备工作:

1、 下载yui

yui项目文件已经发布在Sourceforge站点,文件包含相关文档,示例和代码。

注:Yahoo没有为yui的运行提供免费的运行环境,你需要运行在你在即Web服务器上。

2、 在你的网页中加入你需要的类库文件

为了使用yui中的组件你必须在你的页面文件中用<scrīpt>指定相关组件的类库文件地址。如果该组件依赖于其他组件,你必须使用<scrīpt>指定所依赖的组件的类库文件地址。

3、 如果有必要,在页面中加入CSS文件

某些yui的控件包含一个相应的CSS文件,用来设定控件的样式。此时,你必须在页面中使用<style>指定相应的CSS文件的地址。你可以通过修改相应的CSS文件达到你想要的效果。

4、 浏览相关文档和示例

每一个组件都包含详细的API文档,并且提供了常用的例子。学习完后,回顾一下所有的API,做到心中有数。因为对于API理解的好坏将影响你对yui的使用效果。

1.2 组件介绍

Yui组件分成2类:工具包和控件库

Yui 工具包

Yui 工具包利用DOM脚本来简化浏览器内的开发(in-browser devolvement),使用DHTML和AJAX的特性开发所有的Web程序。

动画(Animation):在你的页面中通过指定位置,大小,透明度或者页面元素的其他特性来创建一个"电影效果(cinematic effects)"。这些效果将在你的页面发生变化的时候给用户更好的体验。

连接管理(Connection Manager):这个工具包帮助你管理XMLHttpRequest(一般被称为AJAX)事务,它提供对表单提交(form posts),错误捕获(error handling)和callbacks的全面支持。该工具包也支持文件的上传管理。

DOM:DOM工具包提供更简单的DOM脚本的功能调用方式,包含元素的位置和CSS样式的管理。

拖放(Drag and Drop):创建可拖放的对象。为了提供丰富的交互功能(比如拖动一个对象到目标位置)你可能需要编写很多代码。这个工具包可以在所有支持的浏览器中捕获所有的操作事务并保证其稳定地运行。

事件(Event):这个神奇的管理类库给你提供一种简单安全的方法访问浏览器的事件(比如点击和键盘操作)。这个事件封包中还包含了自定义事件对象,它为你的程序交互提供一种发布和订阅事件的机制。

yui控件:

yui控件库为你页面提供一组高交互性性的可视化元素。这些元素完全在客户端创建维护,不需要请求服务器进行页面刷新。

这些控件包括:

自动完成(AutoComplete)控件:自动完成控件为文本输入提供一种渐进式的用户体验(streamline user interactions)。控件会提供相似项列表和基于多样化的数据格式的提前键入功能(type-ahead functionality based on a variety of data-source formats),并且可以通过XMLHttpRequest访问服务端的数据。

日历(Calendar)控件:一个用来日期选择的动态图形控件。

容器(Container)控件:一组模仿windows样式的控件,他们包括Tooltip, Panel, Dialog 和 SimpleDialog。其中Module 和 Overlay控件提供一个可扩展的平台,你可以控制自定义的模仿windows样式的控件。

日志(Logger)控件:提供一个快速和简单的记录日志的方式,它直接将日志信息输出到屏幕控制台(on-screen console)、Firefox的扩展组件FireBug,或者Safari的Javascrīpt控制台。yui的Debug组件将完整的记录输出信息和调试信息。

菜单(Menu)控件:利用此控件只需要几行简单的代码就可以设计一个动态样式的菜单。可以完全使用javascrīpt构造一个菜单,can be layered on top of semantic unordered lists。

滑块(Slider)控件:提供一个可滑动的组件,它允许使用者在一定的范围内(x轴,y轴)改变滑块的位置。

树形(TreeView)控件:提供一个节点可缩放的树形控件。节点可以是链接,自定义属性,并且可以动态加载。节点元素的展现可以通过CSS修改,比如文件夹视图,TO-DO任务列表或者其他可视化处理

第三章 yui的CSS资源

为了让CSS能符合不同等级的浏览器(A-Grade browsers)的标准,我们想了很多。我们把这些作为yui类库的一部分共享出来,希望能在这里得到促进,获得一个简洁的,可维护并在浏览器中表现优秀的设计。

页面网格样式(CSS Page Grids):7个基本的用css组织子组件的页面框架,支持130种不通的页面布局。

标准的CSS字体(Standard CSS Fonts):标准的跨浏览器字体样式和大小展现。

标准的CSS排列(Standard CSS Reset):使用这些CSS声明来排除页面的空白部分并且公共元素的样式兼容各种浏览器的展现。

YUI version 0.12.0 更新,增加了 TabView控件,以及API的文档以及所有例子也都做了调整

YUI version 0.12.0: TabView Control, Improved API Documentation, and More
November 13, 2006 at 6:35 pm by Eric Miraglia | In Development | 16 Comments
Today we released version 0.12 of the YUI Library. Here are the highlights:

The TabView Control: Written by YUI Animation and Dom author Matt Sweeney, this dynamic tab solution is the newest YUI addition and features robust support both for progressive enhancement and for high-gloss richness. Check out Matt's roster of TabView examples for an idea of what the new control can do; view source on the examples to see how they're implemented.
Improved Documentation: YUI developer Adam Moore (Event, Drag & Drop, Slider, TreeView) has created a new tool for generating API documentation, allowing us to generate unified, crosslinked API docs with an integral AutoComplete-powered search control. The new API documents provide developers with a clearer picture of class structures and provide separate categorization for properties and configuration options. You may never go back to Cheat Sheets again...
...But in Case You Still Like Cheat Sheets: Cheat Sheets are updated for version 0.12 and include new sheets for TabView and for Nate Koechley's CSS Reset, Fonts and Grids foundation. You can download all the YUI Cheat Sheets from the YUI Library website.
Speaking of CSS Grids: Nate has rev'd the Grids package with baked-in support for 750px, 950px, and full-viewport ("liquid") layouts. Grids 0.12 triples the number of supported layouts and still weights in under 3KB before gzipping. We've built the YUI website on the Reset/Fonts/Grids foundation now and we're making use use of the new full-viewport support.
Improvements Throughout the Library: There are enhancements to be found throughout the library, from Event's new onContentReady method to a significantly improved Calendar Control with a simplified interface for creating multi-month calendar displays (if you're upgrading from a previous version of Calendar, check out the step-by-step upgrade guide). For a full list of changes, see the release notes documentation that accompanies the distribution.
We'll follow up with more information on some of these topics later in the week. For now, please make your way to SourceForge to download the latest YUI distribution; see the release notes in the distribution for a full manifest of changes throughout the library. As always, the YUI site on the Yahoo! Developer Network has all the latest documentation.

posted on 2006-12-21 16:12 PeterChan 阅读(391) 评论(0)   编辑   收藏 所属分类: Ajax

 

<script type="text/javascript"> </script>

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值