`

超炫的网页制作JavaScript特效

    博客分类:
  • JSP
阅读更多
/*----------------------------------飘落的雪花 ---------------------------------*/
注释:放在<head>与</head>之间
<script language=JavaScript>
<!-- Original: Altan (snow@altan.hr) -->
<!-- Web Site: http://www.altan.hr/snow -->
<!-- Smaller flakes, subtle snowfall variables, code beautifcation and makeSnow function by NoSLZZP -->

var no = 8; // snow number
var speed = 12; // smaller number moves the snow faster
var snowflake = "图片名称";

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;    // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 400, doc_height = 500;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = 500;
doc_height = 500;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0;                        // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;         // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random();     // set step variables
if (ns4up) {                      // set layers
    if (i == 0) {
      document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
      document.write("top=\"15\" visibility=\"show\"><img src=\"");
      document.write(snowflake + "\" border=\"0\"></layer>");
    } else {
      document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
      document.write("top=\"15\" visibility=\"show\"><img src=\"");
      document.write(snowflake + "\" border=\"0\"></layer>");
    }
} else if (ie4up) {
    if (i == 0) {
      document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
      document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
      document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
      document.write(snowflake + "\" border=\"0\"></div>");
    } else {
      document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
      document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
      document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
      document.write(snowflake + "\" border=\"0\"></div>");
    }
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
    yp[i] += sty[i];
    if (yp[i] > doc_height-50) {
      xp[i] = Math.random()*(doc_width-am[i]-30);
      yp[i] = 0;
      stx[i] = 0.02 + Math.random()/10;
      sty[i] = 0.7 + Math.random();
      doc_width = self.innerWidth;
      doc_height = self.innerHeight;
    }
    dx[i] += stx[i];
    document.layers["dot"+i].top = yp[i];
    document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}

function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
    yp[i] += sty[i];
    if (yp[i] > doc_height-50) {
      xp[i] = Math.random()*(doc_width-am[i]-30);
      yp[i] = 0;
      stx[i] = 0.02 + Math.random()/10;
      sty[i] = 0.7 + Math.random();
      doc_width = document.body.clientWidth;
      doc_height = document.body.clientHeight;
    }
    dx[i] += stx[i];
    document.all["dot"+i].style.pixelTop = yp[i];
    document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}

if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
</script>


/*----------------------------------------颤动的窗口 ---------------------------*/
注释:可放在网页的任何位置
<script>
function shake(n) {
if (self.moveBy){
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}
}
}
}
shake(12);
</script>


/*--------------------------------------跟随鼠标的星星-------------------------*/
注释:放在<body>与</body>之间
<script>
/*
Scrolling Image Map/Text Link Tooltip Script-
Special Thanks to: Rob(http://rob.yeah.net)
                   Miss Ann(http://annworld.126.com)
*/

if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){

if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}

else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}
</script>
<script language="JavaScript">
function YY_Layerfx(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) { //v1.2
//copyright (c)1999 Yaromat, Jaro von Flocken
if ((document.layers)||(document.all)){
with (Math) {yynextx= eval(yyfnx)}
with (Math) {yynexty= eval(yyfny)}
yycnt=(yyloop && yycnt>=yystep*yybilder)?0:yycnt+yystep;
if (document.layers){
    eval(yydiv+".top="+(yynexty+yytop))
    eval(yydiv+".left="+(yynextx+yyleft))
}
if (document.all){
    eval("yydiv=yydiv.replace(/.layers/gi, '.all')");
    eval(yydiv+".style.pixelTop="+(yynexty+yytop));
    eval(yydiv+".style.pixelLeft="+(yynextx+yyleft));
}
argStr='YY_Layerfx('+yyleft+','+yytop+',"'+yyfnx+'","'+yyfny+'","'+yydiv+'",'+yybilder+','+yyloop+','+yyto+','+yycnt+','+yystep+')';
if (yycnt<=yystep*yybilder){eval(yydiv+".yyto=setTimeout(argStr,yyto)");}
}

}
function YY_Mousetrace(evnt) { //v1.2 copyright (c)1999 Yaromat
if (yyns4)
{if (evnt.pageX) {yy_ml=evnt.pageX; yy_mt=evnt.pageY;} }
else{
   yy_ml=(event.clientX + document.body.scrollLeft);
   yy_mt=(event.clientY + document.body.scrollTop);
}
if (yy_tracescript)eval(yy_tracescript)
}
</script>
<script language="JavaScript">
function PopWin()
{
var PopWin = window.open("new.htm","PopWin","toolbar=no,directries=no,scrollBars=yes,height=350,width=400");
}
</script>
      <div id="tooltip2"
style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:lightyellow">
        <layer name="nstip" width="1000px" bgcolor="lightyellow"> </layer>
      </div>
      <div id="yyd0"
style="position:absolute; left:10px; top:50px; width:3px; height:3px; z-index:1; background-color: #19636c; layer-background-color: #19636c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
      <div
id="yyd1"
style="position:absolute; left:20px; top:50px; width:3px; height:3px; z-index:1; background-color: #708574; layer-background-color: #708574; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
      <div
id="yyd2"
style="position:absolute; left:30px; top:50px; width:3px; height:3px; z-index:1; background-color: #379bbf; layer-background-color: #379bbf; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
      <div
id="yyd3"
style="position:absolute; left:40px; top:50px; width:3px; height:3px; z-index:1; background-color: #25184c; layer-background-color: #25184c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
      <div
id="yyd4"
style="position:absolute; left:50px; top:50px; width:3px; height:3px; z-index:1; background-color: #31bd3c; layer-background-color: #31bd3c; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
      <div
id="yyd5"
style="position:absolute; left:60px; top:50px; width:3px; height:3px; z-index:1; background-color: #c11efd; layer-background-color: #c11efd; border: 1px none #000000; clip: rect(0 3 3 0)"></div>
        <script>
var yyns4=window.Event?true:false; var yy_mt = 0; var yy_ml = 0;
document.onmousemove = YY_Mousetrace;
yy_tracescript = '';

if (yyns4){ document.captureEvents(Event.MOUSEMOVE);
YY_Mousetrace('',',document.YY_Mousetrace1')}

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/39.83007847812662))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/34.224861639800686))+0)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd0\']',2000,true,80,0,1);

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/27.66510707209673))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/9.240632767417667))+30)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd1\']',2000,true,80,0,1);

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/16.45318944579641))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/16.0564452288292))+60)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd2\']',2000,true,80,0,1);

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/6.95348954836835))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/44.13697049887155))+90)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd3\']',2000,true,80,0,1);

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/33.90077294583733))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/2.2378828869411587))+120)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd4\']',2000,true,80,0,1);

YY_Layerfx(0,0,'yy_ml+cos((15*sin(yycnt/37.858312521039835))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','yy_mt+sin((15*sin(yycnt/18.083839795990098))+150)*150*(sin(10+yycnt/20)+0.2)*cos(yycnt/20)','document.layers[\'yyd5\']',2000,true,80,0,1);
</script>
        <script>
/*
Scrolling Image Map/Text Link Tooltip Script-
Special Thanks to: Rob(http://rob.yeah.net)
                   Miss Ann(http://annworld.126.com)
*/

if (!document.layers&&!document.all)
event="test"
function showtip2(current,e,text){

if (document.all&&document.readyState=="complete"){
document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
document.all.tooltip2.style.visibility="visible"
}

else if (document.layers){
document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
document.tooltip2.document.nstip.document.close()
document.tooltip2.document.nstip.left=0
currentscroll=setInterval("scrolltip()",100)
document.tooltip2.left=e.pageX+10
document.tooltip2.top=e.pageY+10
document.tooltip2.visibility="show"
}
}
function hidetip2(){
if (document.all)
document.all.tooltip2.style.visibility="hidden"
else if (document.layers){
clearInterval(currentscroll)
document.tooltip2.visibility="hidden"
}
}

function scrolltip(){
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
document.tooltip2.document.nstip.left-=5
else
document.tooltip2.document.nstip.left=150
}
</script>
        <script language="JavaScript">
function YY_Layerfx(yyleft,yytop,yyfnx,yyfny,yydiv,yybilder,yyloop,yyto,yycnt,yystep) { //v1.2
//copyright (c)1999 Yaromat, Jaro von Flocken
if ((document.layers)||(document.all)){
with (Math) {yynextx= eval(yyfnx)}
with (Math) {yynexty= eval(yyfny)}
yycnt=(yyloop && yycnt>=yystep*yybilder)?0:yycnt+yystep;
if (document.layers){
    eval(yydiv+".top="+(yynexty+yytop))
    eval(yydiv+".left="+(yynextx+yyleft))
}
if (document.all){
    eval("yydiv=yydiv.replace(/.layers/gi, '.all')");
    eval(yydiv+".style.pixelTop="+(yynexty+yytop));
    eval(yydiv+".style.pixelLeft="+(yynextx+yyleft));
}
argStr='YY_Layerfx('+yyleft+','+yytop+',"'+yyfnx+'","'+yyfny+'","'+yydiv+'",'+yybilder+','+yyloop+','+yyto+','+yycnt+','+yystep+')';
if (yycnt<=yystep*yybilder){eval(yydiv+".yyto=setTimeout(argStr,yyto)");}
}

}
function YY_Mousetrace(evnt) { //v1.2 copyright (c)1999 Yaromat
if (yyns4)
{if (evnt.pageX) {yy_ml=evnt.pageX; yy_mt=evnt.pageY;} }
else{
   yy_ml=(event.clientX + document.body.scrollLeft);
   yy_mt=(event.clientY + document.body.scrollTop);
}
if (yy_tracescript)eval(yy_tracescript)
}
</script>
        <script language="JavaScript">
function PopWin()
{
var PopWin = window.open("new.htm","PopWin","toolbar=no,directries=no,scrollBars=yes,height=350,width=400");
}
</script>

/*-----------------------------------禁止点击鼠标右键--------------------------*/
注释:放在<head>与</head>之间
<script language="javascript">
function click() {
if (event.button==2) {
alert('警告内容')
}
}
document.onmousedown=click
</script>


/*-----------------------------------变色文本----------------------------------*/
注释:放在<body>与</body>之间
<p onMouseMove="hello()">文本内容</p>
<script language="VBScript">
sub hello
document.fgColor=int(256*256*256*rnd)
end sub
</script>


/*-----------------------------文本永远在窗口的顶端--------------------------*/
注释:放在<body>与</body>之间
<div id="KBStatic" style="position:absolute; left:3px; top:0px; width:553px; height:70px; z-index:25">
                    <font size="5">文本内容 </font></div>
                  <script language=JavaScript>
function KB_keepItInIE(theName,theWantTop,theWantLeft) {
theRealTop=parseInt(document.body.scrollTop)
theTrueTop=theWantTop+theRealTop
document.all[theName].style.top=theTrueTop
theRealLeft=parseInt(document.body.scrollLeft)
theTrueLeft=theWantLeft+theRealLeft
document.all[theName].style.left=theTrueLeft
}
function KB_keepItInNN(theName,theWantX,theWantY) {
theRealLay=document.layers[theName]
theBadX=self.pageYOffset
theBadY=self.pageXOffset
theRealX=theBadX+theWantX
theRealY=theBadY+theWantY
theRealLay.moveTo(theRealY,theRealX)
}
IE4=(document.all)?1:0
NN4=(document.layers)?1:0
if (IE4)
setInterval('KB_keepItInIE("KBStatic",0,0)',1)
if (NN4)
setInterval('KB_keepItInNN("KBStatic",0,0)',1)
</script>


/*----------------------------------图形淡出淡隐-------------------------------*/
注释:放在<body****>里
<img src="图形的文件名" name="u" border=0
alt="Image" style="filter:alpha(opacity=0)">
<script language="JavaScript">

var b = 1;
var c = true;

function fade(){
if(document.all);

if(c == true) {
b++;
}
if(b==100) {
b--;
c = false
}

if(b==10) {
b++;
c = true;
}

if(c == false) {
b--;
}
u.filters.alpha.opacity=0 + b;
setTimeout("fade()",50);
}
</script>


/*--------------------------------变换图形------------------------------*/
注释:放在<body>与</body>之间
<script language="JavaScript">
<!--

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
    endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr)); }

function FixCookieDate (date) {
var base = new Date(0);
var skew = base.getTime(); // dawn of (Unix) time - should be 0
if (skew > 0) // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew); }

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; }
return null;   }

// assign expiration date variable for cookie

var expdate = new Date ();
FixCookieDate(expdate);
expdate.setTime(expdate.getTime() + (5 * 60 * 1000)) // 5 minutes

// initialize countimg variable to track images
countimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")-1) : -1
countimg = (countimg <-1) ? -1 : countimg
IMGArray = new Array(3)

if (document.images) {
IMGArray[0] = new Image(205,56)
IMGArray[1] = new Image(205,56)
IMGArray[2] = new Image(205,56) }

// Old browsers get an array of empty strings

else {
IMGArray[0] = ""
IMGArray[1] = ""
IMGArray[2] = ""        }

IMGArray[0].src = "图形一的文件名"
IMGArray[0].URL = "链接地址 http "
IMGArray[1].src = "图形二的文件名"
IMGArray[1].URL = "链接地址 http"
IMGArray[2].src = "图形三的文件名"
IMGArray[2].URL = "链接地址 http"


function updateIM(countimg) { return countimg; }

// functions for onMouseOver, onMouseOut, onClick event handlers

function Overhref2() { updateIM(countimg)
if (IMGArray[countimg] != null ) {
window.status = IMGArray[countimg].URL; return true; }}

function Outhref2() { window.status = ""; return true; }

function clickhref2() { updateIM(countimg)
if (IMGArray[countimg] != null ) {
location = IMGArray[countimg].URL }}

// Image swapping function

function showIMAGE() { updateIM(countimg++)

if (document.images) {

// Make sure countimg does'nt get too big

if ( countimg > IMGArray.length - 1 ) { countimg = IMGArray.length - IMGArray.length }

document.images.banner.src = IMGArray[countimg].src
exbannerID = setTimeout("showIMAGE()",2500) }}


function setIt2() { updateIM(countimg)
document.cookie = "countimg=" + countimg + "; expires=" + expdate.toGMTString() }

// get cookie countimg onblur, onload

function getIt2() {
countimg = (GetCookie("countimg") != null) ? (GetCookie("countimg")) : 0
updateIM(countimg)
if (exbannerID != null) { clearTimeout(exbannerID); showIMAGE() }}

function initCOOKIES() {

window.onunload = setIt2
window.onfocus = getIt2
window.onblur = setIt2 }

function initBANNER() {

showIMAGE()
cookieID = setTimeout("initCOOKIES()",1000) }

window.onload = initBANNER

// -->
</script>
<a href="" onClick="clickhref2()" onMouseOver="Overhref2();return true;" onMouseOut="Outhref2;return true;"><img src="" name="banner" border="0" ></a>


/*----------------------------------记录来宾姓名------------------------------*/
注释:放在<head>与</head>之间
<script language="JavaScript">
<!-- Begin
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function Who(info){
var VisitorName = GetCookie('VisitorName')
if (VisitorName == null) {
VisitorName = prompt("您的尊姓大名:");
SetCookie ('VisitorName', VisitorName, exp);
}
return VisitorName;
}
function When(info){
var rightNow = new Date()
var WWHTime = 0;
WWHTime = GetCookie('WWhenH')
WWHTime = WWHTime * 1
var lastHereFormatting = new Date(WWHTime);
var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
var lastHereInDateFormat = "" + lastHereFormatting;
var dayOfWeek = lastHereInDateFormat.substring(0,3)
var dateMonth = lastHereInDateFormat.substring(4,11)
var timeOfDay = lastHereInDateFormat.substring(11,16)
var year = lastHereInDateFormat.substring(23,25)
var WWHText = dayOfWeek + ", " + dateMonth + " at " + timeOfDay
SetCookie ("WWhenH", rightNow.getTime(), exp)
return WWHText
}
function Count(info){
var WWHCount = GetCookie('WWHCount')
if (WWHCount == null) {
WWHCount = 0;
}
else{
WWHCount++;
}
SetCookie ('WWHCount', WWHCount, exp);
return WWHCount;
}
function set(){
VisitorName = prompt("Who are you?");
SetCookie ('VisitorName', VisitorName, exp);
SetCookie ('WWHCount', 0, exp);
SetCookie ('WWhenH', 0, exp);
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)  
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {  
var j = i + alen;  
if (document.cookie.substring(i, j) == arg)    
return getCookieVal (j);  
i = document.cookie.indexOf(" ", i) + 1;  
if (i == 0) break; 
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +  
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
// End -->
</script>
注释:放在<body>与</body>之间
<script language="JavaScript">
if (Count()==0)
{
document.write("您好!" + Who() + ". 您首次来这儿,请多提宝贵意见.");
}
else
{
document.write("您好!" + Who() + ". 您已来这儿 " + Count() + "次了,最后一次在 " + When() +".");
}
</script>


/*----------------------------------记录浏览次数-------------------------------*/
注释:放在<body>与</body>之间
<script language="JavaScript">
<!--
var caution = false
function setCookie(name, value, expires, path, domain, secure) {
        var curCookie = name + "=" + escape(value) +
                ((expires) ? "; expires=" + expires.toGMTString() : "") +
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                ((secure) ? "; secure" : "")
        if (!caution || (name + "=" + escape(value)).length <= 4000)
                document.cookie = curCookie
        else
                if (confirm("Cookie exceeds 4KB and will be cut!"))
                        document.cookie = curCookie
}

function getCookie(name) {
        var prefix = name + "="
        var cookieStartIndex = document.cookie.indexOf(prefix)
        if (cookieStartIndex == -1)
                return null
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
        if (cookieEndIndex == -1)
                cookieEndIndex = document.cookie.length
        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}

function deleteCookie(name, path, domain) {
        if (getCookie(name)) {
                document.cookie = name + "=" +
                ((path) ? "; path=" + path : "") +
                ((domain) ? "; domain=" + domain : "") +
                "; expires=Thu, 01-Jan-70 00:00:01 GMT"
        }
}

function fixDate(date) {
        var base = new Date(0)
        var skew = base.getTime()
        if (skew > 0)
                date.setTime(date.getTime() - skew)
}

var now = new Date()
fixDate(now)
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)
var visits = getCookie("counter")
if (!visits)
        visits = 1
else
        visits = parseInt(visits) + 1
setCookie("counter", visits, now)
document.write("朋友您已来这儿" + visits + "次.")

// -->
</script>


/*-----------------------------------进入网页警告------------------------------*/
注释:放在<head>与</head>之间
<script language="JavaScript">
alert("警告内容 ")
</script>


/*--------------------------------------模拟病毒-------------------------------*/
注释:放在<body>与</body>之间
<script language=JavaScript>
function hassl() {
;alert('警告,我是黑黑病毒,已侵入你的系统!!!')
;alert('我现在已经驻在你家里,你欢迎我么????')
;alert('你的硬盘文件将会被我“吃掉“,哈哈....')
;alert('我是不是很“黑“,现在才知道么?太晚了!!!')
;alert('我要开始工作了,,,,,,。。')
;alert('我正在大口的嚼,你的Command文件真香^_^')
;alert('你怕不怕,你一定要记住我黑黑。。。')
confirm('黑黑懒懒洋洋的伸了伸腰,真的好舒服。')
;alert('我现在要格式么你的硬盘了,你做好准备了么???')
;alert('One..Two..Three..现在开始^_^')
;alert('10%')
;alert('20%')
;alert('25%')
;alert('40%')
;alert('50%')
;alert('60%')
;alert('65%')
;alert('70%')
;alert('79%')
;alert('80%')
;alert('90%')
;alert('98%')
;alert('100%')
;alert('不要害怕,你的硬盘丝毫未损,先跟你开个玩')
;alert('现在要开始了,要小心!!!!')
;alert('10%')
;alert('30%')
;alert('55%')
;alert('70%')
;alert('80%')
;alert('90%')
;alert('95%')
;alert('100%')
;alert('complete')
;alert('黑黑已成功的侵犯了你的系统,黑黑在得意的^_^..^_^...')
;alert('你的系统已被锁定%±÷#(')
;alert('黑黑睁开笑眯眯的眼睛,突然大吼道“我要吃掉所有的文件”....')
confirm('黑黑的老臊隐,总是发个没完')
;alert('我黑黑算是病毒么?')

;alert('我自己也搞不清楚')
;alert('我算是一个又黑又不黑的玩意')
;alert('黑黑有些累了,看来我不想吃你的“东西”,其实我一些在跟你开玩笑,')
;alert('黑黑要跟你说再见,黑黑其实是个好孩子')

}
</script>
<input type="button" value="模拟病毒" onClick="hassl()" name="button">


/*-------------------------------带开关的From时钟----------------------------*/
注释:放在<body>与</body>之间
<script language="JavaScript">
  

var enabled=0;  

function TOfunc() {     


TO = window.setTimeout( "TOfunc()", 1000
);     


var today = new Date();     


document.clock.disp.value =
today.toLocaleString();

}

</script>
<form name="clock">
<input type="text" name="disp" value="" size=20
onFocus="this.blur()" >
<br>
<input type="radio" name="rad" value="off"
onClick="
if( enabled==1 )
    {
     document.clock.disp.value='';
     clearTimeout( TO );
     enabled = 0;
     }
   " checked>
关<font color="#FFFF99"> </font>
<input type="radio" name="rad" value="on"
onClick="
     if( enabled == 0 ) {
        var TO = setTimeout( 'TOfunc()', 1000 );
        enabled = 1;     }" >
开<font color="#FFFF99"> </font>
</form>
为了您的安全,请只打开来源可靠的网址

打开网站    取消
来自: http://hi.baidu.com/ramanda%5Fko/blog/item/2d63d509c4f2ad39e8248847.html

分享到:
评论

相关推荐

    javascript超炫特效

    9. **响应式设计**:JavaScript可以检测屏幕尺寸和设备类型,从而调整布局和特效,实现跨平台的优秀用户体验。 10. **拖放功能**:通过JavaScript实现的拖放API,用户可以直观地将元素从一处移动到另一处,适用于...

    网页超炫html特效代码全集

    这些代码利用HTML、CSS以及JavaScript等技术,实现诸如动态显示IP地址、滚动文字、背景动画、透明度变化、字体特效等多种功能,使得网页设计更加生动、吸引人。下面将详细介绍这些特效的具体实现方式和应用场合。 1...

    javascript 超炫的分页特效

    在网页设计中,分页是一种常见的用户界面元素,用于处理大量数据或内容的展示。当一个页面无法容纳所有信息时,分页可以帮助用户逐步浏览,提高用户体验。"javascript 超炫的分页特效"这一主题,正是关注如何利用...

    超炫的banner图特效

    在IT行业中,网页设计是至关重要的一环,而其中的元素如banner图,更是网页视觉表现力的核心部分。本文将深入探讨“超炫的banner图特效”这一主题,它结合了3D、HTML5以及随机特效,为用户带来极具吸引力的交互体验...

    网页的一些超酷超炫特效

    网页特效是网页设计中不可或缺的一部分,它们通过JavaScript和其他前端技术实现,为用户带来生动、交互性强的视觉体验。本文将深入探讨网页特效的原理、应用以及如何利用JavaScript来创造超酷超炫的特效。 首先,...

    asp 网页特效 图片展示 超炫

    ASP(Active Server Pages...总的来说,这个主题涵盖了ASP动态网页开发、JavaScript特效编程以及前端用户体验设计等多个方面,对于任何想要提升其网站互动性和视觉吸引力的开发者来说,都是一个非常有价值的学习资源。

    超炫的导航菜单(JavaScript)

    在网页设计中,导航菜单是不可或缺的一部分,它帮助用户在网站的不同页面间轻松跳转。本文将深入探讨“超炫的导航菜单”这一主题,它利用JavaScript技术实现了动态的、视觉效果丰富的交互式菜单。 首先,我们要理解...

    javascript超炫的效果100个

    在这个"javascript超炫的效果100个"的资源包中,包含了众多用JavaScript实现的创新和引人入胜的特效,这些效果可以极大地提升用户体验,吸引用户注意力。 1. **动画效果**:JavaScript可以通过修改CSS属性或者直接...

    超炫的网页特效3D效果,肯定你没有见过的哦

    在网页设计领域,3D效果是一种引人注目的技术,它可以极大地提升用户的浏览体验,让网页看起来更加生动、立体和专业。"超炫的网页特效3D效果"这个主题涵盖了许多创新的技术和方法,用于创建令人惊叹的视觉表现。下面...

    javascript-10种超炫时钟特效

    在这个“javascript-10种超炫时钟特效”资源中,你将找到一系列利用JavaScript实现的创新时钟展示效果。这些特效不仅能够提升网页的视觉吸引力,还能在实用性和艺术性之间取得平衡。 1. **纯CSS3时钟**:虽然标题中...

    JS 超炫 鼠标开花 特效

    JavaScript(简称JS)是一种轻量级的脚本语言,常用于网页和网络应用开发,能够实现动态内容、用户交互、页面行为控制...在实际开发中,这种特效可以提升网站的吸引力,增加用户停留时间,是网页设计中的一个重要元素。

    超炫的html5特效相册 超养眼的素材图片

    HTML5是一种先进的网页开发技术,它为网页设计者和开发者提供了更多创新和交互性的可能性。在本资源包中,"超炫的html5特效...对于想要提升网页设计技能或者寻找独特图片展示方式的人来说,这是一个极具价值的资源。

    js超炫抖动焦点图代码 js超炫抖动焦点图网页特效.zip

    在网页设计中,焦点图是一种常见的元素,用于展示一系列图片或内容,并且通过某种交互方式让用户可以方便地浏览这些内容。在这个"js超炫抖动焦点图代码 js超炫抖动焦点图网页特效.zip"压缩包中,包含了实现这样一个...

    网页设计期末作业,基于HTML+CSS+JavaScript超酷超炫的汽车类企业网页).md

    ### 知识点总结 #### 一、网页设计期末...通过以上分析可以看出,这份期末作业不仅包含了基础的HTML+CSS+JavaScript知识,还涉及到了网页设计的一些高级概念和技术实践,非常适合想要深入了解前端开发的学生或初学者。

    HTML5CSS3实现的超炫卡片抽出动画特效源码.zip

    总结起来,"HTML5CSS3实现的超炫卡片抽出动画特效"展示了这两项技术在现代网页设计中的强大能力。HTML5提供了丰富的网页结构和多媒体支持,而CSS3则通过高效的动画机制赋予网页动态之美。通过理解和学习这个源码,...

    超炫3D般的页面特效汇集

    总的来说,这个"超炫3D般的页面特效汇集"是学习和探索3D网页设计的宝贵资源,涵盖了从基本的3D概念到高级的WebGL应用的广泛知识。通过深入研究这个集合,开发者不仅可以提升自己的3D编程技能,还能了解到如何将这些...

    超炫3D下拉菜单网页特效

    超炫3D下拉菜单网页特效是一种创新的交互设计,它为网站的导航菜单赋予了三维视觉效果,提升了用户体验和网站的吸引力。这种特效通常基于HTML5、CSS3以及JavaScript等现代Web技术实现,能够为用户带来更加生动、立体...

    H5超炫动画特效

    在现代网页设计中,H5(HTML5)已经成为了不可或缺的一部分,它为开发者提供了更多的可能性,特别是在动画特效方面。本文将深入探讨H5中的超炫火焰动画特效,这对于初学者和寻求提升H5动效的开发者来说,是一个极好...

    jQuery和CSS3超炫旋转环状菜单特效.zip

    在网页设计和开发中,jQuery和CSS3是两个非常重要的技术。它们的结合可以创造出许多引人注目的交互效果,其中“超炫旋转环状菜单特效”就是一种典型的实例。这个压缩包文件“jQuery和CSS3超炫旋转环状菜单特效.zip”...

    超炫JQuery照片墙特效

    【超炫JQuery照片墙特效】是一种常见的网页交互设计,主要利用JQuery库来实现动态、引人入胜的图片展示效果。这种特效通常应用于个人作品集、摄影网站或者产品展示页面,为用户提供一个视觉上吸引人的浏览体验。在本...

Global site tag (gtag.js) - Google Analytics