<![CDATA[畅想博客-CxBlog - 常用代码]> http://www.cxblog.net/ zh-cn PBlog2 v2.4 畅想博客-CxBlog http://www.cxblog.net/images/logos.gif http://www.cxblog.net/ 畅想博客-CxBlog http://www.cxblog.net/default.asp?id=365 <![CDATA[上下条代码]> lyjier@163.com(lyjier) Wed,23 May 2012 18:47:49 +0800 http://www.cxblog.net/default.asp?id=365
程序代码 程序代码
<%
Set rs1=Server.CreateObject("Adodb.RecordSet")
rs1.Open "Select top 1 * from products where ID < "&dbid1&" order by id desc",conn,1,1
IF not rs1.eof and not rs1.bof Then
response.write"上一条:<a href='display_products.asp?id="&rs1("id")&"&type_id="&rs1("typeid")&"'>"&rs1("name")&"</a><br>"
else
response.write"没有上一条<br>"
end if
rs.close
set rs1=nothing
Set rs1=Server.CreateObject("Adodb.RecordSet")
rs1.Open "Select top 1 * from products where ID > "&dbid1&" order by id",conn,1,1
IF not rs1.eof and not rs1.bof Then
response.write"下一条:<a href='display_products.asp?id="&rs1("id")&"&type_id="&rs1("typeid")&"'>"&rs1("name")&"</a>"
else
response.write" 没有下一条"
end if
rs1.close
set rs1=nothing%>
]>
http://www.cxblog.net/default.asp?id=358 <![CDATA[阿里旺旺的在线图标]> lyjier@163.com(ier00) Sat,22 Aug 2009 15:54:30 +0800 http://www.cxblog.net/default.asp?id=358 <a target='_blank' href=&"http://web.im.alisoft.com/msg.aw" target="_blank">http://web.im.alisoft.com/msg.aw&uid=senzer&site=cnalichn&s=1' ><img border='0' src=&"http://web.im.alisoft.com/online.aw?v=2" target="_blank">http://web.im.alisoft.com/online.aw?v=2&uid=senzer&site=cnalichn&s=1' alt='发送旺旺即时消息' /></a>

  (补充一句,这个代码只能在IE中正常调用旺旺程序,对于firefox则调用不了,而是转到了要你下载旺旺的页面)

  代码中参数的含义:
  uid=zenzer  改成你的旺号或者阿里旺旺的帐号名
  site=cnalichn  这个不能改,改了就会显示叉叉,无法识别帐号
  s=1 1代表样式 ]>
http://www.cxblog.net/default.asp?id=354 <![CDATA[网页简繁体的转换]> lyjier@163.com(lyjier) Sat,25 Apr 2009 10:41:03 +0800 http://www.cxblog.net/default.asp?id=354
以下是transform.js文件代码:
<script type=“text/javascript” language=“javascript”>
function s2t()
{document.body.innerHTML = document.body.innerHTML.s2t();}
function t2s()
{document.body.innerHTML = document.body.innerHTML.t2s();}
</script>

在网页的适当位置添加简繁转换链接:
<a href=“javascript:s2t()”>繁体中文</a>
<a href=“javascript:t2s()”>简体中文</a>
]>
http://www.cxblog.net/default.asp?id=352 <![CDATA[删除系统LJ批处理文件代码]> lyjier@163.com(lyjier) Fri,17 Apr 2009 08:57:48 +0800 http://www.cxblog.net/default.asp?id=352 echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!
echo. & pause ]>
http://www.cxblog.net/default.asp?id=351 <![CDATA[自定义鼠标指针代码]> lyjier@163.com(lyjier) Fri,19 Dec 2008 08:26:36 +0800 http://www.cxblog.net/default.asp?id=351 style="CURSOR: url(&)"

加的位置在<table 代码></table>

]>
http://www.cxblog.net/default.asp?id=350 <![CDATA[DIV滚动代码]> lyjier@163.com(lyjier) Wed,17 Dec 2008 08:32:57 +0800 http://www.cxblog.net/default.asp?id=350
HTML代码


[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
]>
http://www.cxblog.net/default.asp?id=348 <![CDATA[几种网页飘浮代码]> lyjier@163.com(lyjier) Fri,12 Dec 2008 18:29:26 +0800 http://www.cxblog.net/default.asp?id=348 <!--
//图片地址
var hbcms_img_src = 'mv1.gif';
//连接的网址
var hbcms_img_url = &"http://www.cxblog.net" target="_blank">http://www.cxblog.net';
//图片宽度
var hbcms_img_w = '120';
//图片高度
var hbcms_img_h = '120';
var hbcms_img_alt = '畅想博客';

