写了几个类,希望对大家有用。
1.日历
#oContainer {
width: 193px;
padding: 3px;
background-color: menu;
border-left: buttonhighlight 1px solid;
border-top: buttonhighlight 1px solid;
border-right: buttonshadow 1px solid;
border-bottom: buttonshadow 2px solid;
}
.DateTable {
font: 10pt;
word-break: break-all;
}
.WeekTd, .BlankTd {
font: 10pt;
border: 1px solid menu;
}
.Today {
font: 10pt;
color: red;
cursor: hand;
position: relative;
left: 1px;
top: 1px;
border-left: 1px solid dimgray;
border-top: 1px solid dimgray;
border-right: 1px solid white;
border-bottom: 1px solid white;
}
.MonthTd {
font: 10pt;
font-family: webdings;
cursor: hand;
border: 1px solid menu;
zmm: expression(onmouseenter = function() {
style.color = 'red';
},
onmouseout = function() {
style.color = '';
});
}
.SelectTd {
border: 1px solid menu;
}
.over {
position: relative;
cursor: hand;
border-right: 1px solid buttonshadow;
border-bottom: 1px solid buttonshadow;
border-left: 1px solid buttonhighlight;
border-top: 1px solid buttonhighlight;
}
.out {
border-left: 1px solid buttonface;
border-top: 1px solid buttonface;
border-right: 1px solid buttonface;
border-bottom: 1px solid buttonface;
}
.down {
position: relative;
left: 1px;
top: 1px;
border-left: 1px solid dimgray;
border-top: 1px solid dimgray;
border-right: 1px solid white;
border-bottom: 1px solid white;
}
var oDate = new Object();
function DateClass(_container) {
this.author = '51JS.COM-ZMM';
this.version = 'Web Calendar 1.0';
this.container = _container;
this.weekArr = ['日', '一', '二', '三', '四', '五', '六'];
this.dateArr = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
this.showTable = function(_year, _month) {
this.container.innerHTML = this.getDateTable(_year, _month);
}
this.getDateTable = function(_year, _month) {
if (this.checkArgs(_year, _month)) {
_year = parseInt(this.checkDate(_year, _month).split('-')[0]);
_month = parseInt(this.checkDate(_year, _month).split('-')[1]);
this.Thead = '
3 | '; for (var i=1900; i' + i + '年'; this.Thead += ''; for (var i=1; i' + i + '月'; this.Thead += ' |
4 | ||||
' + i + ' | ' + i + ' |
\n';
this.Table = this.Thead + this.Tbody + this.TFoot;
return this.Table;
} else {
return 'Arguments Error!';
}
}
this.firstPos = function(_year, _month) {
return new Date(_year, _month-1, 1).getDay();
}
this.lastPos = function(_year, _month) {
return new Date(_year, _month-1, this.dateArr[_month-1]).getDay();
}
this.checkYear = function(_year) {
return ((_year % 4 == 0) && (_year % 100 != 0)) || (_year % 400 == 0);
}
this.today = function(_year, _month, _date) {
return (new Date().getFullYear() == _year) && (new Date().getMonth() == _month-1) && (new Date().getDate() == _date);
}
this.checkArgs = function(_year, _month) {
if (_year2100) return false;
if (_month13) return false;
return (!isNaN(_year) && !isNaN(_month));
}
this.checkDate = function(_year, _month) {
if (_month12) {
_year ++;
_month = 1;
}
return _year + '-' + _month;
}
this.showDateStr = function(_year, _month, _date, _week) {
window.alert(_year + '年' + _month + '月' + _date + '日 星期' + _week);
}
}
window.onload = function() {
oDate = new DateClass(self.oContainer);
oDate.showTable(new Date().getFullYear(), new Date().getMonth()+1);
}
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
2.简单的下拉菜单
#oData {
display: none;
}
#oPanel {
width: 120px;
font-size: 12px;
border: 1px solid menu;
padding: 2px;
position: absolute;
display: none;
}
span {
font-size: 12px;
cursor: hand;
}
var oMenu = new Object();
function Menu(_data, _panel) {
this.author = '51JS.COM-ZMM';
this.version = 'Menu 1.0';
this.data = _data;
this.panel = _panel;
this.drawMenu = function(_number, _offsetX, _offsetY) {
var nodeArr = this.data.childNodes;
var _handle = window.event.srcElement;
for (var i=0; i
菜单一
菜单二
菜单三
菜单四
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
3. QQ菜单效果
#oContainer {
width: 130px;
height: 300px;
border: 1px solid menu;
}
var oTime, oTencent = new Object();
function Tencent(_container) {
this.author = '51JS.COM-ZMM';
this.version = 'Tencent 1.0';
this.container = _container;
this.box = (function(_object) {
var _box = document.createElement('DIV');
_box.id = 'TencentBox';
_box.style.width = _object.offsetWidth;
_box.style.height = _object.offsetHeight;
return _box;
})(this.container);
this.container.appendChild(this.box);
this.toolRecord = new Object();
this.barCount = 0;
this.drawTencent = function(_barList, _barHeight, _barDelay, _barAmount) {
var _bool = true;
this.barList = [];
this.toolList = [];
this.barHeight = _barHeight;
this.barDelay = _barDelay;
this.barAmount = _barAmount;
for (var i in _barList) this.barCount ++;
this.toolHeight = parseInt(this.box.style.height) - this.barCount * this.barHeight;
for (var i in _barList) {
var _bar = document.createElement('BUTTON');
_bar.style.width = this.box.style.width;
_bar.style.height = _barHeight;
_bar.style.textAlign = 'center';
_bar.value = i.toString();
_bar.hideFocus = true;
_bar.attachEvent('onclick', this.doClick);
this.box.appendChild(_bar);
var _tool = document.createElement('DIV');
_tool.align = 'center';
_tool.style.width = this.container.offsetWidth - 2;
_tool.style.overflowY = 'auto';
_tool.style.fontSize = '9pt';
_tool.style.height = (_bool) ? this.toolHeight : 1 ;
_tool.style.display = (_bool) ? 'inline' : 'none' ;
_tool.innerHTML = (function(_array) {
var _html = new String();
var _bool = new Boolean(true);
_bool = _bool & (typeof(_array[1]) == 'object');
_bool = _bool & (typeof(_array[2]) == 'object');
_bool = _bool & (typeof(_array[3]) == 'object');
if (_bool) {
_bool = _bool & (_array[1].length == _array[2].length);
_bool = _bool & (_array[1].length == _array[3].length);
_bool = _bool & (_array[2].length == _array[3].length);
if (_bool) {
for (var j=0; j';
_html += '';
_html += '
' + _array[3][j];
_html += '';
_html += '
';
}
} else {
window.alert('arguments error!');
}
} else {
_bool = _bool & (typeof(_array[1]) == 'string');
_bool = _bool & (typeof(_array[2]) == 'string');
_bool = _bool & (typeof(_array[3]) == 'string');
if (!_bool) {
_html += '
';
_html += '';
_html += '
' + _array[3];
_html += '';
_html += '
';
} else {
window.alert('arguments error!');
}
}
return _html;
})(_barList[i]);
this.box.appendChild(_tool);
this.barList[this.barList.length] = _bar;
this.toolList[this.toolList.length] = _tool;
if (_bool) { this.barCurrent = _bar; this.toolCurrent = _tool; _bool = false; }
}
}
this.doClick = function() {
var _eventBar = window.event.srcElement;
with (oTencent) {
if (!oTime && (barCurrent != _eventBar)) {
for (var i=0; i 0) ? (parseInt(height) - this.barAmount) : 1 ;
}
with (this.toolCurrent.style) {
height = ((parseInt(height) + this.barAmount)
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
4.对联效果
var oCouplet = new Object();
function Couplet(_top, _width, _height, _offset, _delay, _amount) {
this.author = '51JS.COM-ZMM';
this.version = 'Couplet 1.0';
this.top = _top;
this.width = _width;
this.height = _height;
this.offset = _offset;
this.delay = _delay;
this.amount = _amount;
this.drawCouplet = function(_content) {
this.content = _content;
var _client = document.body.clientWidth;
var _css = new String();
_css += 'top: ' + this.top + 'px;';
_css += 'width: ' + this.width + 'px;';
_css += 'height: ' + this.height + 'px;';
_css += 'position: absolute;';
_css += 'font-size: 12px;';
_css += 'border: 1px solid menu;';
_css += 'overflow: auto;'
var _html = new String();
_html += '
';
_html += this.content;
_html += '
';
_html += '
';
_html += this.content;
_html += '
';
return _html;
}
this.doScroll = function() {
var _left = document.getElementById('oCouplet_left');
var _right = document.getElementById('oCouplet_right');
var _oTop = parseInt(_left.style.top);
var _nTop = parseInt(document.body.scrollTop) + this.top;
if (_oTop 0) {
_left.style.top = _right.style.top = _oTop + 1 + 'px';
var oTime = window.setTimeout('oCouplet.doScroll()', this.delay);
} else {
window.clearTimeout(oTime);
}
} else {
if ((_oTop - _nTop) > 0) {
_left.style.top = _right.style.top = _oTop - 1 + 'px';
var oTime = window.setTimeout('oCouplet.doScroll()', this.delay);
} else {
window.clearTimeout(oTime);
}
}
}
}
window.onload = function() {
var oTop = 50, oWidth = 120, oHeight = 250, oOffset = 20;
var oDelay = 80, oAmount = 1;
oCouplet = new Couplet(oTop, oWidth, oHeight, oOffset, oDelay, oAmount);
with (document.body) {
innerHTML += oCouplet.drawCouplet(self.oContent.innerHTML);
onscroll = function() {
oCouplet.doScroll();
}
}
}
对联内容
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
5.图片轮换
var oInterval, oTime, oRotator = new Object();
function Rotator(_container, _width, _height, _array, _delay) {
this.author = '51JS.COM-ZMM';
this.version = 'Rotator 1.0';
this.container = _container;
this.width = _width;
this.height = _height;
this.box = (function(_container, _width, _height) {
var _box = document.createElement('DIV');
_box.id = 'RotatorBox';
_box.align = 'center';
_box.style.width = _width;
_box.style.height = _height;
_box.style.border = '1px solid menu';
_box.style.overflow = 'hidden';
return _box;
})(this.container, this.width, this.height);
this.container.appendChild(this.box);
this.sAmount = 0;
this.drawRotator = function(_array, _delay) {
this.delay = _delay;
var _bool = (_array.length == 3);
_bool = _bool & (_array[0].length == _array[1].length);
_bool = _bool & (_array[0].length == _array[2].length);
_bool = _bool & (_array[1].length == _array[2].length);
if (_bool) {
this.itemArr = [];
this.panel = (function(_width, _height, _array) {
var _panel = document.createElement('DIV');
_panel.style.position = 'absolute';
_panel.style.top = '0px';
_panel.style.left = '0px';
return _panel;
})(this.width, this.height, _array);
for (var i=0; i';
_html += '
_html += '';
_html += '';
_html += '
';
_html += '
';
this.itemArr[this.itemArr.length] = _html;
}
this.box.appendChild(this.panel);
this.setPanelContent();
} else {
window.alert('arguments error!');
}
}
this.setPanelContent = function() {
this.panel.innerHTML = this.itemArr.join('');
}
this.doScroll = function() {
with (oRotator) {
if (sAmount
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
6.listView类
#oContainer {
width: 600px;
height: 500px;
border: 1px solid menu;
margin: 0px;
padding: 0px;
overflow: hidden;
}
a {
color: black;
text-decoration: none;
}
a:hover {
color: red;
text-decoration: underline;
}
var oListView = new Object();
function listView(_container) {
this.author = '51JS.COM-ZMM';
this.version = 'ListView 1.0';
this.container = _container;
this.box = new Object();
this.headerWidth = 0;
this.headerHeight = 20;
this.itemWidth = 0;
this.itemHeight = 0;
this.rowsCount = 30;
this.isResize = false;
this.separate = new Object();
this.startPoint = 0;
this.endPoint = 0;
this.tempSeparate = new Object();
this.put_headerHeight = function(_height) { return _height; };
this.get_headerHeight = function() { return this.headerHeight; };
this.put_rowsCount = function(_count) { return _count; };
this.get_rowsCount = function() { return this.rowsCount; };
}
listView.prototype = {
boxInit : function() {
this.container.innerHTML = new String();
this.box = (function(_object) {
var _box = document.createElement('DIV');
with (_box) {
id = 'ListViewBox';
style.width = _object.offsetWidth;
style.height = _object.offsetHeight;
style.margin = '0px';
style.padding = '0px';
attachEvent('oncontextmenu', new Function('return false;'));
}
return _box;
})(this.container);
this.headerPanel = (function(_width, _height) {
var _headerPanel = document.createElement('DIV');
with (_headerPanel) {
style.width = _width;
style.height = _height;
}
return _headerPanel;
})(this.box.style.width, this.headerHeight);
this.headerPanel.appendChild(this.textPanel = (function() {
var _textPanel = document.createElement('NOBR');
_textPanel.attachEvent('onmousemove', function() {
with (oListView) {
if (event.button == 1) {
textPanel.style.cursor = 'E-resize';
tempSeparate.style.left = event.clientX - getPosition(box).left;
tempSeparate.style.display = 'inline';
endPoint = event.clientX;
isResize = true;
}
}
});
return _textPanel;
})());
this.rowItemPanel = (function(_width, _height) {
var _itemPanel = document.createElement('DIV');
with (_itemPanel) {
style.width = _width;
style.height = _height;
style.overflow = 'hidden';
}
return _itemPanel;
})(this.box.style.width, parseInt(this.box.style.height) - this.headerHeight);
this.rowItemPanel.appendChild(this.dataPanel = (function() {
var _dataPanel = document.createElement('NOBR');
with (_dataPanel) {
style.cursor = 'default';
attachEvent('onclick', function() {
document.selection.empty();
});
attachEvent('onselectstart', function() {
document.selection.empty();
});
}
return _dataPanel;
})());
this.dataPanel.appendChild(this.tempSeparate = (function(_height) {
var _tempSeparate = document.createElement('SPAN');
with (_tempSeparate) {
style.width = '1px';
style.height = _height;
style.border = '0px';
style.backgroundColor = 'black';
style.position = 'absolute';
style.display = 'none';
}
return _tempSeparate;
})(this.rowItemPanel.style.height));
this.box.appendChild(this.headerPanel);
this.box.appendChild(this.rowItemPanel);
this.container.appendChild(this.box);
},
drawListView : function(_headers, _aligns) {
this.boxInit();
this.drawHeader(_headers);
this.drawRowItem(_headers, _aligns);
document.attachEvent('onmouseup', this.finishResize);
},
drawHeader : function(_headers) {
this.headers = [];
this.headerWidth = Math.round((parseInt(this.headerPanel.style.width) - (_headers.length - 1) * 1) / _headers.length) + 1;
for (var i = 0; i ');
}
_tableTr.appendChild(_tableTd);
_tbody.appendChild(_tableTr);
}
_table.appendChild(_tbody);
return _table;
})(this.rowsCount, this.itemWidth, Math.round(this.itemHeight / this.rowsCount)));
}
this.dataPanel.appendChild(_last);
this.items[this.items.length] = _last;
},
getSeparate : function(_resize) {
var _separate = document.createElement('SPAN');
with (_separate) {
style.width = _resize ? '2px' : '1px' ;
style.height = this.headerHeight;
style.border = '1px ' + (_resize ? 'inset white' : 'solid #c6c3c6');
style.overflow = 'hidden';
style.position = 'absolute';
if (_resize) {
attachEvent('onmousedown', function() {
with (oListView) {
separate = event.srcElement;
startPoint = event.clientX;
}
});
attachEvent('onmouseenter', function() {
event.srcElement.style.cursor = 'E-resize';
});
}
}
return _separate;
},
getPosition : function(_object) {
var _top = _left = 0;
var _root = document.body;
while (_object != _root) {
_left += _object.offsetLeft;
_object = _object.offsetParent;
}
return { left: _left };
},
resizeItem : function() {
with (this) {
var _width, _movePart = endPoint - startPoint;
for (var i = 0; i this.rowsCount ? this.rowsCount : _datas.length ;
for (var i = 0; i 编辑 删除'];
_items[_items.length] = ['标题二', '内容二', '2006-6-21 14:20:12', '编辑 删除'];
_items[_items.length] = ['标题三', '内容三', '2006-6-21 20:45:36', '编辑 删除'];
oListView.addListItem(_items);
}
attachEvent('onload', initListView);
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
7.表单多文件上传类 [ASP]
2 Then
ReDim Preserve itemStart(itemCount)
ReDim Preserve itemLength(itemCount)
itemStart(itemCount) = iStart
itemLength(itemCount) = iLength
itemCount = itemCount + 1
End If
Loop
Call FillItemValue
End Function
Private Function FillItemValue
Dim dataPart, bInfor
Dim iStart : iStart = 1
Dim iCount : iCount = 0
Dim iCheck : iCheck = StrToByte("filename")
For i = 0 To itemCount - 1
ReDim Preserve itemName(iCount)
ReDim Preserve itemData(iCount)
ReDim Preserve extenArr(iCount)
ReDim Preserve dataStart(iCount)
ReDim Preserve dataLength(iCount)
dataPart = MidB(formData, itemStart(i), itemLength(i))
iStart = InStrB(1, dataPart, ChrB(34)) + 1
iLength = InStrB(iStart, dataPart, ChrB(34)) - iStart
itemName(iCount) = FormItemName(MidB(dataPart, iStart, iLength))
iStart = InStrB(1, dataPart, bVBCrlf) + 4
iLength = LenB(dataPart) - iStart + 1
If InStrB(1, dataPart, iCheck) > 0 Then
bInfor = MidB(dataPart, 1, iStart - 5)
extenArr(iCount) = FileExtenName(bInfor)
If Mid(folderPath, Len(folderPath) - 1) = "/" Then
itemData(iCount) = folderPath & GetRndName(6) & extenArr(iCount)
Else
itemData(iCount) = folderPath & "/" & GetRndName(6) & extenArr(iCount)
End If
dataStart(iCount) = itemStart(i) + iStart - 2
dataLength(iCount) = iLength
Else
extenArr(iCount) = ""
itemData(iCount) = ByteToStr(MidB(dataPart, iStart, iLength))
dataStart(iCount) = ""
dataLength(iCount) = ""
End If
iCount = iCount + 1
Next
Call SaveUpload
End Function
Private Function FormItemName(byVal bName)
FormItemName = ByteToStr(bName)
End Function
Private Function FileExtenName(byVal bInfor)
Dim pStart, pLength, pContent, regEx
pStart = InStr(1, ByteToStr(bInfor), "filename=" & Chr(34)) + 10
pLength = InStr(pStart, ByteToStr(bInfor), Chr(34)) - pStart
pContent = Mid(ByteToStr(bInfor), pStart, pLength)
If pContent = "" Then
FileExtenName = ""
Else
Set regEx = New RegExp
regEx.Pattern = "^.*(\.[^\.]*)$"
regEx.Global = False
regEx.IgnoreCase = True
FileExtenName = regEx.Replace(pContent, "$1")
Set regEx = Nothing
End If
End Function
Private Function GetRndName(byVal sLen)
Dim regEx, sTemp, arrFields, n : n = 0
Set regEx = New RegExp
regEx.Pattern = "[^\d]*"
regEx.Global = True
regEx.IgnoreCase = True
sTemp = regEx.Replace(Now, "") & "-"
Set regEx = Nothing
arrFields = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", _
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", _
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t", _
"u", "v", "w", "x", "y", "z", "A", "B", "C", "D", _
"E", "F", "G", "H", "I", "J", "K", "L", "M", "N", _
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", _
"Y", "Z")
Randomize
Do While n "") And (dataLength(i) "") Then
If dataLength(i) = 0 Then
itemData(i) = ""
Else
filePath = Server.MapPath(itemData(i))
If CreateFolder("|", ParentFolder(filePath)) Then
Set oStreamGet = Server.CreateObject("ADODB.Stream")
oStreamGet.Type = 1
oStreamGet.Mode = 3
oStreamGet.Open
oStreamGet.Write formData
oStreamGet.Position = dataStart(i)
Set oStreamPut = Server.CreateObject("ADODB.Stream")
oStreamPut.Type = 1
oStreamPut.Mode = 3
oStreamPut.Open
oStreamPut.Write oStreamGet.Read(dataLength(i))
oStreamPut.SaveToFile(filePath)
oStreamGet.Close
Set oStreamGet = Nothing
oStreamPut.Close
Set oStreamPut = Nothing
End If
End If
End If
Next
Finished = True
Call ItemToColl
Else
Finished = False
End If
End Function
Private Function CheckFile
Dim oBoolean : oBoolean = True
If cFields = "" Then
oBoolean = oBoolean And True
Else
For i = 0 To itemCount - 1
If extenArr(i) "" Then
If InStr(1, Ucase(cFields), "|" & Ucase(Mid(extenArr(i), 2)) & "|") > 0 Then
oBoolean = oBoolean And True
Else
sErrors = sErrors & "表单[ " & itemName(i) & " ]的文件格式错误!\n" & _
"支持的格式为:" & Replace(Mid(cFields, 2, Len(cFields) - 1), "|", " ") & "\n\n"
oBoolean = oBoolean And False
End If
End If
Next
End If
CheckFile = oBoolean
End Function
Private Function CreateFolder(byVal sLine, byVal sPath)
Dim oFso
Set oFso = Server.CreateObject("Scripting.FileSystemObject")
If Not oFso.FolderExists(sPath) Then
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(.*)\\([^\\]*)$"
regEx.Global = False
regEx.IgnoreCase = True
sLine = sLine & regEx.Replace(sPath, "$2") & "|"
sPath = regEx.Replace(sPath, "$1")
If CreateFolder(sLine, sPath) Then CreateFolder = True
Set regEx = Nothing
Else
If sLine = "|" Then
CreateFolder = True
Else
Dim sTemp : sTemp = Mid(sLine, 2, Len(sLine) - 2)
If InStrRev(sTemp, "|") = 0 Then
sLine = "|"
sPath = sPath & "\" & sTemp
Else
Dim Folder : Folder = Mid(sTemp, InStrRev(sTemp, "|") + 1)
sLine = "|" & Mid(sTemp, 1, InStrRev(sTemp, "|") - 1) & "|"
sPath = sPath & "\" & Folder
End If
oFso.CreateFolder sPath
If CreateFolder(sLine, sPath) Then CreateFolder = True
End if
End If
Set oFso = Nothing
End Function
Function ParentFolder(byVal sPath)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(.*)\\[^\\]*$"
regEx.Global = True
regEx.IgnoreCase = True
ParentFolder = regEx.Replace(sPath, "$1")
Set regEx = Nothing
End Function
Private Function StrToByte(byVal sText)
For i = 1 To Len(sText)
StrToByte = StrToByte & ChrB(Asc(Mid(sText, i, 1)))
Next
End Function
Private Function ByteToStr(byVal sByte)
Dim oStream
Set oStream = Server.CreateObject("ADODB.Stream")
oStream.Type = 2
oStream.Mode = 3
oStream.Open
oStream.WriteText sByte
oStream.Position = 0
oStream.CharSet = "gb2312"
oStream.Position = 2
ByteToStr = oStream.ReadText
oStream.Close
Set oStream = Nothing
End Function
Private Function ItemToColl
For i = 0 To itemCount - 1
If Not Form.Exists(itemName(i)) Then
Form.Add itemName(i), itemData(i)
End If
Next
End Function
Private Sub Class_Terminate
Form.RemoveAll
Set Form = Nothing
End Sub
End Class
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
Rem 建立上传类实例
Set oUpload = New Upload
Rem 指定允许上传文件的类型
oUpload.CheckFields = "|GIF|BMP|JPG|"
Rem 指定上传文件所存储的相对路径
oUpload.Folder = "51JS.COM-ZMM/UploadFile"
Rem 开始上传处理
oUpload.Start
If oUpload.Finished Then
Rem 上传成功,显示上传信息
Dim sHtml : sHtml = ""
sHtml = sHtml & ""
sHtml = sHtml & "
"
sHtml = sHtml & "上传表单数据
"
sHtml = sHtml & "标题:
" & oUpload.Form("P_title") & "
"
sHtml = sHtml & "类型:
" & oUpload.Form("P_assort") & "
"
sHtml = sHtml & "小图:
服务器端路径:" & oUpload.Form("P_image_s") & "
"
sHtml = sHtml & "中图:
服务器端路径:" & oUpload.Form("P_image_m") & "
"
sHtml = sHtml & "大图:
服务器端路径:" & oUpload.Form("P_image_b") & "
"
sHtml = sHtml & "介绍:
" & oUpload.Form("P_content") & "
"
sHtml = sHtml & "
"
sHtml = sHtml & ""
Response.Write sHtml
Response.End
Else
Rem 上传失败,显示错误信息
Call ShowMsg(oUpload.ErrMessage, Request.ServerVariables("SCRIPT_NAME"))
End If
Rem 对话框提示函数
Function ShowMsg(byVal sText, byVal sTarget)
Dim sScript : sScript = ""
sScript = sScript & "" & vbCrlf & _
"window.alert('" & sText & "');" & vbCrlf & _
"window.location.replace('" & sTarget & "');" & vbCrlf & _
""
Response.Write sScript
Response.End
End Function
End If
%>
多文件、表单混合上传类
body {
margin: 0px;
border: 0px;
font-size: 10pt;
}
table {
border-collapse: collapse;
font-size: 10pt;
}
td {
font-size: 10pt;
}
function formCheck(_form) {
for (var i = 0; i
" method="post" enctype="multipart/form-data" onsubmit="return formCheck(this);">
上传功能测试 | |
标题: | |
类型: |
电子 医疗 |
小图: | |
中图: | |
大图: | |
介绍: | |
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
8.TabPage类
body {
background-color: menu;
}
#oContainer {
width: 500px;
height: 400px;
}
var oTabPage = new Object();
var TabPage = function(_container) {
this.author = '51JS.COM-ZMM';
this.version = 'TabPage 1.0';
this.container = _container;
this.barHeight = 22;
this.put_barHeight = function(_height) { return _height; };
this.get_barHeight = function() { return this.barHeight; };
this.guideWidth = 82;
this.put_guideWidth = function(_width) { return _width; };
this.get_guideWidth = function() { return this.guideWidth; };
}
TabPage.prototype = {
boxInit : function() {
this.box = (function(_object) {
var _box = document.createElement('DIV');
with (_box) {
style.width = _object.offsetWidth;
style.height = _object.offsetHeight;
style.padding = '0px';
}
return _box;
})(this.container);
this.box.appendChild(this.bar = (function(_height) {
var _bar = document.createElement('DIV');
with (_bar) {
align = 'left';
style.width = '100%';
style.height = _height;
style.padding = '0px';
attachEvent('oncontextmenu', new Function('return false'));
attachEvent('onselectstart', new Function('return false'));
}
return _bar;
})(this.barHeight));
this.box.appendChild(this.page = (function(_height) {
var _page = document.createElement('DIV');
with (_page) {
style.width = '100%';
style.height = _height;
style.fontSize = '12px';
style.textAlign = 'left';
style.padding = '5px';
style.borderLeft = '1px solid white';
style.borderRight = '2px outset';
style.borderBottom = '2px outset';
style.backgroundColor = 'menu';
}
return _page;
})(parseInt(this.box.style.height) - this.barHeight));
this.container.appendChild(this.box);
},
addTabPage : function(_guides, _contents) {
this.guides = [];
this.contents = [];
for (var i = 0; i
标题:
来源:
分类: 计算机网络计算机软件
测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试测试
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]