Fourni par Blogger.

dimanche 11 août 2013

Text dance on page

Javascript Code: Text dance on page
An excellent effect on texts. They are dancing and shaking like a wave.


<script language="JavaScript1.2">
//configure message
message="Welcome to http://javascriptcodefree.blogspot.com/"
//animate text in NS6? (0 will turn it off)
ns6switch=1

var ns6=document.getElementById&&!document.all
mes=new Array();
mes[0]=-1;
mes[1]=-4;
mes[2]=-7;mes[3]=-10;
mes[4]=-7;
mes[5]=-4;
mes[6]=-1;
num=0;
num2=0;
txt="";
function jump0(){
if (ns6&&!ns6switch){
jump.innerHTML=message
return
}
if(message.length > 6){
for(i=0; i != message.length;i++){
txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
jump.innerHTML=txt;
txt="";
jump1a()
}
else{
alert("Your message is to short")
}
}

function jump1a(){
nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
nfinal.style.left=-num2;
if(num2 != 9){
num2=num2+3;
setTimeout("jump1a()",50)
}
else{
jump1b()
}
}

function jump1b(){
nfinal.style.left=-num2;
if(num2 != 0){num2=num2-3;
setTimeout("jump1b()",50)
}
else{
jump2()
}
}

function jump2(){
txt="";
for(i=0;i != message.length;i++){
if(i+num > -1 && i+num < 7){
txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"
}
else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
}
jump.innerHTML=txt;
txt="";
if(num != (-message.length)){
num--;
setTimeout("jump2()",50)}
else{num=0;
setTimeout("jump0()",50)}}
</script>
</head>
<body>

<h2><div id="jumpx" style="color:green"></div></h2>
<script>
if (document.all||document.getElementById){
jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpx
jump0()
}
else
document.write(message)
</script>


<font face="Tahoma"><a target="_blank" href="http://javascriptcodefree.blogspot.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>





Compatible browsers:
IEFirefoxChromeSafariOpera

Javascript Code: Show popup when clicking on a button

<HTML>
<HEAD>
<!--START OF PopUp on Button Click-->

<SCRIPT LANGUAGE="JavaScript">
function AlertCC(label, msg)
{
  var cc1 =
    "<TITLE>Window Title</TITLE>" +
    "<BODY BGCOLOR='FFFFFF'><TABLE BORDER=0><TR>" +
        "<TD WIDTH=90% HEIGHT=90 VALIGN=TOP ALIGN=LEFT>"+
        "<FONT SIZE=4 FACE=ARIAL>"

  var cc2 = "<FONT COLOR='FF0000'><B>"+label+"</B></FONT><BR><P>"

  var cc3 =
    "</TD><TD WIDTH=10%> </TD></TR><TR><TD> </TD>"+
    "<TD VALIGN=BOTTOM ALIGN=RIGHT>"+
    "<FORM><INPUT TYPE='BUTTON' VALUE='Close Window'" +
                   "onClick='self.close()'>"  +
    "</FORM></TD></TR></TABLE></BODY>"


  popup = window.open("","popDialog","height=280,width=400,scrollbars=no")
  popup.document.write(cc1+cc2+msg+cc3)
  popup.document.close()
}

function ccalert1()
{
  AlertCC('Alert One', 'This script will let you place information about your product or topic of choice.')
}
function ccalert2()
{
  AlertCC('Alert Two', 'This script will let you place information about your product or topic of choice.')
}
function ccalert3()
{
  AlertCC('Alert Three', 'This script will let you place information about your product or topic of choice.')
}
function ccalert4()
{
  AlertCC('Alert Four', 'This script will let you place information about your product or topic of choice.')
}
</SCRIPT>
</HEAD>
<BODY>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert One ]" onClick="ccalert1()"></FORM></CENTER><p>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert Two ]" onClick="ccalert2()"></FORM></CENTER><p>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert Three ]" onClick="ccalert3()"></FORM></CENTER><p>
<CENTER><FORM><INPUT TYPE="BUTTON" VALUE="[ Alert Four ]" onClick="ccalert4()"></FORM></CENTER><p>
<!-- END OF SCRIPT -->


<font face="Tahoma"><a target="_blank" href="http://javascriptcodefree.blogspot.com//"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>



Compatible browsers:
IEFirefoxChromeSafariOpera


