随笔分类 -  jquery

jquery
jquery弹簧式动画拓展
摘要:// 扩展过渡效果到 jQuery jQuery.extend(jQuery.easing,{ def : "easeOutQuad", swing : function(c, a, b, d, e) { return jQuery.easing[jQuery.easing.def](c, a, b, d, e) }, easeOutBounce: function(c, a, b, d, e) { return (a /= e) < 1 / 2.75 ? d * 7.5625 * a *... 阅读全文
posted @ 2013-01-20 13:12 刘卿 阅读(1380) 评论(0) 推荐(0)
jquery中each中的break何continue
摘要:在一个function里有一个each,在each里某种条件 成立的话,就把这个function返回true或者falsefunction methodone(){....$.each(array,function(){if(条件成立){return true;}});....}如果发现老是不对。后来查找资料才发现,在each代码块内不能使用break和continue,要实现break和cont... 阅读全文
posted @ 2010-06-10 10:05 刘卿 阅读(411) 评论(0) 推荐(0)
字符限制
摘要:我太长了吗,怎么变成省略号了? 阅读全文
posted @ 2008-12-12 14:38 刘卿 阅读(175) 评论(0) 推荐(0)
jQuery案例---用JavaScript编写
摘要:jquery-examples-代码 $(function(){ var $lis = $("#list ul li"); $lis.click(function(){ $(this).addClass("high").siblings().removeClass("high"); }) }) js-examples-代码 window.onload = functi... 阅读全文
posted @ 2008-11-22 23:28 刘卿 阅读(389) 评论(0) 推荐(0)
....
摘要:$(".page a:eq(1)").click(function(){ $(".pic img:eq(1)").animate({top:"0"},1000); $(".pic img:eq(0)").animate({top:"-168px"},1000); }); $(".page a:eq(0)").click(functio... 阅读全文
posted @ 2008-11-16 17:42 刘卿 阅读(165) 评论(0) 推荐(0)
盖章
摘要:昨天突然说要做盖章的效果,弄了一个,正在优化,大家多多指点 盖章认证 刘卿大师 阅读全文
posted @ 2008-11-06 16:08 刘卿 阅读(567) 评论(0) 推荐(0)
2个div底部对齐
摘要:$(document).ready(function(){ var h = $("#h1").height(); var top=$("#h1").height()-$("#test").height(); $("#test").css("top",top) }); 阅读全文
posted @ 2008-10-20 17:30 刘卿 阅读(1312) 评论(0) 推荐(0)
jquery判断checkbox是否被选中
摘要:鉴于经常有人被该贴误导,所以重新更新一下checkbox选中判断:jquery官网是这么写的:$( elem ).attr( "checked" ) (1.6) "checked" (String) Initial state of the checkbox; does not change$( elem ).attr( "checked" ) (1.6.1+) "checked" (String) Will change with checkbox state$( elem ).attr( "check 阅读全文
posted @ 2008-10-13 09:12 刘卿 阅读(52826) 评论(11) 推荐(2)
局底div
摘要:11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 这是一个局底广告条 阅读全文
posted @ 2008-10-07 11:42 刘卿 阅读(281) 评论(0) 推荐(0)
ie6下select覆盖div的解决办法
摘要:在IE6的环境下,如果网页上有div区块和select重叠在一起的时候,即使再怎么调整select的z-index,下拉选单还是会把div区块盖住(在ie7,Firefox是正常的),google了一下网路上的资料,大多是用iframe来解这个问题,但弄iframe写起来也是花时间而且不顺手。 有善心人士把这段程式码写成jQuery的plugin: bgiframe ,只要简单的呼叫plugin... 阅读全文
posted @ 2008-09-25 14:33 刘卿 阅读(1114) 评论(1) 推荐(0)
改进轮播
摘要: 阅读全文
posted @ 2008-09-22 16:48 刘卿 阅读(309) 评论(0) 推荐(0)
jquery浮层居中
摘要:$("#TipsWin").css("left",(($(document).width())/2-(parseInt(div宽度)/2))+"px"); 阅读全文
posted @ 2008-09-19 11:40 刘卿 阅读(2784) 评论(0) 推荐(0)
js和jquery对DOM的操作
摘要:1 , 创建元素节点 传统的javascript方法,创建元素节点 var a = document.createElement("p"); jQuery中创建节点的方法是: $(''); 和createElement()一样,创建出来的新元素节点不会被自动添加到文档里。 如果想把它添加到文档里,可以使用 jQuery中的 append()或者insertAfter()方法或者 before (... 阅读全文
posted @ 2008-09-18 13:18 刘卿 阅读(934) 评论(0) 推荐(0)
图片轮播
摘要:无标题文档 阅读全文
posted @ 2008-09-16 13:14 刘卿 阅读(573) 评论(0) 推荐(0)
jquery-title提示
摘要:hover 阅读全文
posted @ 2008-09-08 16:07 刘卿 阅读(2695) 评论(1) 推荐(0)
Jquery事件处理方法
摘要:Jquery已经为我们提供了各种事件处理方法,我们无需在html元素上直接写事件,而可以直接为通过jquery获取的对象添加事件。 如: $("#msg").click(function(){alert("good")})//为元素添加了单击事件 $("p").click(function(i){this.style.color=['#f00','#0f0','#00f'][i]}) ... 阅读全文
posted @ 2008-09-08 11:29 刘卿 阅读(876) 评论(0) 推荐(0)
jquery写的图片轮播效果
摘要:1 2 3 4 阅读全文
posted @ 2008-09-05 17:01 刘卿 阅读(2096) 评论(2) 推荐(0)
鼠标延迟导航
摘要:demo 图档上传测试区,可上传 3 张图 窗体在 Submit 前可使用: 1. isReady() 判断是否仍在传档 2. getFiles() 取得已上传的档名 阅读全文
posted @ 2008-09-05 13:10 刘卿 阅读(302) 评论(0) 推荐(0)
在补个删除的
摘要:jQuery Impromptu - Demo 1 Delete John Doe Delete Jane Doe ... 阅读全文
posted @ 2008-09-04 13:24 刘卿 阅读(160) 评论(0) 推荐(0)
修改信息列表
摘要:前段时间写了一个修改用户信息的js自我感觉不好,今天用jquery插件写了一个 很不错和大家分享下 jQuery Impromptu - Demo 1 Edit John 1234 Edit ... 阅读全文
posted @ 2008-09-04 13:22 刘卿 阅读(229) 评论(0) 推荐(0)