English

Code snippets    [Back]

 

<!-------------------------------------------text fader----------------------------------------
<script type="text/javascript">

/***********************************************
* Fading Scroller- c Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 2500; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(128,128,128); // start color (red, green, blue)
var endcolor=new Array(230,230,230); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: bold 18px Verdana; padding: 5px;">'; //set opening tag, such as font declarations
fcontent[0]="<b>1628 species & ssp";
fcontent[1]="April 3, 2006";
//fcontent[2]="Ok, enough with these pointless messages. You get the idea behind this script.</a>";
closetag='</div>';

var fwidth='350px'; //set scroller width
var fheight='50px'; //set scroller height

var fadelinks=1; //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////

var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;

/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
if (fadelinks)
linkcolorchange(1);
colorfade(1, 15);
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
index++
}

// colorfade() partially by Marcio Galli for Netscape Communications. ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
var obj=document.getElementById("fscroller").getElementsByTagName("A");
if (obj.length>0){
for (i=0;i<obj.length;i++)
obj[i].style.color=getstepcolor(step);
}
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
if(step<=maxsteps) {
document.getElementById("fscroller").style.color=getstepcolor(step);
if (fadelinks)
linkcolorchange(step);
step++;
fadecounter=setTimeout("colorfade("+step+")",stepdelay);
}else{
clearTimeout(fadecounter);
document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
setTimeout("changecontent()", delay);

}
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
var diff
var newcolor=new Array(3);
for(var i=0;i<3;i++) {
diff = (startcolor[i]-endcolor[i]);
if(diff > 0) {
newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
} else {
newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
}
}
return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

if (ie4||DOM2)
document.write('<div id="fscroller" style="border:0;width:'+fwidth+';height:'+fheight+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
</script>
--------------------------------------text fader---------------------------------------->


-----------------------------------------------------------------------
IMAGE SWITCH:::

<a href="http://www.angelfire.com/hi5/sweden/MYBIO.html">
<img name="meinbamboo"
src="http://www.angelfire.com/hi5/sweden/images/giffs/RoadRunner.gif" HEIGHT=140 WIDTH=180 BORDER=0 TITLE='Click for &nbsp&nbsp"My Bio. with Pics"'
onmouseover="document.meinbamboo.src
= 'http://www.angelfire.com/hi5/sweden/images/me_button.gif';"HEIGHT=140 WIDTH=180 BORDER=0 TITLE='Click for &nbsp&nbsp"My Bio. with Pics"'
onmouseout="document.meinbamboo.src
= 'http://www.angelfire.com/hi5/sweden/images/giffs/RoadRunner.gif';" HEIGHT=140 WIDTH=180 BORDER=0 TITLE='Click for &nbsp&nbsp"My Bio. with Pics"'"></a>
<br><font size=2 color="#000000"><b>
&nbsp Who am I?&nbsp Click for my Biography.
</b>
</font>
<br>

-----------------------------------------------------------------------------------
CLOSE BUTTON:::

<div align="center">
<form>
<p><input onclick="self.close()" type="button" value="Close Window"></p>
</form>
</div>

-----------------------------------------------------------------------------------
FIXED BACKGROUND IMAGE:::
<head>
<STYLE TYPE="text/css">
BODY {background-image: url(http://www.angelfire.com/hi5/sweden/images/giffs/BACK8.gif); background-attachment: fixed; }
</STYLE>
<body onLoad="initVars()" bgcolor="#4682b4" text="#00ff00" link="#ffff00" alink="#fffff0" vlink="#fffff0">

---------------------------------------------------------------------------------
UL LIST STYLE:::

<ul STYLE="list-style-image: url(http://www.angelfire.com/hi5/sweden/images/giffs/ballred.gif)">
<li>Name - Martin
--------------------------------------------------------------------------------

 

<!--------------------------------shake image start--------------------->

<style>
.shakeimage{
position:relative
}
</style>
<script language="JavaScript1.2">

/*
Shake image script (onMouseover)-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

//configure shake degree (where larger # equals greater shake)
var rector=3

///////DONE EDITTING///////////
var stopit=0
var a=1

function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}

function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}

function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}
</script>
<!-------------------------end shake gif----------------------------->

</head>

<a href="http://www.angelfire.com/hi5/sweden/NEWSSPIN.html">
<img src="http://www.angelfire.com/hi5/sweden/images/giffs/newsspin.gif" BORDER=0 class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this);top.focus()" onClick="top.focus()" ></a>

--------------------------------------------------------------------------------
<a href="http://www.angelfire.com/hi5/sweden/FUNNYSTORY.html"
onMouseOver="document.all.music.src='http://javascript.internet.com/img/click-sound/laugh.wav'">
<img src="http://www.angelfire.com/hi5/sweden/images/giffs/lol.gif" TITLE='Click to &nbsp&nbsp"Read a Funny Story"' border=0></a>

<bgsound id=music loop=1 autostart="true"-->





All text and images are Copyright
© 2004-2007, Wildbirdgallery.com. All rights reserved.