Finishing posts: Add effects to the blog (counter, weather forecast, exquisite flash clock, follow the mouse of the Firefly, follow the mouse text, status bar text, subtitle motto, etc.)

Source: Internet
Author: User
Tags cos eval sin visibility

Example:http://blog.csdn.net/kvw3000
This article is collected and sorted out, thanks to each segment of the code provider.

Finishing: Go home and Chant (Wang Jitai)

1. Announcements and Counters
2. Weather forecast
3. The firefly following the mouse
4. Status bar text
5. Follow the mouse text
6. Automatically displays a different maxim at the top subtitle position each time it is opened
7. Flash exquisite Clock (add)

The appropriate functionality can be achieved by adding the following statement to the static news/declaration in the "options"-> configuration:

1. Bulletin and Counter code:

The code fills in the static news/declaration, the current code is as follows: (where <script language=javascript src= "' >http://laoan.com/counters/count.php?kvw3000" ></script> for free counter applications in http://www.laoan.com/counters/, pay attention to changing the following kvw3000 to your own application account)

</br>
Personal Profile </br>
NET name: Go home Chanting (kv300) </br>
Qq:107336063</br>
<small>msn:<a href= "mailto:wjt2000@etang.com" >kvw3000@hotmail.com</a></small></br ></br>

From: Xian </br>

-------------------------------</br>
Visit Volume:
<script language=javascript src= "' >http://laoan.com/counters/count.php?kvw3000" ></script></br >
-------------------------------

2. Add "Weather forecast" function to blog

<p><b> Weather Today </b><br>
<center><iframe width=157 height=240 frameborder=0 scrolling=no src= ' http://appnews.qq.com/cgi-bin/news_qq _search?city= ' ></iframe></center>

To change the default province, just add it to the back of the city=, but that province is in the list.

Will:
city=
To be replaced by:
city= Shanghai
On it, but first look at the list of the city of Shanghai, if there are some words added.

3. The firefly following the mouse

Here's the code, no need to modify
<script language= "JavaScript" >
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
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) {
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>
<body>
<div id= "tooltip2" style= "Position:absolute;visibility:hidden;clip:rect (0 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>
</body>


4. Add "status bar Text" feature to blog

<script language=javascript>
The Var message= "welcome you to come home to chant the small station in person"
var position=100
var delay=10
var scroll=new statusmessageobject ()
function Statusmessageobject (p,d)
{
This.msg =message
This.out = ""
This.pos =position
This.delay=delay
This.i=0
This.reset=clearmessage
}
function Clearmessage ()
{
This.pos=position
}
function Scroller ()
{
for (scroll.i=0;scroll.i<scroll.pos;scroll.i++) {
Scroll.out = ""}
if (scroll.pos >= 0)
Scroll.out + + scroll.msg
else Scroll.out=scroll.msg.substring (-scroll.pos,scroll.msg.length)
Window.status=scroll.out
Scroll.out= ""
scroll.pos--
if (Scroll.pos <-(scroll.msg.length)) {
Scroll.reset ()}
SetTimeout (' scroller () ', Scroll.delay)
}
Function Snapin (jumpspaces,position)
{
var msg = scroll.msg
var out = ""
for (var i=0; i<position; i++)
{
out+= Msg.charat (i)
}
for (i=1;i<jumpspaces;i++)
{
Out + = ""
}
Out+=msg.charat (position)
Window.status = out
if (jumpspaces <= 1)
{
position++
if (Msg.charat (position) = = ")
{
position++
}
Jumpspaces = 100-position
}
else if (Jumpspaces > 3)
{
Jumpspaces *=. 75
}
Else
{
jumpspaces--
}
if (position!= msg.length)
{
var cmd = "Snapin (" + Jumpspaces + "," + position + ")";
Scrollid = Window.settimeout (Cmd,scroll.delay);
}
Else
{
Window.status= ""
Jumpspaces=0
Position=0
cmd = "Snapin" ("+ Jumpspaces +", "+ position +") ";
Scrollid = Window.settimeout (Cmd,scroll.delay);
return False
}
return True
}
Snapin (100,0);
</script>

5. Add "Follow the mouse text" function to blog

<style type= "Text/css" >
. Spanstyle
{
Position:absolute;
visibility:visible;
top:-500px;
font-size:10pt;
Color: #0000ff;
Font-weight:bold;
}
</style>

<script>
var x,y
var step=15
var flag=0
var message= "program is just a Dream"
Message=message.split ("")
var xpos=new Array ()
for (i=0;i<=message.length;i++)
{
xpos[i]=-500
}
var ypos=new Array ()
for (i=0;i<=message.length;i++)
{
ypos[i]=-500
}
function HANDLERMM (e)
{
x = (document.layers)? E.pagex:document.body.scrollleft+event.clientx-5
y = (document.layers)? e.pagey:document.body.scrolltop+event.clienty-75
Flag=1
}
function Makesnake ()
{
if (flag==1 && document.all)
{
for (i=message.length; i>=1; i--)
{
Xpos[i]=xpos[i-1]+step
YPOS[I]=YPOS[I-1]
}
Xpos[0]=x+step
Ypos[0]=y
for (i=0; i<message.length; i++)
{
var Thisspan = eval ("span" + (i) + ". Style")
Thisspan.posleft=xpos[i]
Thisspan.postop=ypos[i]
}
}
else if (flag==1 && document.layers)
{
for (i=message.length; i>=1; i--)
{
Xpos[i]=xpos[i-1]+step
YPOS[I]=YPOS[I-1]
}
Xpos[0]=x+step
Ypos[0]=y
for (i=0; i<message.length; i++)
{
var Thisspan = eval ("Document.span" +i)
Thisspan.left=xpos[i]
Thisspan.top=ypos[i]
}
}
var timer=settimeout ("Makesnake ()", 30)
}
</script>

<body onload= "Makesnake ()" >
<script>
for (i=0;i<=message.length;i++)
{
document.write ("<span id= ' span" +i+ "' class= ' Spanstyle ' >")
document.write (Message[i])
document.write ("</span>")
}
if (document.layers)
{
Document.captureevents (Event.mousemove);
}
Document.onmousemove = HANDLERMM;
</script>

6. Add a function to the blog, each time you open the top subtitle position automatically display a maxim (this I did not use)

<script language= "JavaScript" >
var word=new Array ();
Word[0]= "When you feel sad and miserable, it's best to learn something." Learning will keep you in an invincible position forever. "
Word[1]= "Every successful person has a beginning. The courage to start to find the road to success. "
word[2]= "Rather than pond, it is better to retreat and networking. "
Word[3]= "If you do not set yourself limits, there is no limit in your life to the barriers you play." "
Word[4]= "Stumbling block is stepping-stone. "
Word[5]= "Even climb to the highest mountain, once also can only take a step on the ground." "
Word[6]= "Positive thinking leads to positive life, negative thinking leads to negative life." "
Word[7]= "People have a mouth, and there are two ears, the reason is to listen to more than say one times." "
Word[8]= "Don't think about making the sea, you must start with small rivers." "
Word[9]= "Even immature attempts are better than the abortive strategy." "
word[10]= "An active person sees an opportunity in every suffering, whereas a negative person sees a certain kind of suffering at every opportunity." "
Word[11]= "If we want more roses, we have to plant more rose trees." "
Word[11]= "There is no desperate situation in the world, only for those in desperate circumstances." "
Word[12]= "When you feel sad and miserable, it's best to learn something." Learning will keep you in an invincible position forever. "
Word[13]= "The easiest thing in the world, procrastination is the most effortless." "
Word[14]= "without saliva and sweat, there will be no tears of success." "
Word[15]= "If you wish to succeed, use perseverance as your good friend, experience as your advisor, and be careful as your brother and hope as your sentry." "
Word[16]= "Most people want to change the world, but few people want to reinvent themselves." "
Word[17]= "The one who never fails has never been successful." "
Word[18]= "The establishment of Albert in life, not to know, but in the ability to do." "
Word[19]= "Frustration is actually the tuition fees to be paid for success." "
word[20]= "Any restriction, all starts from own heart." "
Word[21]= "Forget about failure, but remember the lesson of failure." "
Word[22]= "is not the situation to make people, but man-made situation." "
document.all ("header"). innerhtml= "<a href= ' http://babypai.vicp.net ' ></a><span> ' +document.all ("Header1_HeaderTitle") . outerhtml+ "<br/>&nbsp;&nbsp;&nbsp;&nbsp;" +word[parseint (Math.random () *22)]+ "</span>"
</script>


7. Add flash exquisite clock to blog

Found a lot of gorgeous flash clocks, free, no advertising can be used, color can also be selected, installation is also convenient.

You can preview and choose what you like.

Tick clock:
<embed src=http://www.butabon.com/clock/clock_038.swf width=150 height=150 wmode=transparent Quality=high True menu=false>
The http://www.butabon.com/Clock/clock_038.swf is the flash address of the clock, which can be previewed in IE, where 038 can be replaced by any number between 000-039 or 051-059 ( All see a person likes, hehe)

Digital clock:

The first style:
<embed src=http://www.butabon.com/clock/digiwide019.swf width=150 height=15 wmode=transparent Quality=high True menu=false>
HTTP://WWW.BUTABON.COM/CLOCK/DIGIWIDE019.SWF is also the flash address of the clock, you can preview in IE, 019 of which can be replaced by 000-019 between the number of any one (also see a person's preferences, Oh

Second style:
<embed src=http://www.butabon.com/clock/digital_019.swf width=150 height=90 wmode=transparent Quality=high True menu=false>
The http://www.butabon.com/Clock/digital_019.swf is also the flash address of the clock, which can be previewed in IE, 019 of which can be replaced by 000-019 between the number of any one you can in IE can be a successful preview of the numbers (please test yourself).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.