jQuery 效果 - animate() 方法
原文地址:http://www.w3school.com.cn/jquery/effect_animate.asp 经过实际检验,这个style的值,比如“height”貌似不能为百分比,最好是px 例如: [pcsh lang=”js” tab_size=”4” message=”” hl_lines=”” provider=”manual”] $("#shadow1").animate({height:"300px"},"slow"); // 可以通过 $("#shadow1").animate({height:"100%"},"slow"); // 不可以通过 [/pcsh] 实例 改变 "div" 元素的高度: $(".btn1").click(function(){ $("#box").animate({height:"300px"}); }); $(selector).animate(styles,spe...
jQuery 遍历 - eq() 方法
通过为 index 为 2 的 div 添加适当的类,将其变为蓝色: $("body").find("div").eq(2).addClass("blue"); 定义和用法 eq() 方法将匹配元素集缩减值指定 index 上的一个。 语法 .eq(index) 参数 描述 index 整数,指示元素的位置(最小为 0)。 如果是负数,则从集合中的最后一个元素往回计数。
jQuery -eq() 选择器
实例 选择第二个 <p> 元素: $("p:eq(1)")
jQuery 同胞 遍历
原文地址:http://www.w3school.com.cn/jquery/jquery_traversing_siblings.asp 同胞拥有相同的父元素。 siblings() next() nextAll() nextUntil() prev() prevAll() prevUntil()
mysql怎么使用if...else...来查询
http://blog.chinaunix.net/uid-20837107-id-2413233.html IFNULL(expr1,expr2)如果expr1不是NULL,IFNULL()返回expr1,否则它返回expr2。IFNULL()返回一个数字或字符串值,取决于它被使用的上下文环境。mysql>; select IFNULL(1,0);->; 1mysql>; select IFNULL(0,10);->; 0mysql>; select IFNULL(1/0,10);->; 10mysql>; select IFNULL(1/0,’yes’);->; ‘yes’ IF(expr1,expr2,expr3)如果expr1是TRUE(expr1<>;0且expr1<>;NULL),那么IF()返回expr2,否则它返回expr3。IF()返回一个数字或字符串值,取决于它被使用的上下文。mysql>; select IF(1>;2,2,3);->; 3mysql...
mysql Having与Where的区别
where 子句的作用是在对查询结果进行分组前,将不符合where条件的行去掉,即在分组之前过滤数据,where条件中不能包含聚组函数,使用where条件过滤出特定的行。 having 子句的作用是筛选满足条件的组,即在分组之后过滤数据,条件中经常包含聚组函数,使用having 条件过滤出特定的组,也可以使用多个分组标准进行分组。 示例: [pcsh lang=”sql” tab_size=”4” message=”” hl_lines=”” provider=”manual”] SELECT Customer,SUM(OrderPrice) FROM Orders GROUP BY Customer HAVING SUM(OrderPrice)<2000 [/pcsh] Customer字段可能有多个相同的人,分组后算出每个OrderPrice订单价格的总价 http://www.cnblogs.com/rainman/archive/2013/05/01/3053703.html
MySQL语句优先显示某些符合条件的记录
select * from tb order by case 所在城市 when '合肥' then 1 when '上海' then 2 when '' then 3 when '南京' then 4 end 数值越小越靠前
mysql合并两个select查询结果union
用union select * from table1unionselect * from table2
mysql 查出最大值和最小值
select min(pcount) select max(pcount)
为mysql数据库建立索引
前些时候,一位颇高级的程序员居然问我什么叫做索引,令我感到十分的惊奇,我想这绝不会是沧海一粟,因为有成千上万的开发者(可能大部分是使用MySQL的)都没有受过有关数据库的正规培训,尽管他们都为客户做过一些开发,但却对如何为数据库建立适当的索引所知较少,因此我起了写一篇相关文章的念头。 最普通的情况,是为出现在where子句的字段建一个索引。为方便讲述,我们先建立一个如下的表。 [pcsh lang=”php” tab_size=”4” message=”” hl_lines=”” provider=”manual”] CREATE TABLE mytable ( id serial primary key, category_id int not null default 0, user_id int not null default 0, adddate int not null default 0 ); [/pcsh] 很简单吧,不过对于要说明这个问题,已经足够了。如果你在查询时常用类似以下的语句: SELE...