摘要: 1.eq(index)2.filter(expr)3.filter(function)4.hasClass(class)5.is(expr)6.has(expr)7.map(callback)8.not(expr)9.slice(start [,end]) 不包括end实例和效果如下: 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type&quo 阅读全文
posted @ 2012-07-09 16:58 lihui_yy 阅读(1742) 评论(0) 推荐(0) 编辑
摘要: 1.andSelf() 新增自身对象到当前的jQuery对象里,通常用法:$('li.third-item').nextAll().andSelf() .css('background-color', 'red'); 2.end() 返回到上一次jQuery对象, 通常用于链式操作里:$('ul.first').find('.foo').css('background-color', 'red').end().find('.bar').css('backgro 阅读全文
posted @ 2012-07-09 15:30 lihui_yy 阅读(1030) 评论(0) 推荐(0) 编辑
摘要: jQuery 对页面元素的搜索包括 父元素、同辈元素、子元素 的搜索。1.父元素搜索(1)parents([selector]) 方法$("p").parents().css("border","1px solid #999"); //给p元素的父元素添加边框样式$("p").parents("div").css(...); //给p元素的父元素中的div元素添加样式(2)closest(selector[,context]) 方法$("p").closest("d 阅读全文
posted @ 2012-07-09 13:26 lihui_yy 阅读(10589) 评论(0) 推荐(0) 编辑
摘要: jQuery过滤选择器包括 简单过滤选择器、内容过滤选择器、属性过滤选择器、子元素过滤选择器、表单域属性过滤选择器、可见性过滤选择器。1.简单过滤选择器 (1):first 选择器。选择第一个匹配元素。 $("td:first").css("border","2px solid blue"); (2):last 选择器。选择最后一个匹配元素。 $("td:last").css("border","2px solid blue"); (3):odd 选择器。选择所有基数元素。 阅读全文
posted @ 2012-07-05 19:28 lihui_yy 阅读(1560) 评论(0) 推荐(0) 编辑
摘要: jQuery基本选择器包括 CSS选择器、层级选择器和、表单域选择器。1.CSS选择器(1)标签选择器 $("div") $("p") $("table") 等一系列 HTML 标签(2)ID选择器 <input id="user" type="text"> 获取该标记的值:$("#user").val();(3)类选择器 <input type="text" class="t"> 给该文本框添加样式:$(&qu 阅读全文
posted @ 2012-07-05 14:14 lihui_yy 阅读(6798) 评论(0) 推荐(0) 编辑
摘要: 1.页面元素边框的属性属性说明boder设置边框样式的复合属性border-color设置边框的颜色值border-style设置边框的样式,包括none(无边框),dotted(点划线),dashed(虚线),solid(实线),double(双线),groove(槽状),ridge(脊状),inset(凹陷),outset(凸出)border-width设置边框宽度border-top, border-right, border-bottom, border-left分别设置上、右、下和左边框的复合属性border-top-color, border-right-color, border 阅读全文
posted @ 2012-07-04 15:26 lihui_yy 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 1.DOM 的4个基本接口 Document Node NodeList NamedNodeMap2.DOM 基本对象 (1)Document 对象 (2)Node 对象 nodeType 属性返回节点的类型:Element(1)、Attr(2)、Text(3)、Comment(8)、Document(9)、DocumentFragment(11) (3)NodeList 对象 (4)Elment 对象 (5)Attr 对象3.判断文本是否空格的方法: if(node.nodeType == 3 && !/\s/.test(node.nodeValue)){...... 阅读全文
posted @ 2012-07-03 21:25 lihui_yy 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 1.变量的类型 3种 x = 19.2; //数字型 y = "name"; //字符串型 m = true; //布尔型2.数据的类型 4种基本数据类型、2种复合数据类型 基本数据类型:数值型、字符串型、布尔型、空值null 复合数据类型:对象、数组。(表示基础数据类型的集合)3.运算符 其中的字符串运算符(+),用于连接字符串。 注意:JavaScript为弱类型语言,在不同类型之间的变量进行运算时,会优先考虑字符串类型。如,8+"8"的执行结果为884.try catch finally 语句 try{ }catch(msg){ alert(msg 阅读全文
posted @ 2012-07-03 14:22 lihui_yy 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 这几天按照书上的案例对bbs的搭建多少学了点儿东西。其他的倒是没有什么,书上的编程规习惯很好,值得学习,类的划分和接口的定义对功能扩展提供了很大的方便。在程序中,用到了验证拦截器 AuthenticationInterceptor 。具体代码如下: 1 import java.util.Map; 2 3 import org.model.User; 4 5 import com.opensymphony.xwork2.Action; 6 import com.opensymphony.xwork2.ActionInvocation; 7 import com.opensymphony.xw.. 阅读全文
posted @ 2012-06-05 10:03 lihui_yy 阅读(1926) 评论(0) 推荐(0) 编辑
摘要: 最近一直在看一个工程例子,遇到一个问题就是在 jsp 文件中,通常会在 <s:form>标签中使用<s:submit>,而二者均有 action 属性,今天貌似明白了两个之间的区别,但是不知道理解的对不对,若有高手路过还请多指教~~例如,在struts.xml文件中设置了几个action如下:1 <action name="UserLogin" class="org.web.user.UserLoginAction">2 <result name="success" type="re 阅读全文
posted @ 2012-06-04 12:53 lihui_yy 阅读(9736) 评论(0) 推荐(0) 编辑