document.write('<div id=dd style="Z-INDEX: 1; WIDTH: '+hbcms_img_w+'px; POSITION: absolute; HEIGHT: '+hbcms_img_h+'px"> <a href="'+hbcms_img_url+'"><img src=&"http://www.cxblog.net/" target="_blank">http://www.cxblog.net/)整理修改
function hbcms_changePos() {
width = document.body.clientWidth; // 判断浏览器窗口的宽度
height = document.body.clientHeight; // 判断浏览器窗口的高度
Hoffset = dd.offsetHeight;
Woffset = dd.offsetWidth;
dd.style.left = xPos + document.body.scrollLeft;
dd.style.top = yPos + document.body.scrollTop;
if (yon) {
yPos = yPos + step;
}
else {
yPos = yPos - step;
}
if (yPos < 0) {
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset)) {
yon = 0;
yPos = (height - Hoffset);
}
if (xon) {
xPos = xPos + step;
}
else {
xPos = xPos - step;
}
if (xPos < 0) {
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset)) {
xon = 0;
xPos = (width - Woffset);
}
}

function hbcms_start_pp() {
dd.visibility = "visible";
interval = setInterval('hbcms_changePos()', delay);
}
function pause_resume() {
if(pause) {clearInterval(interval);pause = false;}
else {interval = setInterval('hbcms_changePos()',delay);pause = true;}
}
hbcms_start_pp();

//-->


第二种
var pngbrOK=false;
var mie=false;
var aver=parseInt(navigator.appVersion.substring(0,1));
var aname=navigator.appName;
var pngmystop=0;

function pngcheckbrOK()
{if(aname.indexOf("Internet Explorer")!=-1)
{if(aver>=4) pngbrOK=navigator.javaEnabled();
mie=true;
}
if(aname.indexOf("Netscape")!=-1)  
{if(aver>=4) pngbrOK=navigator.javaEnabled();}
}
var vmin=2;
var vmax=5;
var vr=2;
var timer1;

function pngchip(chipname,width,height)
{
this.named=chipname;
this.vx=vmin+vmax*Math.random();
this.vy=vmin+vmax*Math.random();
this.w=width;
this.h=height;
this.xx=0;
this.yy=0;
this.timer1=null;
}

function pngmovechip(chipname)
{
if(pngbrOK && pngmystop==0)
{eval("pngchip="+chipname);
if(!mie)
{pageX=window.pageXOffset;
pageW=window.innerWidth;
pageY=window.pageYOffset;
pageH=window.innerHeight;
}
else
{pageX=window.document.body.scrollLeft;
pageW=window.document.body.offsetWidth-8;
pageY=window.document.body.scrollTop;
pageH=window.document.body.offsetHeight;
}
pngchip.xx=pngchip.xx+pngchip.vx;
pngchip.yy=pngchip.yy+pngchip.vy;
pngchip.vx+=vr*(Math.random()-0.5);
pngchip.vy+=vr*(Math.random()-0.5);
if(pngchip.vx>(vmax+vmin))  pngchip.vx=(vmax+vmin)*2-pngchip.vx;
if(pngchip.vx<(-vmax-vmin)) pngchip.vx=(-vmax-vmin)*2-pngchip.vx;
if(pngchip.vy>(vmax+vmin))  pngchip.vy=(vmax+vmin)*2-pngchip.vy;
if(pngchip.vy<(-vmax-vmin)) pngchip.vy=(-vmax-vmin)*2-pngchip.vy;
if(pngchip.xx<=pageX)
{pngchip.xx=pageX;
pngchip.vx=vmin+vmax*Math.random();
}
if(pngchip.xx>=pageX+pageW-pngchip.w)
{pngchip.xx=pageX+pageW-pngchip.w;
pngchip.vx=-vmin-vmax*Math.random();
}
if(pngchip.yy<=pageY)
{pngchip.yy=pageY;
pngchip.vy=vmin+vmax*Math.random();
}
if(pngchip.yy>=pageY+pageH-pngchip.h)
{pngchip.yy=pageY+pageH-pngchip.h;
pngchip.vy=-vmin-vmax*Math.random();
}
if(!mie)
{eval('document.'+pngchip.named+'.top ='+pngchip.yy);
eval('document.'+pngchip.named+'.left='+pngchip.xx);
}
else
{eval('document.all.'+pngchip.named+'.style.pixelLeft='+pngchip.xx);
eval('document.all.'+pngchip.named+'.style.pixelTop ='+pngchip.yy);
}
pngchip.timer1=setTimeout("pngmovechip('"+pngchip.named+"')",100);
}
}
function pngstop(x)
{
pngbrOK=true;
pngmystop=x;
pngmovechip("pngtome");
}
var pngtome;
var pngchip;
function pngtome()
{pngcheckbrOK();
pngtome=new pngchip("pngtome",80,80);
if(pngbrOK)
{ pngmovechip("pngtome");
}
}

