Chinaunix首页 | 论坛 | 博客
  • 博客访问: 410911
  • 博文数量: 155
  • 博客积分: 2590
  • 博客等级: 少校
  • 技术积分: 2161
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-25 09:33
文章分类

全部博文(155)

文章存档

2015年(1)

2014年(2)

2013年(55)

2012年(97)

分类: 系统运维

2013-01-08 11:18:36

var scopeList = '';
Js代码:  
  1.    var scope = scopeList.split("^");  
  2.    if (scope.length > 0) {  
  3.         for ( var i = 0; i < scope.length; i++)  {  
  4.                 if(scope[i]=='01'){                  
  5.                         $("#enName").removeAttr("style");          
  6.                 }else if(scope[i]=='02'){                  
  7.                         $("#enReAdress").removeAttr("style");  
  8.                 }else if(scope[i]=='03'){                  
  9.                         $("#enEconomicProperty").removeAttr("style");  
  10.                 }else if(scope[i]=='04'){  
  11.                         $("#enSupplyScope").removeAttr("style");          
  12.                 }  
  13.       }  
  14.  }  
  15.  if((typeof($("#enName").attr("style"))!="undefined")&&(typeof($("#enReAdress").attr("style"))!="undefined")&&(typeof($("#enEconomicProperty").attr("style"))!="undefined")&&(typeof($("#enSupplyScope").attr("style"))!="undefined")) {  
  16.               $("#message").removeAttr("style");  
  17. }  

上面是源码,这段代码的功能是查看变更范围scopt内有没有值,默认所有内容都是隐藏的,如何scopt有值的话就删除掉其相应的style属性(这个属性包含了隐藏)。如果没有变更,也就是scope为空,就显示message里面的内容。主要代码已经用红色字符标记出来了。本来想用jquery来写,只可惜不会,只能用这种方法。

源文来自站长网

阅读(1317) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~