六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 177|回复: 0

过滤表格内容

[复制链接]

升级  54.67%

32

主题

32

主题

32

主题

秀才

Rank: 2

积分
132
 楼主| 发表于 2013-2-8 00:30:45 | 显示全部楼层 |阅读模式
.filter
<input id="filterName" />$(function(){       $("#filterName").keyup(function(){          $("table tbody tr")                    .hide()                    .filter(":contains('"+( $(this).val() )+"') ")                    .show();       }).keyup();})

放大、缩小字体
初始化
<div class="msg"><div class="msg_caption"><span class="bigger" >放大</span><span class="smaller" >缩小</span></div><div>。。。</div></div>

jq处理
$(function(){$("span").click(function(){var thisEle = $("#para").css("font-size"); var textFontSize = parseFloat(thisEle , 10);var unit = thisEle.slice(-2); //获取单位var cName = $(this).attr("class");if(cName == "bigger"){   if( textFontSize <= 22 ){textFontSize += 2;}}else if(cName == "smaller"){   if( textFontSize >= 12  ){textFontSize -= 2;}}$("#para").css("font-size",  textFontSize + unit);});});
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表