1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
|
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<cs.length;i++){
// cs[i].style.backgroundColor=highlightcolor;
//}
}
function changeback(){
//if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
//return
//if (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
//for(i=0;i<cs.length;i++){
// cs[i].style.backgroundColor="";
//}
}
function checkAll(c)
{
var checks = document.getElementsByTagName("input");
for(i=0;i<checks.length;i++)
{
if(checks[i].type=='checkbox'&&checks[i].disabled!=true)
{
checks[i].checked=(c.checked)?'checked':''}
}
}
function countChecked(checkName){
var selectedCount = 0;
var checks = document.getElementsByTagName("input");
for(i = 0 ; i <= checks.length ; i++ ){
if(checks[i]){
if(checks[i].name == checkName){
if(checks[i].checked)
{
selectedCount++;
}
}
}
}
return selectedCount;
}
//返回第一个选中的复选框的值
function getOnlyValue(checkName) {
var selectedValue = "";
var checks = document.getElementsByTagName("input");
for(i = 0 ; i <= checks.length ; i++ ){
if(checks[i]){
if(checks[i].name == checkName){
if(checks[i].checked)
{
selectedValue = checks[i].value;
break;
}
}
}
}
return selectedValue;
}
function isRigthCheck(checkName,how){
var selectedCount = countChecked(checkName);
if(selectedCount > 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;i<arr.length;i++){
if(String(Number(arr[i]))!=arr[i]||Number(arr[i])>255){
//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("<div style='height:"+ scrollHeight +"px; overflow-y: scroll;overflow-x:hidden; overflow: auto; padding: 0;margin: 0;'></div>");
}
(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(row<defaults.minRows){
$colDataOrg = $tableOrg.find("tr").eq(row).children(); // 原数据表 取第row行数据
$(domEle).children().each(function(col){ // 克隆表 列循环
$cellOrg = $colDataOrg.eq(col);
$(this).width($cellOrg.width()); //宽同步
$(this).height($cellOrg.height()); //高同步
//Cell内checkbox事件同步
$(this).find("input[type='checkbox']").each(function (){
var $checkbox0 = $(this);
var $checkbox1 = $cellOrg.find("input[id='"+$checkbox0.attr('id')+"']");
//将$checkbox0 的事件同步到$checkbox1 上
$checkbox0.click(function(){
$checkbox1.attr('checked',$checkbox0.attr('checked'));
});
//将$checkbox1 的事件同步到$checkbox0 上
$checkbox1.click(function(){
$checkbox0.attr('checked',$checkbox1.attr('checked'));
});
});
//校正 浮动表头 行数
if($cellOrg.attr('rowspan')>defaults.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 style='position:absolute;z-index:20;display:none;'></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];
if (divO.scrollTop > 20) {
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(row<defaults.minRows){
$colDataOrg = $tableOrg.find("tr").eq(row).children(); // 原数据表 取第row行数据
$(domEle).children().each(function(col){ // 克隆表 列循环
$cellOrg = $colDataOrg.eq(col);
$(this).width($cellOrg.width()); //宽同步
$(this).height($cellOrg.height()); //高同步
//Cell内checkbox事件同步
$(this).find("input[type='checkbox']").each(function (){
var $checkbox0 = $(this);
var $checkbox1 = $cellOrg.find("input[id='"+$checkbox0.attr('id')+"']");
//将$checkbox0 的事件同步到$checkbox1 上
$checkbox0.click(function(){
$checkbox1.attr('checked',$checkbox0.attr('checked'));
});
//将$checkbox1 的事件同步到$checkbox0 上
$checkbox1.click(function(){
$checkbox0.attr('checked',$checkbox1.attr('checked'));
});
});
//校正 浮动表头 行数
if($cellOrg.attr('rowspan')>defaults.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 = $("<div style='position:absolute;z-index:20;display:none;'></div>");
$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){
$("#"+defaults.headerDiv).css('top','28px');
}else{
$("#"+defaults.headerDiv).css('top','0px');
}
$("#"+defaults.headerDiv).css('display','inline');
}else{
$("#"+defaults.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.offsetHeight<screen.height)
sHeight=screen.height;//屏幕高度(垂直分辨率)
else
sHeight=document.body.offsetHeight;//浏览器工作区域内页面高度
//背景层(大小与窗口有效区域相同,即当弹出对话框时,背景显示为放射状透明灰色)
var bgObj=document.createElement("div");//创建一个div对象(背景层)
//定义div属性,即相当于
bgObj.setAttribute('id','bgDiv');
bgObj.style.position="absolute";
bgObj.style.top="0";
bgObj.style.background="#777";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
bgObj.style.opacity="0.6";
bgObj.style.left="0";
bgObj.style.width=sWidth + "px";
bgObj.style.height=sHeight + "px";
bgObj.style.zIndex = "10000";
document.body.appendChild(bgObj);//在body内添加该div对象
var title=document.createElement("h4");//创建一个h4对象(提示框标题栏)
//定义h4的属性,即相当于
title.setAttribute("id","msgTitle");
title.setAttribute("align","center");
title.style.position = "absolute";
title.style.left = "50%";
title.style.top = "50%";
title.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
title.style.marginLeft = "-225px" ;
title.style.marginTop = -75+document.documentElement.scrollTop+"px";
title.style.width = msgw + "px";
title.style.height =msgh + "px";
title.style.textAlign = "center";
title.style.lineHeight ="25px";
title.style.zIndex = "10001";
title.innerHTML="后台正在处理数据……";
function removeObj(){//点击标题栏触发的事件
document.body.removeChild(bgObj);//删除背景层Div
}
document.getElementById("bgDiv").appendChild(title);//在提示框div中添加标题栏对象title
}
var interval;
//层覆盖,针对ajax请求,5秒钟取消遮盖层
function coverAjaxDiv(){
var msgw,msgh,bordercolor;
msgw=400;//提示窗口的宽度
msgh=100;//提示窗口的高度
titleheight=25 //提示窗口标题高度
bordercolor="#336699";//提示窗口的边框颜色
titlecolor="#99CCFF";//提示窗口的标题颜色
var sWidth,sHeight;
sWidth=document.body.offsetWidth;//浏览器工作区域内页面宽度
if(document.body.offsetHeight<screen.height)
sHeight=screen.height;//屏幕高度(垂直分辨率)
else
sHeight=document.body.offsetHeight;//浏览器工作区域内页面高度
//背景层(大小与窗口有效区域相同,即当弹出对话框时,背景显示为放射状透明灰色)
var bgObj=document.createElement("div");//创建一个div对象(背景层)
//定义div属性,即相当于
bgObj.setAttribute('id','bgDiv');
bgObj.style.position="absolute";
bgObj.style.top="0";
bgObj.style.background="#777";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
bgObj.style.opacity="0.6";
bgObj.style.left="0";
bgObj.style.width=sWidth + "px";
bgObj.style.height=sHeight + "px";
bgObj.style.zIndex = "10000";
document.body.appendChild(bgObj);//在body内添加该div对象
var title=document.createElement("h4");//创建一个h4对象(提示框标题栏)
//定义h4的属性,即相当于
title.setAttribute("id","msgTitle");
title.setAttribute("align","center");
title.style.position = "absolute";
title.style.left = "50%";
title.style.top = "50%";
title.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
title.style.marginLeft = "-225px" ;
title.style.marginTop = -75+document.documentElement.scrollTop+"px";
title.style.width = msgw + "px";
title.style.height =msgh + "px";
title.style.textAlign = "center";
title.style.lineHeight ="25px";
title.style.zIndex = "10001";
title.innerHTML="后台正在处理数据……";
title.click(function(){//点击标题栏触发的事件
document.body.removeChild(bgObj);//删除背景层Div
})
document.getElementById("bgDiv").appendChild(title);//在提示框div中添加标题栏对象title
interval = setInterval('removeObj()',1000);
}
function removeObj(){//点击标题栏触发的事件
clearInterval(interval);
document.body.removeChild(document.getElementById("bgDiv"));//删除背景层Div
}
function showTitle(showContentSpanId,obj,event) {
//当前鼠标的坐标
var scrollLeft = document.documentElement.scrollLeft;
var scrollTop = document.documentElement.scrollTop;
var event = event ? event : window.event;
var startX = Number(event.clientX)+Number(scrollLeft);
var startY = Number(event.clientY)+Number(scrollTop);
//span的坐标及宽度
var instanceDiv = document.getElementById(showContentSpanId);
var spanToWinRightWidth = 350;//span的左边距离窗口右边的距离
var spanX = document.body.offsetWidth-spanToWinRightWidth;//span的x坐标
var spanY = startY+12;//span的y坐标
var spanRealWidth = spanToWinRightWidth-30;//span实际宽度:250
//先取span的x坐标为:obj的x坐标+1/2的obj的宽度,如果窗口最右边到此坐标的距离小于spanLeftX,则取:document.body.offsetWidth-spanLeftX
var objX = Number(obj.clientX)+Number(obj.scrollLeft);
var objWidth = obj.offsetWidth;
var tmpLeftVal = spanX;
if(objX!='NaN' && objWidth!='NaN') {
tmpLeftVal = Number(objX)+Number(0.5*objWidth);//span的x坐标
}
if(document.body.offsetWidth-tmpLeftVal>spanToWinRightWidth) {
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();
}
/*
* 删除 调用 putty 远程连接
*/
function removeRemoteConn(){
$("a[onclick^='remoteConn']").each(function(i,n){
var $this = $(n);
var content = $this.html();
var parent = $this.parent();
parent.html(content);
$this.remove();
});
}
/*$(function(){
//删除 调用 putty 远程连接
removeRemoteConn();
//修改ajax全局配置,ajax执行完成后调用,清除动态加载内容的 远程连接
$.ajaxSetup({
complete:function (XMLHttpRequest, textStatus) {
removeRemoteConn();
}
});
});*/
|