当前位置: 代码迷 >> Web前端 >> 过滤报表内容
  详细解决方案

过滤报表内容

热度:33   发布时间:2012-10-30 16:13:36.0
过滤表格内容
.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);
		});
	});




  相关解决方案