摘要: (每一段jQuery对应一段html代码,以标记为准则,css为共用代码,每段代码需独立运行。html和css代码在文章尾部,如下例) 、分别为按钮添加事件(c1)$(document).ready(function () { $('.bold').bind('click', function () { alert("你点击了Bold按钮"); }); $('.italic').bind('click', function () { alert("你点击了Italic按钮"); })});事 阅读全文
posted @ 2012-02-26 22:05 Ghost Soar 阅读(387) 评论(0) 推荐(0) 编辑
摘要: (每一段jQuery对应一段html代码,以标记为准则,css为共用代码,每段代码需独立运行。html和css代码在文章尾部,如下例) 数组的处理eg1$(document).ready(function () { var num = ["盖茨","乔布斯","马克","苏国强"]; $('p').text(num.join(","));});eg2$(document).ready(function () { var num = ["盖茨", "乔 阅读全文
posted @ 2012-02-26 21:44 Ghost Soar 阅读(3534) 评论(0) 推荐(1) 编辑
摘要: 制作多级菜单(l1)show(),hide()js代码$(function () { $("li:has(ul)").click(function (e) { if (this == e.target) { if ($(this).children().is(":hidden")) { $(this).css("list-style-image", "url(Img/minus.gif)").children().show(); } else { $... 阅读全文
posted @ 2012-02-26 21:16 Ghost Soar 阅读(383) 评论(0) 推荐(0) 编辑
摘要: (每一段jQuery对应一段html代码,以标记为准则,css为共用代码,每段代码需独立运行。html和css代码在文章尾部,如下例) each()遍历元素(k1)$(document).ready(function () { $("#btn").html("each()遍历元素").click(function (event) { $("div").each(function (index) { $(this).html("这是第" + index + "个div"); }); event.p 阅读全文
posted @ 2012-02-26 21:02 Ghost Soar 阅读(557) 评论(0) 推荐(0) 编辑
摘要: (每一段jQuery对应一段html代码,以标记为准则,css为共用代码,每段代码需独立运行。html和css代码在文章尾部,如下例) /*jQuery支持的CSS3最基本的选择器*^EEFE>FE+FE~FE:has(F)E.CE#IE[A]E[A=V]E[A^=V]E[A$=V]E[A*=V]*/属性选择器(j1)“[]”例子1$(document).ready(function () { $("a[title]").addClass("myClass");})例子2 加属性值判断$(document).ready(function () { 阅读全文
posted @ 2012-02-26 17:37 Ghost Soar 阅读(379) 评论(0) 推荐(1) 编辑
摘要: /*针对表格常用的DOM操作针对<table>元素captiontBodiestFoottHeadrowsdeleteRow(position)insertRow(position)creatCaption()deleteCaption()针对<tbody>元素rowsdeleteCell(position)insertCell(position)针对<tr>元素cellsdeleteCell(position)insertCell(position)*//*添加行(g1)在第i行插入一行insertRow(i); 单元格插入新数据insertCell(i) 阅读全文
posted @ 2012-02-26 16:37 Ghost Soar 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 增加监听函数(f1)方法一window.onload = function () { var myP = document.getElementById("myP"); myP.onclick = function () { alert("我被点击了"); }}方法二 添加处理函数attachEvent("onclick", fnClick),删除处理函数detachEvent("onclick", fnClick)var myP;function fnClick() { alert("我被点击了&quo 阅读全文
posted @ 2012-02-26 16:16 Ghost Soar 阅读(319) 评论(0) 推荐(0) 编辑
摘要: getElementById() (e1)function myPhone() { var myItem = document.getElementById("myphone"); alert(myItem.tagName + " " + myItem.childNodes[0].nodeValue);}getElementsByTagName("ul") (e1)function myPhone() { var myItem = document.getElementsByTagName("ul"); alert 阅读全文
posted @ 2012-02-26 16:05 Ghost Soar 阅读(286) 评论(0) 推荐(0) 编辑
摘要: x命名空间中的Attributex:Classx:ClassModifierx:Name 可申明变量<TextBox x:Name="txt_Name" Width="100" Margin="5" />后台代码可直接调用x:FiledModifier 设置访问级别,默认值是interal(只能在程序集访问);值public可跨程序集访问x:Key 作用是为资源贴上用于检索的索引,资源集合,设置重复使用的内容,类似CSSxaml代码<Window.Resources> <sys:String x:Key= 阅读全文
posted @ 2012-02-26 15:46 Ghost Soar 阅读(876) 评论(0) 推荐(0) 编辑