17th,八月,2010

YUI3中:checked/:disabled/:enabled浏览器支持测试

<!DOCTYPE html>
<html>
<head>
<meta  content=”text/html; charset=gbk”/>
<title>YUI3中:checked/:disabled/:enabled浏览器支持测试</title>
</head>
<body>
<ul id=[......]

继续阅读

6th,八月,2010

YUI event事件

YUI的Event包可以用来操纵DOM事件,也可以自定义事件。
1. 要使用Event,首先要引入YUI3的种子文件:
<script src=”http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js”></script>

然后加载相应模块:

YUI().use(‘event’, function(Y) {
});

2. 设[......]

继续阅读

22nd,六月,2010

jquery 基础总结

$(document).ready(function(){})
//相当于onload事件

jQuery对象与dom对象的转换
$(“#msg”).html();
$(“#msg”)[0].innerHTML;
$(“#msg”).eq(0)[0].innerHTML;
$(“#msg”).get(0).innerHTML;

如何获取jQuery集合的某一项
$(“div”).eq(2).ht[......]

继续阅读

11th,五月,2010

YUI3 Node.simulate()模拟鼠标事件

触发事件,类似于mootools的fireEvent()方法

YUI().use('node-event-simulate', function(Y) {
 Y.one("#test").simulate("click", { shiftKey: true });
});
15th,三月,2010

YUI3中Node好用的方法 substitute模版替换

从字符串直接创建结点

var str = ‘<div class=”item”><input type=”text” name=”user.name” value=”username” size=”20″/></div>’;
var node = Y.Node.create(str);

前面添加

Y.one(’body’).prepend(node);

后面添加[......]

继续阅读