diff --git a/WebRoot/js/onmouse.js b/WebRoot/js/onmouse.js index 5b7b498..155f322 100644 --- a/WebRoot/js/onmouse.js +++ b/WebRoot/js/onmouse.js @@ -1,598 +1,604 @@ -var highlightcolor='#8D94A5'; -//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行, -var clickcolor='#8D94A5'; -function changeto(){ - //source=event.srcElement; - //if (source.tagName=="TR"||source.tagName=="TABLE") return; - //while(source.tagName!="TD") - // source=source.parentElement; - //source=source.parentElement; - //cs = source.children; - //alert(cs.length); - //if (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor) - //for(i=0;i 0){ - if(how == "edit") - return selectedCount > 1 ? false : true; - else if(how == 'remove') - return true; - else if(how == 'exportXls') - return true; - }else{ - return false; - } -} -//判断是否进行提交操作 -function isOperation(checkName,flagValue){ - var yxbzValue ; - var yxbz; - var flag = false; - var checks = document.getElementsByTagName("input"); - for(i = 0 ; i <= checks.length ; i++ ){ - if(checks[i]){ - if(checks[i].name == checkName){ - if(checks[i].checked) - { - yxbz='yxbz'+checks[i].value; - yxbzValue = document.getElementById(yxbz).value; - if(yxbzValue==flagValue){ - flag=true; - } - } - } - } - } - return flag; -} - -//判断是否进行提交操作 -function isGroup(checkName){ - var yxbzValue ; - var yxbz; - var flag = false; - var checks = document.getElementsByTagName("input"); - for(i = 0 ; i <= checks.length ; i++ ){ - if(checks[i]){ - if(checks[i].name == checkName){ - if(checks[i].checked) - { - yxbz='group'+checks[i].value; - yxbzValue = document.getElementById(yxbz).value; - //alert(yxbzValue); - if(yxbzValue!=null&&yxbzValue!=''){ - flag = true; - } - } - } - } - } - //alert(flag); - return flag; -} - - -function $id(tid,type,show){// id 类型 alter的消息 - //2013-1-30 hyx add ---start - if(document.getElementById(tid)==null) { - return true; - } - //2013-1-30 hyx add ---end - if(type != 'ip1'){ - $("#"+tid).next().html('*'); - }else{ - $("#"+tid).next().html(''); - } - - var name=document.getElementById(tid).value; - if($.trim(name)==''&& type=="xz"){ - $("#"+tid).next().html('请选择'+show); - return false; - } - - if($.trim(name)==''&& type!="remark"){ - $("#"+tid).next().html('请输入'+show); - return false; - } - - if(type=='sz'){ - if(name.replace(/[\d+]/ig,"").length>0){ - //alert(show+'请输入数字') - $("#"+tid).next().html(show+'请输入数字'); - return false; - } - } - - if(type=='port'){ - if(name.replace(/[\d+]/ig,"").length>0){ - //alert(show+'请输入数字') - $("#"+tid).next().html(show+'请输入数字'); - return false; - } - if(name<0){ - //alert(show+'不能小于零') - $("#"+tid).next().html(show+'不能小于零'); - return false; - } - if(name>65535){ - //alert(show+'不能大于65535') - $("#"+tid).next().html(show+'不能大于65535'); - return false; - } - } - - if(type=='ip'|| type=='ip1'){ - var arr=name.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/); - if(arr==null){ - //alert("输入"+show+"不符合要求"); - $("#"+tid).next().html('输入'+show+'不符合要求'); - return false; - } - for(i=1;i255){ - //alert("输入"+show+"不符合要求"); - $("#"+tid).next().html('输入'+show+'不符合要求'); - return false; - } - } - } - - if(type=='remark'){ - if(name.length>500){ - //alert(show+'不能大于五百个字符') - $("#"+tid).next().html(show+'不能大于五百个字符'); - return false; - } - } - -// if(name.length>0){ -// $("#"+tid).val(name); -// } - return true; -} - function fixTableHeader(gv,scrollHeight) - { - //var gvn=$(gv).clone(true).removeAttr("id"); - var gvn = $(gv). - $(gvn).find("tr:not(:first)").remove(); - $(gv).before(gvn); - $(gv).find("tr:first").remove(); - $(gv).wrap("
"); - } - - (function($){ - //内部变量 - var tableId,windowId; - var iWindowObjs = new Array(); //iframe的窗口数组 - var iWinOffset = new Array(); //窗口的 - //属性 - var defaults ={ - 'lockFlag': true, // 是否实现表头浮动标识 true 实现 ;flase 不实现 默认 实现 - 'resize' : true, // 窗口大小变化时 同步表头浮动 默认实现 - 'minRows' : 1, // 表头行数 默认 1行 - 'headerDiv' : 'clone_header_div', // 存放表头的div - 'cloneHeader' : 'clone_header' // 克隆表头 - }; - //初始化参数 - $.fn.initHeader = function(winId,lockFlag,resize,minRows,headerDiv,cloneHeader){ - tableId = $(this).attr("id"); //列表ID - windowId = winId; //窗口ID - defaults.lockFlag = ( lockFlag != null && lockFlag != '' ? lockFlag : defaults.lockFlag ); - defaults.resize = ( resize != null && resize != '' ? resize : defaults.resize ); - defaults.minRows = ( minRows != null && minRows != '' ? minRows : defaults.minRows ); - defaults.headerDiv = ( headerDiv != null && headerDiv != '' ? headerDiv : defaults.headerDiv ); - defaults.cloneHeader = ( cloneHeader != null && cloneHeader != '' ? cloneHeader : defaults.cloneHeader ); - return $(this); - } - - $.fn.floatHeader = function(){ - var $tableOrg = $(this); - var $cloneHeader = $(this).clone(true); //克隆表 - $cloneHeader.width($(this).width()); //宽同步 - $cloneHeader.attr("boder",0); - $cloneHeader.attr("id",defaults.cloneHeader); - //行列两层嵌套循环,对应设定克隆表列宽 - //计算表头行数defaults.minRows - $cloneHeader.find("tr").each(function(row,domEle){ // 克隆表 行循环 - if(rowdefaults.minRows-row){ - defaults.minRows = defaults.minRows + $cellOrg.attr('rowspan')-1; - } - }); - }else{ - $(domEle).remove(); //删除克隆表的无意义数据 - } - }); - //检查 表头是否已存在 删除已存在的 以备添加新表头 - if($("#"+defaults.headerDiv).length > 0){ - $("#"+defaults.headerDiv).remove(); - //创建表头div - var tableOrgPosition = $(this).position(); - var div = $("
"); - div.css("top",tableOrgPosition.top+'px').css("left", tableOrgPosition.left+'px') //显示的X轴到左边框距离 - .css("width", $cloneHeader.outerWidth(true)+'px').css("height", $cloneHeader.outerHeight(true)+'px') //高度 - .attr("id", defaults.headerDiv); // 为div设置Id 为 headerId - div.append($cloneHeader); // 将克隆的表头添加到div中 - div.insertBefore($('body table',window.document).first()); // 将div加入页面中 - var $divArray = $(this).closest("div"); - var divO = $divArray[0]; - div.css('top','28px'); - div.css('display','inline'); - } - - return $("#"+defaults.headerDiv); - } - - $.fn.floatHeaderDiv = function(){ - var $tableOrg = $(this); - var $cloneHeader = $(this).clone(true); //克隆表 - - $cloneHeader.width($(this).width()); //宽同步 - $cloneHeader.attr("boder",0); - $cloneHeader.attr("id",defaults.cloneHeader); - //行列两层嵌套循环,对应设定克隆表列宽 - //计算表头行数defaults.minRows - $cloneHeader.find("tr").each(function(row,domEle){ // 克隆表 行循环 - if(rowdefaults.minRows-row){ - defaults.minRows = defaults.minRows + $cellOrg.attr('rowspan')-1; - } - }); - }else{ - $(domEle).remove(); //删除克隆表的无意义数据 - } - }); - - //检查 表头是否已存在 删除已存在的 以备添加新表头 - if($("#"+defaults.headerDiv).length > 0){ - $("#"+defaults.headerDiv).remove(); - } - //创建表头div - var tableOrgPosition = $(this).position(); - var $headerDiv = $("
"); - $headerDiv.css("top",tableOrgPosition.top+'px').css("left", tableOrgPosition.left+'px') //显示的X轴到左边框距离 - .css("width", $cloneHeader.outerWidth(true)+'px').css("height", $cloneHeader.outerHeight(true)+'px') //高度 - .attr("id", defaults.headerDiv); // 为div设置Id 为 headerId - $headerDiv.append($cloneHeader); // 将克隆的表头添加到div中 - $headerDiv.insertBefore($('body table',window.document).first()); // 将div加入页面中 - - //同步列表宽度 - $(this).parent().scroll(function(){ - var $divArray = $(this).closest("div"); - if($divArray.size()>0){ - var divO = $divArray[0]; - if(tableOrgPosition.top < divO.scrollTop){ - $headerDiv.css('top','28px'); - $headerDiv.css('display','inline'); - }else{ - $headerDiv.css('display','none'); - } - } - }); - - //$(this).resize(function(){ - // if(defaults.resize){ - // if($headerDiv.width() != $(this).width()){ - // var $tableOrg = $(this); - // var $cloneHeader = $("#"+defaults.cloneHeader); //表头 - // $cloneHeader.find("tr").each(function(row,domEle){ // 克隆表 行循环 - // $colDataOrg = $tableOrg.find("tr").eq(row).children(); // 原数据表 取第row行数据 - // //alert($(domEle).children().size()+" " +$colDataOrg.size()); - // $(domEle).children().each(function(col){ // 克隆表 列循环 - // $cellOrg = $colDataOrg.eq(col); - // $(this).width($cellOrg.width()); //设置对应列宽 - // $(this).height($cellOrg.height()); - // }); - // }); - // //获取当前 iframe 在全窗口位置 - // $headerDiv.css("left", $tableOrg.position().left+'px'); //显示的X轴到左边框距离 - // $headerDiv.css("width", $tableOrg.width()+'px'); //宽度 - // - // $("#"+defaults.cloneHeader).css("left", $tableOrg.position().left+'px'); //显示的X轴到左边框距离 - // $("#"+defaults.cloneHeader).css("width", $tableOrg.width()+'px'); //宽度 - // //判断表头是否需要显示 - // //var headerTop = $(this).position().top; - // } - // } - //}); - return $headerDiv; - } - })(jQuery) - -function checkEmail(str){ - var reg=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/ ; - return reg.test(str); - } - -//检查是否包含特殊字符 -function containSpecial( s ) -{ - var containSpecial = RegExp(/[(/\s/)(、)(\ )(\~)(\!)(\@)(\#)(\$)(¥)(\%)(;)(:)(“)(”)(\^)(\&)(\*)(\()(\))(\+)(\=)(\[)(\])(\{)(\})(\|)(\\)(\;)(\:)(\')(\")(\,)(\.)(。)(\/)(\<)(\>)(\?)(\)]+/); - return ( containSpecial.test(s) ); -} - -//检查是否包含特殊字符 -function checkStrNoDian( s ) -{ - var containSpecial = RegExp(/[(/\s/)(、)(\ )(\~)(\!)(\@)(\#)(\$)(¥)(\%)(;)(:)(“)(”)(\^)(\&)(\*)(\()(\))(\+)(\=)(\[)(\])(\{)(\})(\|)(\\)(\;)(\:)(\')(\")(\,)(。)(\/)(\<)(\>)(\?)(\)]+/); - return ( containSpecial.test(s) ); -} - -//检查是否包含特殊字符 可以包含中间空格 . _ -function checkSpecial( s ) -{ - var containSpecial = RegExp(/[(、)(\~)(\!)(\@)(\#)(\$)(¥)(\%)(;)(:)(“)(”)(\^)(\&)(\*)(\()(\))(\+)(\=)(\[)(\])(\{)(\})(\|)(\\)(\;)(\:)(\')(\")(\,)(。)(\/)(\<)(\>)(\?)(\)]+/); - return ( containSpecial.test($.trim(s))); -} - - -//层覆盖 -function coverDiv(){ - var msgw,msgh,bordercolor; - msgw=400;//提示窗口的宽度 - msgh=100;//提示窗口的高度 - titleheight=25 //提示窗口标题高度 - bordercolor="#336699";//提示窗口的边框颜色 - titlecolor="#99CCFF";//提示窗口的标题颜色 - - var sWidth,sHeight; - sWidth=document.body.offsetWidth;//浏览器工作区域内页面宽度 - - if(document.body.offsetHeightspanToWinRightWidth) { - spanX = tmpLeftVal; - } - - if(instanceDiv!=null && instanceDiv!='undefined') { - if(navigator.userAgent.indexOf("MSIE")>0) { - instanceDiv.style.left = spanX+"px"; - } - if(navigator.userAgent.indexOf("Firefox")>0){ - instanceDiv.style.left = spanX-60+"px"; - } - instanceDiv.style.top = spanY+"px"; - $(instanceDiv).css("width",spanRealWidth);//宽度为当前鼠标的位置到最右边窗口的距离 - instanceDiv.style.zIndex = 1000; - } - var ch = document.body.clientHeight; - var divheight = $("#"+showContentSpanId).height(); - if((startY+divheight)>ch){ - instanceDiv.style.top = startY-divheight-12+"px"; - } - $("#"+showContentSpanId).show(); - } - - function hideTitle(showContentSpanId) { - $("#"+showContentSpanId).hide(); - } +var highlightcolor='#8D94A5'; +//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行, +var clickcolor='#8D94A5'; +function changeto(){ + //source=event.srcElement; + //if (source.tagName=="TR"||source.tagName=="TABLE") return; + //while(source.tagName!="TD") + // source=source.parentElement; + //source=source.parentElement; + //cs = source.children; + //alert(cs.length); + //if (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor) + //for(i=0;i 0){ + if(how == "edit") + return selectedCount > 1 ? false : true; + else if(how == 'remove') + return true; + else if(how == 'exportXls') + return true; + }else{ + return false; + } +} +//判断是否进行提交操作 +function isOperation(checkName,flagValue){ + var yxbzValue ; + var yxbz; + var flag = false; + var checks = document.getElementsByTagName("input"); + for(i = 0 ; i <= checks.length ; i++ ){ + if(checks[i]){ + if(checks[i].name == checkName){ + if(checks[i].checked) + { + yxbz='yxbz'+checks[i].value; + yxbzValue = document.getElementById(yxbz).value; + if(yxbzValue==flagValue){ + flag=true; + } + } + } + } + } + return flag; +} + +//判断是否进行提交操作 +function isGroup(checkName){ + var yxbzValue ; + var yxbz; + var flag = false; + var checks = document.getElementsByTagName("input"); + for(i = 0 ; i <= checks.length ; i++ ){ + if(checks[i]){ + if(checks[i].name == checkName){ + if(checks[i].checked) + { + yxbz='group'+checks[i].value; + yxbzValue = document.getElementById(yxbz).value; + //alert(yxbzValue); + if(yxbzValue!=null&&yxbzValue!=''){ + flag = true; + } + } + } + } + } + //alert(flag); + return flag; +} + + +function $id(tid,type,show){// id 类型 alter的消息 + //2013-1-30 hyx add ---start + if(document.getElementById(tid)==null) { + return true; + } + //2013-1-30 hyx add ---end + if(type != 'ip1'){ + $("#"+tid).next().html('*'); + }else{ + $("#"+tid).next().html(''); + } + + var name=document.getElementById(tid).value; + if($.trim(name)==''&& type=="xz"){ + $("#"+tid).next().html('请选择'+show); + return false; + } + + if($.trim(name)==''&& type!="remark"){ + $("#"+tid).next().html('请输入'+show); + return false; + } + + if(type=='sz'){ + if(name.replace(/[\d+]/ig,"").length>0){ + //alert(show+'请输入数字') + $("#"+tid).next().html(show+'请输入数字'); + return false; + } + } + + if(type=='port'){ + if(name.replace(/[\d+]/ig,"").length>0){ + //alert(show+'请输入数字') + $("#"+tid).next().html(show+'请输入数字'); + return false; + } + if(name<0){ + //alert(show+'不能小于零') + $("#"+tid).next().html(show+'不能小于零'); + return false; + } + if(name>65535){ + //alert(show+'不能大于65535') + $("#"+tid).next().html(show+'不能大于65535'); + return false; + } + } + + if(type=='ip'|| type=='ip1'){ + var arr=name.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/); + if(arr==null){ + //alert("输入"+show+"不符合要求"); + $("#"+tid).next().html('输入'+show+'不符合要求'); + return false; + } + for(i=1;i255){ + //alert("输入"+show+"不符合要求"); + $("#"+tid).next().html('输入'+show+'不符合要求'); + return false; + } + } + } + + if(type=='remark'){ + if(name.length>500){ + //alert(show+'不能大于五百个字符') + $("#"+tid).next().html(show+'不能大于五百个字符'); + return false; + } + } + +// if(name.length>0){ +// $("#"+tid).val(name); +// } + return true; +} + function fixTableHeader(gv,scrollHeight) + { + //var gvn=$(gv).clone(true).removeAttr("id"); + var gvn = $(gv). + $(gvn).find("tr:not(:first)").remove(); + $(gv).before(gvn); + $(gv).find("tr:first").remove(); + $(gv).wrap("
"); + } + + (function($){ + //内部变量 + var tableId,windowId; + var iWindowObjs = new Array(); //iframe的窗口数组 + var iWinOffset = new Array(); //窗口的 + //属性 + var defaults ={ + 'lockFlag': true, // 是否实现表头浮动标识 true 实现 ;flase 不实现 默认 实现 + 'resize' : true, // 窗口大小变化时 同步表头浮动 默认实现 + 'minRows' : 1, // 表头行数 默认 1行 + 'headerDiv' : 'clone_header_div', // 存放表头的div + 'cloneHeader' : 'clone_header' // 克隆表头 + }; + //初始化参数 + $.fn.initHeader = function(winId,lockFlag,resize,minRows,headerDiv,cloneHeader){ + tableId = $(this).attr("id"); //列表ID + windowId = winId; //窗口ID + defaults.lockFlag = ( lockFlag != null && lockFlag != '' ? lockFlag : defaults.lockFlag ); + defaults.resize = ( resize != null && resize != '' ? resize : defaults.resize ); + defaults.minRows = ( minRows != null && minRows != '' ? minRows : defaults.minRows ); + defaults.headerDiv = ( headerDiv != null && headerDiv != '' ? headerDiv : defaults.headerDiv ); + defaults.cloneHeader = ( cloneHeader != null && cloneHeader != '' ? cloneHeader : defaults.cloneHeader ); + return $(this); + } + + $.fn.floatHeader = function(){ + var $tableOrg = $(this); + var $cloneHeader = $(this).clone(true); //克隆表 + $cloneHeader.width($(this).width()); //宽同步 + $cloneHeader.attr("boder",0); + $cloneHeader.attr("id",defaults.cloneHeader); + //行列两层嵌套循环,对应设定克隆表列宽 + //计算表头行数defaults.minRows + $cloneHeader.find("tr").each(function(row,domEle){ // 克隆表 行循环 + if(rowdefaults.minRows-row){ + defaults.minRows = defaults.minRows + $cellOrg.attr('rowspan')-1; + } + }); + }else{ + $(domEle).remove(); //删除克隆表的无意义数据 + } + }); + //检查 表头是否已存在 删除已存在的 以备添加新表头 + if($("#"+defaults.headerDiv).length > 0){ + $("#"+defaults.headerDiv).remove(); + //创建表头div + var tableOrgPosition = $(this).position(); + var div = $("
"); + div.css("top",tableOrgPosition.top+'px').css("left", tableOrgPosition.left+'px') //显示的X轴到左边框距离 + .css("width", $cloneHeader.outerWidth(true)+'px').css("height", $cloneHeader.outerHeight(true)+'px') //高度 + .attr("id", defaults.headerDiv); // 为div设置Id 为 headerId + div.append($cloneHeader); // 将克隆的表头添加到div中 + div.insertBefore($('body table',window.document).first()); // 将div加入页面中 + var $divArray = $(this).closest("div"); + var divO = $divArray[0]; + div.css('top','0px'); + div.css('display','inline'); + } + + return $("#"+defaults.headerDiv); + } + + $.fn.floatHeaderDiv = function(){ + var $tableOrg = $(this); + var $cloneHeader = $(this).clone(true); //克隆表 + + $cloneHeader.width($(this).width()); //宽同步 + $cloneHeader.attr("boder",0); + $cloneHeader.attr("id",defaults.cloneHeader); + //行列两层嵌套循环,对应设定克隆表列宽 + //计算表头行数defaults.minRows + $cloneHeader.find("tr").each(function(row,domEle){ // 克隆表 行循环 + if(rowdefaults.minRows-row){ + defaults.minRows = defaults.minRows + $cellOrg.attr('rowspan')-1; + } + }); + }else{ + $(domEle).remove(); //删除克隆表的无意义数据 + } + }); + + //检查 表头是否已存在 删除已存在的 以备添加新表头 + if($("#"+defaults.headerDiv).length > 0){ + $("#"+defaults.headerDiv).remove(); + } + //创建表头div + var tableOrgPosition = $(this).position(); + var $headerDiv = $("
"); + $headerDiv.css("top",tableOrgPosition.top+'px').css("left", tableOrgPosition.left+'px') //显示的X轴到左边框距离 + .css("width", $cloneHeader.outerWidth(true)+'px').css("height", $cloneHeader.outerHeight(true)+'px') //高度 + .attr("id", defaults.headerDiv); // 为div设置Id 为 headerId + $headerDiv.append($cloneHeader); // 将克隆的表头添加到div中 + $headerDiv.insertBefore($('body table',window.document).first()); // 将div加入页面中 + + //同步列表宽度 + $(this).parent().scroll(function(){ + var $divArray = $(this).closest("div"); + if($divArray.size()>0){ + var divO = $divArray[0]; + if(tableOrgPosition.top < divO.scrollTop){ + var preDivTop=$headerDiv.parent().prevAll("div[id='divTop']"); + if(preDivTop.length>0){ + $headerDiv.css('top','28px'); + }else{ + $headerDiv.css('top','0px'); + } + $headerDiv.css('display','inline'); + + }else{ + $headerDiv.css('display','none'); + } + } + }); + + //$(this).resize(function(){ + // if(defaults.resize){ + // if($headerDiv.width() != $(this).width()){ + // var $tableOrg = $(this); + // var $cloneHeader = $("#"+defaults.cloneHeader); //表头 + // $cloneHeader.find("tr").each(function(row,domEle){ // 克隆表 行循环 + // $colDataOrg = $tableOrg.find("tr").eq(row).children(); // 原数据表 取第row行数据 + // //alert($(domEle).children().size()+" " +$colDataOrg.size()); + // $(domEle).children().each(function(col){ // 克隆表 列循环 + // $cellOrg = $colDataOrg.eq(col); + // $(this).width($cellOrg.width()); //设置对应列宽 + // $(this).height($cellOrg.height()); + // }); + // }); + // //获取当前 iframe 在全窗口位置 + // $headerDiv.css("left", $tableOrg.position().left+'px'); //显示的X轴到左边框距离 + // $headerDiv.css("width", $tableOrg.width()+'px'); //宽度 + // + // $("#"+defaults.cloneHeader).css("left", $tableOrg.position().left+'px'); //显示的X轴到左边框距离 + // $("#"+defaults.cloneHeader).css("width", $tableOrg.width()+'px'); //宽度 + // //判断表头是否需要显示 + // //var headerTop = $(this).position().top; + // } + // } + //}); + return $headerDiv; + } + })(jQuery) + +function checkEmail(str){ + var reg=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/ ; + return reg.test(str); + } + +//检查是否包含特殊字符 +function containSpecial( s ) +{ + var containSpecial = RegExp(/[(/\s/)(、)(\ )(\~)(\!)(\@)(\#)(\$)(¥)(\%)(;)(:)(“)(”)(\^)(\&)(\*)(\()(\))(\+)(\=)(\[)(\])(\{)(\})(\|)(\\)(\;)(\:)(\')(\")(\,)(\.)(。)(\/)(\<)(\>)(\?)(\)]+/); + return ( containSpecial.test(s) ); +} + +//检查是否包含特殊字符 +function checkStrNoDian( s ) +{ + var containSpecial = RegExp(/[(/\s/)(、)(\ )(\~)(\!)(\@)(\#)(\$)(¥)(\%)(;)(:)(“)(”)(\^)(\&)(\*)(\()(\))(\+)(\=)(\[)(\])(\{)(\})(\|)(\\)(\;)(\:)(\')(\")(\,)(。)(\/)(\<)(\>)(\?)(\)]+/); + return ( containSpecial.test(s) ); +} + +//检查是否包含特殊字符 可以包含中间空格 . _ +function checkSpecial( s ) +{ + var containSpecial = RegExp(/[(、)(\~)(\!)(\@)(\#)(\$)(¥)(\%)(;)(:)(“)(”)(\^)(\&)(\*)(\()(\))(\+)(\=)(\[)(\])(\{)(\})(\|)(\\)(\;)(\:)(\')(\")(\,)(。)(\/)(\<)(\>)(\?)(\)]+/); + return ( containSpecial.test($.trim(s))); +} + + +//层覆盖 +function coverDiv(){ + var msgw,msgh,bordercolor; + msgw=400;//提示窗口的宽度 + msgh=100;//提示窗口的高度 + titleheight=25 //提示窗口标题高度 + bordercolor="#336699";//提示窗口的边框颜色 + titlecolor="#99CCFF";//提示窗口的标题颜色 + + var sWidth,sHeight; + sWidth=document.body.offsetWidth;//浏览器工作区域内页面宽度 + + if(document.body.offsetHeightspanToWinRightWidth) { + spanX = tmpLeftVal; + } + + if(instanceDiv!=null && instanceDiv!='undefined') { + if(navigator.userAgent.indexOf("MSIE")>0) { + instanceDiv.style.left = spanX+"px"; + } + if(navigator.userAgent.indexOf("Firefox")>0){ + instanceDiv.style.left = spanX-60+"px"; + } + instanceDiv.style.top = spanY+"px"; + $(instanceDiv).css("width",spanRealWidth);//宽度为当前鼠标的位置到最右边窗口的距离 + instanceDiv.style.zIndex = 1000; + } + var ch = document.body.clientHeight; + var divheight = $("#"+showContentSpanId).height(); + if((startY+divheight)>ch){ + instanceDiv.style.top = startY-divheight-12+"px"; + } + $("#"+showContentSpanId).show(); + } + + function hideTitle(showContentSpanId) { + $("#"+showContentSpanId).hide(); + } \ No newline at end of file