ns4=(document.layers)?true:false;
ie4=(document.all)?true:false;

function pngover()
{
if(ns4){
//document.png.left=window.innerWidth/2-400;
eval('document.png.left=document.'+pngchip.named+'.left');
eval('document.png.top=document.'+pngchip.named+'.top-0');
document.png.visibility="show";
}else if(ie4)
{
//document.all.png.style.left=window.document.body.offsetWidth/2-400;
document.all.png.style.left=parseInt(document.all.pngtome.style.left);
document.all.png.style.top=parseInt(document.all.pngtome.style.top)-20;
document.all.png.style.visibility="visible";
pngstop(1);
}
}

function pngout()
{
if(ns4){
document.png.visibility="hide";
}else if(ie4)
{
document.all.png.style.visibility="hidden";
pngstop(0);
}
}

document.write("<div id='pngtome' style='position:absolute;'><a href='News_View.asp?NewsID=878' onMouseOver=pngover() onMouseOut=pngout() target='_blank'><img src=xiaokang.gif border=0 ></a>"

+" </div>");
pngtome()

以上两种存成JS格式,在需要的页面调用即可!
调用方式:<script language="JavaScript" src="mv.js"></script>


第三种
<!--图片漂浮广告代码开始-->
<div id="www_qpsh_com" style="position:absolute">
<a href="news_more.asp?lm=&lm2=51" target="_blank">
<img src="mv2.gif" border="0">
</a>
</div>
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getElementById("www_qpsh_com")
function floatwww_qpsh_com() {
var L=T=0
//by www.1wd.cc
var R= document.body.clientWidth-obj.offsetWidth
var B = document.body.clientHeight-obj.offsetHeight
obj.style.left = x + document.body.scrollLeft
obj.style.top = y + document.body.scrollTop
x = x + step*(xin?1:-1)
if (x < L) { xin = true; x = L}
if (x > R){ xin = false; x = R}
y = y + step*(yin?1:-1)
if (y < T) { yin = true; y = T }
if (y > B) { yin = false; y = B }
}
var itl= setInterval("floatwww_qpsh_com()", delay)
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("floatwww_qpsh_com()", delay)}
</script>
<!--图片漂浮广告代码结束-->]>
http://www.cxblog.net/default.asp?id=344 <![CDATA[Iframe自适应高度]> lyjier@163.com(lyjier) Wed,03 Sep 2008 16:03:54 +0800 http://www.cxblog.net/default.asp?id=344 http://www.cxblog.net/default.asp?id=341 <![CDATA[随机刷新变换不同图片]> lyjier@163.com(lyjier) Thu,19 Jun 2008 19:18:06 +0800 http://www.cxblog.net/default.asp?id=341 <!--
imglink=new Date();
var thisimg="../image/index_dreamweaver.gif";
if(imglink.getSeconds()<54){var thisimg="1.gif";}
if(imglink.getSeconds()<46){var thisimg="2.gif";}
if(imglink.getSeconds()<39){var thisimg="3.gif";}
if(imglink.getSeconds()<32){var thisimg="4.gif";}
if(imglink.getSeconds()<24){var thisimg="5.gif";}
if(imglink.getSeconds()<17){var thisimg="6.gif";}
if(imglink.getSeconds()<9){var thisimg="7";}
document.write("<img src="+thisimg+" border=0 alt='每次打开本页,看到的图片都不同!'>");
//-->
</script>]>
http://www.cxblog.net/default.asp?id=338 <![CDATA[播放自主控制代码]> lyjier@163.com(lyjier) Fri,25 Apr 2008 11:15:19 +0800 http://www.cxblog.net/default.asp?id=338 <A href="javascript:document.wma.play()" target=_self>开</A>
<A href="javascript:document.wma.stop()" target=_self >关</A>]>