温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:汽车配件公司网站(VB.net+Access数据库)源码
当前文件:
VbNetCompany/top/JS/pz_chromeless_2.1.js,打开代码结构图
VbNetCompany/top/JS/pz_chromeless_2.1.js,打开代码结构图1function openchromeless(theURL, wname, W, H, CLOSEdwn, CLOSEup, CLOSEovr, NONEgrf, CLOCKgrf, winTIT, winREALtit , winBORDERCOLOR, winBORDERCOLORsel, winBGCOLOR) { 2
3
var windowW = W; 4
var windowH = H; 5
var windowX = Math.ceil( (window.screen.width - windowW) / 2 ); 6
var windowY = Math.ceil( (window.screen.height - windowH) / 2 ); 7
8
if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion)>=4) isie=true 9
else isie=false 10
11
if (isie) { H=H+22+10+2; W=W+10+10+2; } 12
13
s = ",width="+W+",height="+H; 14
15
if (isie && (navigator.userAgent.toLowerCase().indexOf("win")!=-1) ) { 16
17
var dowin = theURL != "" ? true : false; 18
19
var chromeTIThtml = '\n' + 20
'<html> '+ '\n'+ 21
'<head> '+ '\n'+ 22
'<title> CHROMELESS WINDOWS / TITLEBAR</title> '+ '\n'+ 23
'<style type="text/css"> '+ '\n'+ 24
'#mywinTITLE { position: absolute; left: 0px; top: 0px; width: 100%; height: 22px; z-index: 1; background-color: '+winBGCOLOR+'; clip:rect(0,100%,22,0); } '+ '\n'+ 25
'#mywindow { position: absolute; left: 0px; top: 0px; width: 100%; height: 22px; z-index: 2; clip:rect(0,100%;22,0); } '+ '\n'+ 26
'#mywindowCLOSE { position: absolute; left: -22px; top: -22px; width: 11px; height: 11px; z-index: 3; clip:rect(0,11,11,0); } '+ '\n'+ 27
'#myCLOCKgrf { position: absolute; left: -22px; top: -22px; width: 11px; height: 11px; z-index: 3; clip:rect(0,11,11,0); } '+ '\n'+ 28
'</style> '+ '\n'+ 29
'<script language="javascript"> '+ '\n' 30
31
if ( theURL != "" ) { 32
33
chromeTIThtml = chromeTIThtml + 34
' theURL = "'+theURL +'" '+ '\n'+ 35
' CLOSEdwn = "'+CLOSEdwn +'" '+ '\n'+ 36
' CLOSEup = "'+CLOSEup +'" '+ '\n'+ 37
' CLOSEovr = "'+CLOSEovr +'" '+ '\n'+ 38
' CLOCKgrf = "'+CLOCKgrf +'" '+ '\n'+ 39
' winBORDERCOLOR = "'+winBORDERCOLOR +'" '+ '\n'+ 40
' winBORDERCOLORsel = "'+winBORDERCOLORsel +'" '+ '\n'+ 41
' winBGCOLOR = "'+winBGCOLOR +'" '+ '\n' 42
43
} else { 44
45
chromeTIThtml = chromeTIThtml + 46
' theURL="about:blank" '+ '\n'+ 47
' CLOSEdwn = "images/close_a.gif" '+ '\n'+ 48
' CLOSEup = "images/close_d.gif" '+ '\n'+ 49
' CLOSEovr = "images/close_o.gif" '+ '\n'+ 50
' CLOCKgrf = "images/clock.gif" '+ '\n'+ 51
' winTIT = "<font face=verdana size=1> ?window title</font>" '+ '\n'+ 52
' winBORDERCOLOR = "#000000" '+ '\n'+ 53
' winBORDERCOLORsel = "#FF8A00" '+ '\n'+ 54
' winBGCOLOR = "#d7dcd9" '+ '\n' 55
56
} 57
58
chromeTIThtml = chromeTIThtml + 59
'var windowCLOSEIMGdwn = new Image(); windowCLOSEIMGdwn.src = CLOSEdwn; '+ '\n'+ 60
'var windowCERRARImg_d = new Image(); windowCERRARImg_d.src = CLOSEup; '+ '\n'+ 61
'var windowCERRARImg_o = new Image(); windowCERRARImg_o.src = CLOSEovr; '+ '\n'+ 62
'var CLOCKgrfImg = new Image(); CLOCKgrfImg.src = CLOCKgrf; '+ '\n'+ 63
' '+ '\n'+ 64
'function mouseSTATUS() { '+ '\n'+ 65
' this.x = null; '+ '\n'+ 66
' this.y = null; '+ '\n'+ 67
' this.bt = "up"; '+ '\n'+ 68
' this.oldx = null; '+ '\n'+ 69
' this.oldy = null; '+ '\n'+ 70
' this.dx = null; '+ '\n'+ 71
' this.dy = null; '+ '\n'+ 72
' this.screeny = null; '+ '\n'+ 73
' this.screenx = null; '+ '\n'+ 74
' '+ '\n'+ 75
' this.element = null; '+ '\n'+ 76
' this.event = null; '+ '\n'+ 77
'} '+ '\n'+ 78
' '+ '\n'+ 79
'var mouse = new mouseSTATUS(); '+ '\n'+ 80
' '+ '\n'+ 81
'function actualizateMouseSTATUS(e) { '+ '\n'+ 82
' if (!e) var e = event '+ '\n'+ 83
' if ( (e.type=="mousedown" || e.type=="mouseup") && e.button!=1) return true '+ '\n'+ 84
' '+ '\n'+ 85
' var x=e.x+document.body.scrollLeft '+ '\n'+ 86
' var y=e.y+document.body.scrollTop '+ '\n'+ 87
' '+ '\n'+ 88
' mouse.x = x; '+ '\n'+ 89
' mouse.y = y; '+ '\n'+ 90
' '+ '\n'+ 91
' if ( e.type == "mousedown" ) mouse.bt = "down"; '+ '\n'+ 92
' else if ( e.type == "mouseup" ) mouse.bt = "up"; '+ '\n'+ 93
' '+ '\n'+ 94
' if (window.event) { '+ '\n'+ 95
' mouse.screenx=window.event.screenX; '+ '\n'+ 96
' mouse.screeny=window.event.screenY; '+ '\n'+ 97
' } else { '+ '\n'+ 98
' mouse.screenx=-1; '+ '\n'+ 99
' mouse.screeny=-1; '+ '\n'+ 100
' } '+ '\n'+ 101
' '+ '\n'+ 102
'} '+ '\n'+ 103
' '+ '\n'+ 104
' '+ '\n'+ 105
'function initMouseEvents() { '+ '\n'+ 106
' document.onmousedown = actualizateMouseSTATUS '+ '\n'+ 107
' document.onmousemove = actualizateMouseSTATUS '+ '\n'+ 108
' document.onmouseup = actualizateMouseSTATUS '+ '\n'+ 109
' document.onselectstart = selectstart '+ '\n'+ 110
' document.ondragstart = new Function("actualizateMouseSTATUS(event); return false;") '+ '\n'+ 111
' document.oncontextmenu = new Function("return false;") '+ '\n'+ 112
'} '+ '\n'+ 113
' '+ '\n'+ 114
'function selectstart(){ '+ '\n'+ 115
' if ( event.srcElement.tagName != "INPUT" && event.srcElement.tagName != "TEXTAREA") { return false; } '+ '\n'+ 116
' else { mouse.bt="up"; return true; } '+ '\n'+ 117
'} '+ '\n'+ 118
' '+ '\n'+ 119
'initMouseEvents() '+ '\n'+ 120
' '+ '\n'+ 121
'var mywindowbt ="up"; '+ '\n'+ 122
'var wincloseSTATUS="up"; '+ '\n'+ 123
' '+ '\n'+ 124
'var ofx=0; '+ '\n'+ 125
'var ofy=0; '+ '\n'+ 126
'var opx=0; '+ '\n'+ 127
'var opy=0; '+ '\n'+ 128
'var px=0; '+ '\n'+ 129
'var py=0; '+ '\n'+ 130
' '+ '\n'+ 131
'var wcpx1=-1, wcpy1=-1; '+ '\n'+ 132
'var wcpx2=-1, wcpy2=-1; '+ '\n'+ 133
' '+ '\n'+ 134
'var wclosechanged = false; '+ '\n'+ 135
' '+ '\n'+ 136
'function initToMoveWin() { '+ '\n'+ 137
' if (wincloseSTATUS=="up" && ( mywindowbt=="up" || mywindowbt=="over") ) { '+ '\n'+ 138
' '+ '\n'+ 139
' if ( parent.mainloaded ) document.all["myCLOCKgrf"].style.visibility = "hidden"; '+ '\n'+ 140
' '+ '\n'+ 141
' document.all["myCLOCKgrf"].style.pixelLeft=document.body.clientWidth-36 '+ '\n'+ 142
' document.all["myCLOCKgrf"].style.pixelTop =5 '+ '\n'+ 143
' '+ '\n'+ 144
' wcpx1 = document.all["mywindowCLOSE"].style.pixelLeft=document.body.clientWidth-21 '+ '\n'+ 145
' wcpy1 = document.all["mywindowCLOSE"].style.pixelTop = 5 '+ '\n'+ 146
' wcpx2 = wcpx1 + 11 - 1 '+ '\n'+ 147
' wcpy2 = wcpy1 + 11 - 1 '+ '\n'+ 148
' if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2) { '+ '\n'+ 149
' if (wclosechanged == false) { '+ '\n'+ 150
' document.all["mywindowCLOSE"].document.images["closewin"].src=windowCERRARImg_o.src '+ '\n'+ 151
' wclosechanged = true '+ '\n'+ 152
' } '+ '\n'+ 153
' '+ '\n'+ 154
' } else if (wclosechanged == true) { '+ '\n'+ 155
' document.all["mywindowCLOSE"].document.images["closewin"].src=windowCERRARImg_d.src '+ '\n'+ 156
' wclosechanged = false '+ '\n'+ 157
' } '+ '\n'+ 158
' } '+ '\n'+ 159
' '+ '\n'+ 160
' if ( mouse.y <= 22 && mouse.y >= 1 && mywindowbt == "up" && mouse.bt =="up" ) { mywindowbt = "over" } '+ '\n'+ 161
' else if ( ( mouse.y > 22 || mouse.y < 1 ) && mywindowbt == "over" && mouse.bt =="up" ) { mywindowbt = "up" } '+ '\n'+ 162
' else if ( mouse.y <= 22 && mouse.y >= 1 && mywindowbt == "over" && mouse.bt == "down" ) { '+ '\n'+ 163
' self.window.focus(); '+ '\n'+ 164
' '+ '\n'+ 165
' if ( mouse.x >= wcpx1 && mouse.x <= wcpx2 && mouse.y >= wcpy1 && mouse.y <= wcpy2 ) { '+ '\n'+ 166
' wincloseSTATUS="down" '+ '\n'+ 167
' document.all["mywindowCLOSE"].document.images["closewin"].src=windowCLOSEIMGdwn.src '+ '\n'+ 168
' } else { '+ '\n'+ 169
' parent.bordeT.document.bgColor = winBORDERCOLORsel '+ '\n'+ 170
' parent.bordeB.document.bgColor = winBORDERCOLORsel '+ '\n'+ 171
' parent.bordeL.document.bgColor = winBORDERCOLORsel '+ '\n'+ 172
' parent.bordeR.document.bgColor = winBORDERCOLORsel '+ '\n'+ 173
' ofx = mouse.x; '+ '\n'+ 174
' ofy = mouse.y; '+ '\n'+ 175
' opx = mouse.x; '+ '\n'+ 176
' opy = mouse.y; '+ '\n'+ 177
' } '+ '\n'+ 178
' mywindowbt="down"; '+ '\n'+ 179
' } '+ '\n'+ 180
' else if ( mouse.bt =="up" && mywindowbt == "down" ) { '+ '\n'+ 181
' mywindowbt="up"; '+ '\n'+ 182
' ofx=0; '+ '\n'+




}