1、网页制作常用代码网页的HTML基本代码贴图:; 加入连接:写上你想写的字;在新窗口打开连接:写上要写的字;移动字体(走马灯):写上你想写的字; 字体加粗:写上你想写的字字体斜体:写上你想写的字; 字体下划线: 写上你想写的字;字体删除线: 写上你想写的字;字体加大: 写上你想写的字;字体控制大小:写上你想写的字(其中字体大小可从h1-h5,h1最大,h5最小);更改字体颜色:写上你想写的字(其中value值在000000与ffffff(16位进制)之间;消除连接的下划线:写上你想写的字;贴音乐:; 贴flash: ;贴影视文件:; 换行:; 段落:段落;原始文字样式:正文;换帖子背景:; 固定
2、帖子背景不随滚动条滚动:;定制帖子背景颜色:(value值见10); 帖子背景音乐:; 贴网页:以下代码是让滚动文字字幕的代码:文字一文字二文字三文字四文字五 里面的参数修改一下,效果将不一样,这里仅提醒一下direction参数,可以改为向下(down)、向左(left)和向右(right)。(网上搜集)自定义鼠标代码a:hover cursor:url(BODY cursor:url(投后广告代码window.open(1.htm,eachnet,toolbar=0);setTimeout(focus();,5); 支持多种格式视频及音频播放代码(wma,wmv,mp3,avi,swf,及
3、rm,rmvb等等) / 说明:autostart=true 为自动播放 true 改 false 则手动播放强制更改网页标题代码-网页放入框架一样显示的标题top.document.title=阳春非凡-飘浮在最前面的浮动广告 =5.5) isie=1; else isie=0; if(isie) var preloadit=new Image() preloadit.src=imagepath function pop() if(isie) x=x+dx;y=y+dy; oPopup.show(x, y, imagewidth, imageheight); if(x+imagewidth+
4、5screen.width) dx=-dx; if(y+imageheight+5screen.height) dy=-dy; if(x0) dx=-dx; if(y0) dy=-dy; startani=setTimeout(pop();,50); function dismisspopup() clearTimeout(startani) oPopup.hide() function dowhat() if (imageclick=dismiss) dismisspopup() else window.open(imageclick); if(isie) var x=0,y=0,dx=sp
5、eed,dy=speed; var oPopup = window.createPopup(); var oPopupBody = oPopup.document.body; oPopupBody.style.cursor=hand oPopupBody.innerHTML = ; oPopup.document.body.onmouseover=new Function(clearTimeout(startani) oPopup.document.body.onmouseout=pop oPopup.document.body.onclick=dowhat pop(); if (hideaf
6、ter0) setTimeout(dismisspopup(),hideafter*1000) / - 1.弹启一个全屏窗口;2.弹启一个被F11化后的窗口;3.弹启一个带有收藏链接工具栏的窗口4.网页对话框参数说明showModalDialog()或是showModelessDialog() 来调用网页对话框,至于showModalDialog()与showModelessDialog()的区别,在于showModalDialog()打开的窗口(简称模式窗口),置在父窗口上,必须关闭才能访问父窗口(建议尽量少用,以免招人反感);showModelessDialog()(简称无模式窗口),打开
7、后不必关闭也可访问父窗口打开的窗口。 dialogHeight: iHeight 设置对话框窗口的高度。 dialogWidth: iWidth 设置对话框窗口的宽度。 dialogLeft: iXPos 设置对话框窗口相对于桌面左上角的left位置。 dialogTop: iYPos 设置对话框窗口相对于桌面左上角的top位置。 center: yes | no | 1 | 0 指定是否将对话框在桌面上居中,默认值是“yes”。help: yes | no | 1 | 0 指定对话框窗口中是否显示上下文敏感的帮助图标。默认值是“yes”。 resizable: yes | no | 1 |
8、0 指定是否对话框窗口大小可变。默认值是“no”。 status: yes | no | 1 | 0 指定对话框窗口是否显示状态栏。对于非模式对话框窗口,默认值是“yes”;对于模式对话框窗口,默认值是 “no”。定义打开网页时起始窗口的大小 window.resizeTo(500,300) 随机数: 查询数据时得到的记录关键字用红色显示:replace(RS(字段X),searchname, & searchname & ) 通过asp的手段来检查来访者是否用了代理% if Request.ServerVariables(HTTP_X_FORWARDED_FOR) then response
9、.write 您通过了代理服务器,& _ 真实的IP为&Request.ServerVariables(HTTP_X_FORWARDED_FOR) end if % 判断上一页的来源request.servervariables(HTTP_REFERER) javascript: document.referrer 清除缓存,重新加载页面 检索并删除数据库里的重复记录conn.execute(delete from table where id not in (select distinct from table) 文件删除函数 % 文件删除函数 function deletefile(fil
10、ename) if filename then set fso=server.CreateObject(scripting.filesystemobject) if fso.FileExists(filename) then fso.DeleteFile filename else Response.Write alert(该文件不存在); end if end if end function strfile=server.MapPath(fileName) deletefile(strfile) % ASP字数计算函数 % Function WordCount(strInput) Dim s
11、trTemp strTemp = Replace(strInput, vbTab, ) strTemp = Replace(strTemp, vbCr, ) strTemp = Replace(strTemp, vbLf, ) 删除字首字尾空格 strTemp = Trim(strTemp) 替换为一个空格 Do While InStr(1, strTemp, , 1) 0 strTemp = Replace(strTemp, , ) Loop WordCount = UBound(Split(strTemp, , -1, 1) +1 End Function % 全正则的检测IP是否合法的函
12、数 function checkIP2(sIPAddress)var exp=/(d1,2|1dd|20-4d|250-5).(d1,2|1dd|20-4d|250-5).(d1,2|1dd|20-4d|250-5).(d1,2|1dd|20-4d|250-5)$/;var reg = sIPAddress.match(exp);var ErrMsg=你输入的是一个非法的IP地址段!nIP段为::xxx.xxx.xxx.xxx(xxx为0-255)! var Msg=你输入的是一个合法的IP地址段! if(reg=null)alert(ErrMsg);elsealert(reg);关闭子窗口时
13、刷新父窗口 在子窗口window.opener.location=父窗口页面window.close() 文本框输入限制:function regInput(obj, reg, inputStr)var docSel = document.selection.createRange()if (docSel.parentElement().tagName != INPUT) return falseoSel = docSel.duplicate()oSel.text = var srcRange = obj.createTextRange()oSel.setEndPoint(StartToStart, srcRange)var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)return reg.test(str)小写英文: 大写英文: 任意数字: 限2位小数: 如: 123.12日 期: 如: 2002-9-29任意中文: input onkeypress = return regInput(this, /$/, String.
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1