Javascript
The Ultimate Fade-In Slideshow Javascript
<script type=”text/javascript”>
/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["images/gallery/001.jpg", "", ""] //plain image syntax
fadeimages[1]=["images/gallery/002.jpg", "", ""] //plain image syntax
fadeimages[2]=["images/gallery/003.jpg", "", ""] //plain image syntax
//fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with [...]
visit www.dynamicdrive.com for all your javascripts!
cool collection of javascripts that you will need in all your websites. the menus are fantastic as well as the scrollers.
Visit http://www.dynamicdrive.com/
Fading text using javascript, best for advertising your offer.
<div id=”fader” style=”font:18px Arial bold;width:100%;color:rgb(255,255,255)”></div>
<script language=”JavaScript1.2″>
hexinput=255 // Initial color value.
var inc=-1 //increment variable
function fadingtext(){
if(hexinput>0) {
hexinput-=11; // increase color value
document.getElementById(“fader”).style.color=”rgb(“+hexinput+”,”+hexinput+”,”+hexinput+”)”; // Set color value.
setTimeout(“fadingtext()”,120);
}
else
hexinput=255 //reset hex value
}
function changetext(){
if (!document.getElementById) return
inc++
if (inc==0)
document.getElementById(“fader”).innerHTML=”Welcome to My World”
else if (inc==1)
document.getElementById(“fader”).innerHTML=”Visit my blog…”
else{
document.getElementById(“fader”).innerHTML=”Enjoy your stay here”
inc=-1
}
fadingtext()
setTimeout(“changetext()”,4000)
}
window.onload=changetext
</script>
Gmail Style Row Selection and Checkbox
Create a test.htm file.
Code the following javascript and table at the beginning of the page:
<script>
function toggleClick(i)
{
if(document.getElementById(“chk”+i).checked == true)
{
document.getElementById(“chk”+i).checked = false;
document.getElementById(i).style.backgroundColor=’white’;
}
else if(document.getElementById(“chk”+i).checked == false)
{
document.getElementById(“chk”+i).checked = true;
document.getElementById(i).style.backgroundColor=’#99CC66′;
}
}
function mover(i,status)
{
if(document.getElementById(“chk”+i).checked == false)
{
if(status == ‘over’)
{
document.getElementById(i).style.backgroundColor = “#FFCC66″;
}
else if(status == ‘out’)
{
document.getElementById(i).style.backgroundColor = “white”;
}
}
}
</script>
<table border=”1″ cellpadding=”1″ cellspacing=”1″>
<tr
onclick=”toggleClick(‘9′)”
id=”9″ bgcolor=”white”
onmouseover=”mover(‘9′,’over’);”
onmouseout=”mover(‘9′,’out’);”
>
<td >
<input id=”chk9″
onclick=”toggleClick(‘9′);” type=”checkbox”
name=”chk” value=”checkbox” /> </td>
<td height=”29″> <div align=”center” [...]
Row Highlighting like gmail with checkbox.
I was trying to code a table that is just like gmail checkbox where you move the cursor and click on the checkbox and the whole row gets a color. I added a feature that when you hover the row color changes and when you click the checkbox the color persist. Very pretty code with [...]
Read Full Post | Make a Comment ( None so far )