Javascript Code: Text dance in status bar 1

<SCRIPT LANGUAGE="JavaScript">

var yourtext = "* YOUR MESSAGE HERE! *";
var wedge1="                        ";
var wedge2="                        ";
var message1=wedge1+yourtext+wedge2;
var dir = "lside";
var speed = 50;

function bouncey() {

if (dir == "lside") {
message2=message1.substring(2,message1.length)+"  ";
window.status=message2;
setTimeout("bouncey();",speed);
message1=message2;

if (message1.substring(0,1) == "*") {
dir="rside";
}
}

else {
message2="  "+message1.substring(0,message1.length-2);
window.status=message2;
setTimeout("bouncey();",speed);
message1=message2;
if (message1.substring(message1.length-1,message1.length) == "*") {
dir="lside";
}
}
}

</SCRIPT>

<body onLoad="bouncey()">
</body>
<font face="Tahoma"><a target="_blank" href="http://javascriptcodefree.blogspot.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>




Compatible browsers:
IEOpera


Javascript Code: Text in status bar 4

Shows a text in status bar with flashing effect




<!-- Start of Status Blinker -->
<!-- This will put a blinking status bar message in your webpage.
Important:  There are two parts to this script, one goes
in between the HEAD tags and one goes in the BODY tag.
-->
<script>
var yourwords = "http://www.javascriptcodefree.blogspot.com/";
var speed = 300;
var control = 1;
function flash()
{
  if (control == 1)
    {
      window.status=yourwords;
      control=0;
    }  
  else
    {
      window.status="";
      control=1;
    }
  setTimeout("flash()",speed);
}
</script>
<!--You can control the speed of the flashing in this script. You just need to change the speed number 300. Bigger the number the slower it goes.-->
<!-- From this part on up goes in between the HEAD tags -->


<body onLoad="flash()">

<!-- End of Status Blinker -->

<font face="Tahoma"><a target="_blank" href="http://javascriptcodefree.blogspot.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>




Compatible browsers:
IEOpera

Javascript Code: Automatically maximize window

<!-- START OF Window Auto Maximize DHTML -->


<!-- SUMMARY BRIEF

This code will automatically maximize the
browser window when the page is loaded.

-->


<!-- Put this code inside of your <HEAD> tag. -->


<script language="JavaScript1.2">
<!--

top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}

//-->
</script>


<!-- END OF Window Auto Maximize DHTML -->
<font face="Tahoma"><a target="_blank" href="<!-- START OF Window Auto Maximize DHTML -->


<!-- SUMMARY BRIEF

This code will automatically maximize the
browser window when the page is loaded.

-->


<!-- Put this code inside of your <HEAD> tag. -->


<script language="JavaScript1.2">
<!--

top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}

//-->
</script>


<!-- END OF Window Auto Maximize DHTML -->
<font face="Tahoma"><a target="_blank" href="http://www.javascriptcodefree.blogspot.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>








Compatible browsers:
IE

- See more at: http://www.javascriptfreecode.com/53.htm#sthash.3LPRUyPi.dpuf

Javascript Code: Combo box link sample

<!-- This script opens a separate window for the locations you give it.
Pages are neat but pictures make a cool photo album. Change the
attributes that read menubar=0,toolbar=0, etc... and Width & Height
to meet your needs.  Make sure you place the URL's you want to go
to and their names below.-->

<script language="JavaScript">
<!-- Hide the script from old browsers --
function surfto(form)
{
  var myindex=form.dest.selectedIndex
  window.open(form.dest.options[myindex].value,"main","menubar=1,toolbar=0,location=0,directories=0,status=1,copyhistory=0,width=235,height=235");
}
//-->
</SCRIPT>
<CENTER>
<FORM NAME="myform">
  <SELECT NAME="dest" SIZE=1>
    <OPTION VALUE="http://www.coffeecup.com">CoffeeCup Software
    <OPTION VALUE="http://www.tmcm.com">Too Much Coffee Man
    <OPTION VALUE="http://www.netscape.com">Netscape
    <OPTION VALUE="http://www.javakhafan.7p.com">InfoSeek
  </SELECT>
<P>
<INPUT TYPE="BUTTON" VALUE="Go  !" onClick="surfto(this.form)">
</FORM>
</CENTER>

<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>
Make javascriptcodefree.blogspot.com your home page