JavaScript dành cho các bạn học thiết kế Web
Thay đổi trang: < 123 > >> | Trang 2 của 4 trang, bài viết từ 16 đến 30 trên tổng số 58 bài trong đề mục
CDDLT 26.10.2005 22:01:39 (permalink)
Tạo menu trong trang Web
<script>
function listThem() {
if (document.chooser.sitelist.selectedIndex == 0) alert("Please select something");
else if (document.chooser.sitelist.selectedIndex == 1) location = 'http://www.shop4all.com';
else if (document.chooser.sitelist.selectedIndex == 2) location = 'http://www.coomedia.com';
else if (document.chooser.sitelist.selectedIndex == 3) location = 'http://www.microsoft.com';
}
</script>
<body>
<center><h1>Another Dropdown list box</h1></center>
<p>The advantage of this dropdown list to choose URLs is that there is no need for a submit button, as you can see.</p>
<center><table border="5" cellpadding="5" align="center" valign="middle"><form name="chooser">
<tr><th align="center" bgcolor="#deb887">Make a choice:</th></tr>
<tr><td align="center" bgcolor="#deb887"><select name="sitelist" onchange="listThem()">
<option selected>Select one
<option>Home Page
<option>Contents
<option>Navigation Aids
</select></td></tr>
</form></table>
</center>
#16
    CDDLT 26.10.2005 22:02:27 (permalink)
    Các dòng văn bản động, thay đổi màu sắc
    <script language="Javascript">
    <!-- Hiding
    /* Script by Lefteris Haritou
    Copyright ©1998
    http://www.geocities.com/~lef
    This Script is free as long
    as you keep the above credit !
    */
    bname=navigator.appName;
    bversion=parseInt(navigator.appVersion)
    if ((bname=="Netscape" && bversion>=4) || (bname=="Microsoft Internet Explorer" && bversion>=4)){
    if (bname=="Netscape"){
    brows=true
    del=30
    }
    else{
    brows=false
    del=80
    }
    var msg=0;
    var z=0;
    var timer1;
    var message= new Array();
    var color= new Array();
    var values= new Array('-6','-5','-4','-3','-2','-1','+1','+2','+3','+4','+5','+6')
    // Put here your own messages. Add as many as you want (Do not edit anything else in the Script except the lines below)
    message[0]='Animated Titles'
    color[0]='#FF0000'
    message[1]='A new JavaScript'
    color[1]='##009900'
    message[2]='Fully customisable and easy to use'
    color[2]='#003399'
    message[3]='© 2000 BDG Publishing Inc.'
    color[3]='#990033'
    message[4]='NS 4.x and IE 4.x supported'
    color[4]='#ff66cc'

    // Put here your own messages. Add as many as you want (Do not edit anything else in the Script except the lines above)

    function start(){
    if ((bname=="Netscape" && bversion>=4) || (bname=="Microsoft Internet Explorer" && bversion>=4)){
    if(z<values.length){
    if (brows){
    document.layers['text'].document.writeln('<P Class="main" Align="Center"><font color="'+color[msg]+'" size="'+values[z]+'" face="Arial"><NOBR>'+message[msg]+'</NOBR></font></P>')
    document.layers['text'].document.close();
    }
    else{
    text.innerHTML='<Pre><P Class="main" Align="Center"><font color="'+color[msg]+'" size="'+values[z]+'" face="Arial"><NOBR>'+message[msg]+'</NOBR></font></P></Pre>'
    }
    z++;
    timer1=window.setTimeout('start()',del)
    }
    else
    chg();
    }
    }
    function stop(){
    if ((bname=="Netscape" && bversion>=4) || (bname=="Microsoft Internet Explorer" && bversion>=4))
    window.clearTimeout(timer1);
    window.clearTimeout(timer2);
    }
    function chg(){
    if (brows){
    document.layers['text'].document.writeln('')
    document.layers['text'].document.close();
    }
    else
    text.innerHTML='';
    if(msg<message.length-1){
    msg++;
    }
    else
    msg=0;
    z=0;
    timer2=window.setTimeout('start()',2000)
    }
    }
    // done hiding -->
    </script>
    <body onLoad="start()" onUnload="stop()">
    <div id="text" style="position: absolute; left: 4; top: 80"></div>
    #17
      CDDLT 27.10.2005 18:58:23 (permalink)
      Chữ I LOVE YOU khiêu vũ

      Từng ký tự trong chữ I LOVE YOU dao động qua lại, khi đụng với ký tự bên cạnh sẽ bật ngược trở lại.

      <p align="center"><b><font face="VNI-Cooper" color="#FF0000" size="6">

      <marquee scrollamount="15" width="10%" behavior="alternate">I</marquee>

      <marquee scrollamount="15" width="10%" behavior="alternate"
      direction="right">L</marquee>

      <marquee scrollamount="15" width="10%" behavior="alternate">O</marquee>

      <marquee scrollamount="15" width="10%" behavior="alternate"
      direction="right">V</marquee>

      <marquee scrollamount="15" width="10%" behavior="alternate">E</marquee>

      <marquee scrollamount="15" width="10%" behavior="alternate"
      direction="right">Y</marquee>

      <marquee scrollamount="15" width="10%" behavior="alternate">O</marquee>

      <marquee scrollamount="15" width="10%" behavior="alternate"
      direction="right">U</marquee>

      </marquee></font></b></p>
      #18
        CDDLT 27.10.2005 18:58:54 (permalink)
        Chữ được xếp từ nhiều hình trái tim

        Nhiều hình trái tim rơi từ trên xuống và xếp lại thành chữ LOVE, trông rất lãng mạn. Bạn có thể dùng hiệu ứng này trong thư gửi “người ấy”, nó sẽ giúp bạn nói thay những lời muốn nói.

        <center>
        <marquee direction=down scrollamount=1 height=15><font face=webdings
        size=3
        color=#ff0000>Y     YY Y      YYYY</font></marquee>
        <marquee direction=down scrollamount=1 height=15><font face=webdings
        size=3
        color=#ff0000>Y    Y  Y Y    Y Y</font></marquee>
        <marquee direction=down scrollamount=1 height=15><font face=webdings
        size=3
        color=#ff0000>Y    Y  Y  Y  Y  YYY</font></marquee>
        <marquee direction=down scrollamount=1 height=15><font face=webdings
        size=3
        color=#ff0000>Y    Y  Y   YY   Y</font></marquee>
        <marquee direction=down scrollamount=1 height=15><font face=webdings
        size=3
        color=#ff0000>YYY YY     Y    YYY</font></marquee>
        </center>
        #19
          CDDLT 27.10.2005 18:59:43 (permalink)
          Hiệu ứng đèn chớp nháy

          Hiệu ứng sau sẽ tạo chữ chớp nháy và chạy giống như đèn trang trí.

          <p align="center"><font face="Impact" color="#FF0000" size="6">

          <marquee scrollamount="30" width="32" behavior="slide"
          loop="9000">I</marquee>

           

          <marquee scrollamount="40" width="32" behavior="slide"
          loop="9000">L</marquee>

           

          <marquee scrollamount="30" width="32" loop="9000"
          behavior="slide">O</marquee>

           

          <marquee scrollamount="40" width="32" loop="9000"
          behavior="slide">V</marquee>

           

          <marquee scrollamount="30" width="32" loop="9000"
          behavior="slide">E</marquee>

           

          <marquee scrollamount="40" width="32" loop="9000"
          behavior="slide">Y</marquee>

           

          <marquee scrollamount="30" width="32" loop="9000"
          behavior="slide">O</marquee>

           

          <marquee scrollamount="40" width="32" loop="9000"
          behavior="slide">U</marquee>

           

          </font></p>
          #20
            CDDLT 27.10.2005 19:00:08 (permalink)
            Chữ đổ hào quang

            Dòng chữ I LOVE YOU đổ hào quang và chạy từ phải sang trái, khi gặp biên màn hình sẽ bật trở lại. Trông cũng thú vị đấy chứ?

            <table border="2" cellpadding="0" cellspacing="0"
            style="border-collapse: collapse" bordercolor="#800000" width="500" bgcolor="#FFFFFF">
            <tr>
            <td width="100%">
            <marquee behavior=alternate><TABLE
            STYLE="filter:glow(color=blue,
            strength=5)">
            <TR><TD><center>
            <font face=arial size=4 color=aqua>I LOVE YOU</font></td></tr></TABLE></marquee></td>
            </tr>
            </table>
            #21
              CDDLT 27.10.2005 19:00:39 (permalink)
              Hiệu ứng chữ hào quang nhảy múa



              Hiệu ứng sau đây sẽ làm e-mail hay trang Web của bạn sinh động hơn với dòng chữ I LOVE YOU đổ hào quang và nhảy múa.

              <marquee scrollamount="5" width="7%" behavior="alternate"
              direction="up" scrolldelay="125" ><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15
              color=aqua>I</font></td></tr></TABLE></marquee>

              <marquee scrollamount="6" width="7%" behavior="alternate"
              direction="up" scrolldelay="130"><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15 color=aqua>L</font></td></tr></TABLE></marquee>

              <marquee scrollamount="5" width="7%" behavior="alternate"
              direction="up" scrolldelay="125"><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15
              color=aqua>O</font></td></tr></TABLE></marquee>

              <marquee scrollamount="6" width="7%" behavior="alternate"
              direction="up" scrolldelay="130"><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15
              color=aqua>V</font></td></tr></TABLE></marquee>

              <marquee scrollamount="5" width="7%" behavior="alternate"
              direction="up" scrolldelay="125"><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15
              color=aqua>E</font></td></tr></TABLE></marquee>

              <marquee scrollamount="6" width="7%" behavior="alternate"
              direction="up" scrolldelay="130"><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15
              color=aqua>Y</font></td></tr></TABLE></marquee>

              <marquee scrollamount="5" width="7%" behavior="alternate"
              direction="up" scrolldelay="125" ><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15
              color=aqua>O</font></td></tr></TABLE></marquee>

              <marquee scrollamount="6" width="7%" behavior="alternate"
              direction="up" scrolldelay="130"><TABLE STYLE="filter:glow(color=BLACK,
              strength=5)"> <TR><TD><center> <font face=arial size=15
              color=aqua>U</font></td></tr></TABLE></marquee>
              #22
                CDDLT 27.10.2005 19:01:10 (permalink)
                Chữ nhiều màu nhảy múa



                Những dòng chữ đầy màu sắc mang phong cách “xì tin” nhảy múa trên màn hình, chắc chắn sẽ để lại một ấn tượng khó quên cho “người ấy”.

                <font size=15><FONT COLOR=#AB0457><SUB><marquee scrollamount="9"
                width="5%" behavior="alternate" direction="up"
                >I</marquee></SUB></FONT></FONT>

                <font size=15><FONT COLOR=#D5042D><SUP> <marquee scrollamount="8"
                width="5%" behavior="alternate" direction="up"
                >L</marquee></SUP></FONT></FONT>

                <font size=15><FONT COLOR=#820481><SUP> <marquee scrollamount="7"
                width="5%" behavior="alternate" direction="up"
                >O</marquee></SUP></FONT></FONT>

                <font size=15><FONT COLOR=#5805AB><SUP> <marquee scrollamount="7"
                width="5%" behavior="alternate" direction="up"
                >V</marquee></SUP></FONT></FONT>

                <font size=15><FONT COLOR=#FF0404><SUP> <marquee scrollamount="8"
                width="5%" behavior="alternate" direction="up"
                >E</marquee></SUP></FONT></FONT>

                <font size=15><FONT COLOR=#2E05D5><SUB> <marquee scrollamount="9"
                width="5%" behavior="alternate" direction="up"
                >Y</marquee></SUB></FONT></FONT>

                <font size=15><FONT COLOR=#5805AB><SUB> <marquee scrollamount="9"
                width="5%" behavior="alternate" direction="up"
                >O</marquee></SUB></FONT></FONT>

                <font size=15><FONT COLOR=#820481><SUP> <marquee scrollamount="8"
                width="5%" behavior="alternate" direction="up"
                >U</marquee></SUP></FONT></FONT>
                #23
                  CDDLT 27.10.2005 19:12:19 (permalink)
                  Tạo một dropdown list

                  <script language="JavaScript">
                  <!--
                  function go(){
                  if (document.selecter.select1.options[document.selecter.select1.selectedIndex].value != "none") {
                  location = document.selecter.select1.options[document.selecter.select1.selectedIndex].value
                  }
                  }
                  //-->
                  </script>
                  </head>
                  <body>
                  <center><h1>A Dropdown List</h1></center>
                  <center><script language="JavaScript">
                  <!--
                  document.write('<form name="selecter"><select name="select1" size=1>');
                  document.write('<option value=none>Select your destination');
                  document.write('<option value=none>--------------------');
                  document.write('<option value="http://www.shop4all.com">Shopping Page');
                  document.write('<option value="http://www.coomedia.com">Main Page');
                  document.write('<option value="http://www.yahoo.com">Navigation');
                  document.write('</select>');
                  document.write('<input type="button" value="Go" onclick="go()">');
                  document.write('</form>');
                  // end hiding contents -->

                  //parent.cont.location.href =
                  //<frameset cols="37%,*">
                  // <frame name="boxcont" src="boxcont.htm" marginwidth="10" marginheight="10" scrolling="auto" //frameborder="no">
                  // <frame name="cont" src="cont.htm" marginwidth="10" marginheight="10" scrolling="auto" //frameborder="no">
                  //</frameset>

                  </script></center>
                  #24
                    CDDLT 27.10.2005 19:12:42 (permalink)
                    Mở rộng thể hiện các liên kết từ một tiêu đề

                    <script language="JavaScript1.2">
                    <!--
                    /*Contractable Headers script- By Website Abstraction
                    (www.wsabstract.com)
                    Over 200+ free JavaScripts here!
                    */
                    var head="display:''"
                    function doit(header){
                    var head=header.style
                    if (head.display=="none")
                    head.display=""
                    else
                    head.display="none"
                    }
                    //-->
                    </script>

                    <h2 style="cursor:hand" onClick="doit(document.all[this.sourceIndex+1])" title="Click
                    here to expand/contract!">Some JavaScript Links</h2>
                    <span style="display:none" style=&{head};>
                    <dl>
                    <dt><a
                    href="http://developer.netscape.com/docs/manuals/communicator/jsguide4/index3.ht
                    m" target="_top">Netscape</a><dd>The official source about JavaScript
                    <dt><a href="http://javascriptsource.com" target="_top">The JavaScript
                    Source</a><dd>Lots of good examples
                    <dt><a href="http://www.ce.net/users/ryan/java/" target="_top">The Unofficial
                    JavaScript Resource Center</a>
                    <dd>Some useful examples
                    <dt><a href="http://www.coolshare.com/html/" target="_top">JAVAZOO</a>
                    <dd>A page stuffed with JavaScript examples
                    <dt><a href="http://javascript.developer.com/" target="_top">Gamelan JavaScript
                    Pages</a>
                    <dd>A truly excellent collection of links to JavaScript pages and collections
                    <dt><a href="http://www.freqgrafx.com/411/library.html">Snippet Library</a>
                    <dd>A fine collection of scripts
                    <dt><a href="http://www.geocities.com/SiliconValley/7116/">JavaScript Planet</a>
                    <dd>Some nice scripts
                    <dt><a href="http://irt.org/">IRT.ORG</a>
                    <dd>An excellent collection of articles and scripts.
                    </dl>
                    </span>
                    <h2 style="cursor:hand" onClick="doit(document.all[this.sourceIndex+1])" title="Click
                    here to expand/contract!">Some DHTML Links</h2>
                    <span style="display:none" style=&{head};>
                    <table cellspacing="10" cellpadding="2">
                    <tr><td><a href="http://www.microsoft.com/workshop/author/dhtml/">Microsoft's Site
                    Builder Network<br>-Dynamic HTML</a></td>
                    <td><a href="http://www.dhtmlzone.com/index3.html">Macromedia's DHTML
                    Zone</a></td></tr>
                    <tr><td><a
                    href="http://developer.netscape.com/library/documentation/communicator/dynhtml/ind
                    ex3.htm">Dynamic HTML in Netscape Communicator</a></td>
                    <td><a href="http://www.erols.com/jrule/dhtml/">DHTML Demos</a></td></tr>
                    <tr><td><a href="http://www.insidedhtml.com/home.htm">Inside DHTML</a></td>
                    <td><a href="http://members.tripod.com/~dynduo/ ">The Dynamic Duo</a></td></tr>
                    <tr><td><a href="http://www.webreference.com/dhtml/">Dynamic HTML
                    Lab</a></td>
                    <td><a href="http://webcoder.com/">WebCoder.com</a></td></tr>
                    <tr><td><a href="http://rapid.wrox.co.uk/webdev/BookList.asp">The Wrox Web-
                    Developer<br>Books and Samples Page</a></td>
                    <td><a href="http://www.projectcool.com/developer/">Project Cool<br>Developer
                    Zone</a></td></tr></table>
                    </span>
                    #25
                      CDDLT 27.10.2005 19:13:14 (permalink)
                      Dòng văn bản hiện lên rồi mờ dần

                      <style>
                      body{background-color:#ffe4c4}
                      A{color:Navy; text-decoration:none}
                      A:hover{color:red}
                      A:visited:{color:#808080}
                      TD{font-family:arial,helvetica; font-size:10pt}
                      </style>
                      <script language="JavaScript1.2">
                      /********************************************************************************
                      This script is made by and copyrighted to Thomas Brattli at www.bratta.com
                      Visit for more great scripts.
                      This may be used freely as long as this msg is intact!
                      ********************************************************************************
                      Browsercheck:*/
                      ie=document.all?1:0
                      n=document.layers?1:0

                      /********************************************************************************
                      Here are the variables you must set: (this is the only part you have to change)

                      Remember tho, if you wan't different size for the layers, different clip or anything
                      change that in the stylesheet.
                      */

                      //The delay between the fades (in milliseconds) smaller value gives less time:
                      betweendelay=3000

                      //Do you wan't it to start over on the first one when it's gone trought all the news?
                      //(set to 0 if not)
                      var loop=1

                      //What font do you want it use?
                      FontFace='arial,helvetiva'

                      //What font-size (in pixel)?
                      FontSize=14

                      //Do you want it to fade out as well? 1 for on, 0 for off
                      fadeback=1

                      //Set the colors, first color is same as background, last color is the color it stops at:
                      //You can have upto 7 colors, set the ones you wan't use to 0
                      colors=new Array()
                      colors[0]='#ffe4c4'
                      colors[1]='#EEEEEE'
                      colors[2]='#CCCCCC'
                      colors[3]='#999999'
                      colors[4]='#666666'
                      colors[5]='#333333'
                      colors[6]='#000000'

                      //This is the news you wanna have, set the link and the text. If you don't wan't it to link anywhere
                      //use a # as the link
                      news=new Array()
                      //Copy the three lines and change the info and numbers to get more news.
                      news[0]=new Array()
                      news[0]["text"]="JavaScript Resources contains hundreds of FREE JavaScripts and DHTML scripts!"
                      news[0]["link"]="http://www.jsr.communitech.net/"

                      news[1]=new Array()
                      news[1]["text"]="Visit also my site about where I live, Alan\ 's Page - A Guide to Greenwich and Charlton"
                      news[1]["link"]="http://ourworld.compuserve.com/homepages/apalmer/"

                      /*Dont change anything below this!
                      *********************************************************************************/
                      fadeInit=new Function("oNews=new makeObj('divNews','divCont'); fadeNews(0)")
                      function makeObj(obj,nest){
                      nest=(!nest) ? '':'document.'+nest+'.'
                      this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
                      this.writeref=(n) ? eval(nest+'document.'+obj+'.document'):eval(obj);
                      this.fadeIt=b_fadeIt
                      this.obj = obj + "Object"; eval(this.obj + "=this")
                      }
                      function b_fadeIt(text,link,font,size,speed,fn,num,c0,c1,c2,c3,c4,c5,c6){
                      if(num<arguments.length && arguments[num]!=0){
                      writetext='<a href="'+link+'" style="text-decoration:none; font-size:'+size+'px">'
                      +'<font face="'+font+'" color="'+arguments[num]+'">'+text+'</font></a>'
                      if(n){this.writeref.write(writetext); this.writeref.close()}
                      if(ie) this.writeref.innerHTML=writetext
                      num++
                      setTimeout(this.obj+'.fadeIt("'+text+'","'+link+'","'+font+'",'+size+','+speed+',"'
                      +fn+'",'+num+',"'+c0+'","'+c1+'","'+c2+'","'+c3+'","'+c4+'","'+c5+'","'+c6+'")',speed)
                      }else setTimeout('eval('+fn+')',betweendelay)
                      }
                      function fadeNews(num){
                      if(num<news.length){
                      fn=fadeback?'fadeBack('+num+')':'fadeNews('+(num+1)+')';
                      oNews.fadeIt(news[num]["text"],news[num]["link"],FontFace,FontSize,100,fn,7,
                      colors[0],colors[1],colors[2],colors[3],colors[4],colors[5],colors[6])
                      }else if(loop)fadeNews(0)
                      }
                      function fadeBack(num){
                      if(num>=0){
                      oNews.fadeIt(news[num]["text"],news[num]["link"],FontFace,FontSize,100,'fadeNews('+(num+1)
                      +')',7,colors[6],colors[5],colors[4],colors[3],colors[2],colors[1],colors[0])
                      }
                      }
                      onload=fadeInit;
                      /*End of fadescript
                      **********************************************************************************/
                      </script>
                      <body>
                      <div id="divCont" style="position:absolute; width:250; height:200; left:15; top:120">
                      <div id="divNews" style="position:absolute">
                      <script>//We gotta write something here so netscape will make it
                      //be the correct size, but we will only write if it's a 4.x browser
                      if(document.all || document.layers) document.write("dummy text, dummy"
                      +"text, you can place you fist news or a welcome msg or something here."
                      +"If you place these layers inside a table or something you can also"
                      +"use this as the msg that browsers that doesn't suport dhtml will see.")
                      </script>
                      </div>
                      </div>
                      #26
                        CDDLT 27.10.2005 19:13:42 (permalink)
                        Các liên kết xoay vòng tròn

                        <html>
                        <head>
                        <title>JavaScript Resources - Flying Links</title>
                        <style>
                        .fly {
                        font-family: Arial, Helvetica;
                        font-size: large;
                        color: #0000ff;
                        position: absolute;
                        visibility: hidden;
                        z-index: 2;
                        }

                        .logo {
                        font-family: Zap-Chance, cursive;
                        font-size: xx-large;
                        color: #ff0000;
                        position: absolute;
                        top: 0px;
                        left: 30px;
                        visibility: visible;
                        z-index: 1;
                        }

                        .desc {
                        text-align: center;
                        font-family: Arial, Helvetica;
                        color: #cc6699;
                        position: absolute;
                        top: 220px;
                        left: 40px;
                        width: 400px;
                        visibility: hidden;
                        z-index: 0;
                        }
                        </style>
                        <script type="text/javascript" language="JavaScript">


                        /* Show an object */
                        function showObject(object) {
                        object.visibility = VISIBLE;
                        }

                        /* Hide an object */
                        function hideObject(object) {
                        object.visibility = HIDDEN;
                        }

                        /* Slide the company logo from top to middle */
                        function slideLogo(from, to) {
                        if (from < to) {
                        company.top = (from += 10);
                        setTimeout('slideLogo(' + from + ',' + to + ')', 75);
                        }
                        else initObjects();
                        }

                        /* Rotate selected objects */
                        function rotateObjects() {
                        for (var i = 0; i < pos.length; i++) {
                        pos += inc; objects.visibility = 'visible';
                        objects.left = (r * Math.cos(pos)) + xoff
                        objects.top = (r * Math.sin(pos)) + yoff;
                        }
                        rotateTimer = setTimeout("rotateObjects()", 75);
                        }

                        /* Initialize selected objects for rotation */
                        function initObjects() {
                        /* Here is the array of HTML elements that will be rotated, from fly1 to fly4
                        Just put the shortcut variables to the HTML elements in this little array
                        and they will be rotated automatically */
                        objects = new Array(fly1, fly2, fly3, fly4);
                        pos = new Array();
                        pos[0] = 0;
                        for (var i = 1; i < objects.length; i++) {
                        pos = parseFloat(pos[i - 1] + ((2 * pi) / objects.length));
                        }
                        rotateObjects();
                        }

                        /* Variables for rotating objects */
                        var objects;
                        var pos;
                        var r = 160; // radius
                        var xoff = 180; // x offset
                        var yoff = 170; // y offset
                        var pi = Math.PI; // get pi
                        var inc = pi / 180; // degrees per rotation cycle
                        var objects; // objects to be rotated
                        var pos; // position for objects

                        </script>

                        <SCRIPT LANGUAGE="JavaScript">

                        <!--
                        function exit() {
                        if (window.name == "") {
                        // top.location.href = url;
                        } else {
                        //top.opener.top.location.href = url;
                        top.close();
                        }
                        }
                        //-->

                        </SCRIPT>
                        </head>
                        <body bgcolor="#ffe4c4" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
                        <div id = "fly1" class = "fly">
                        <a href = "contents.htm" onMouseOver = "showObject(desc1)" onMouseOut = "hideObject(desc1)">Introduction</a><br>
                        </div>
                        <div id = "fly2" class = "fly">
                        <a href = "navigationaids.htm" onMouseOver = "showObject(desc2)" onMouseOut = "hideObject(desc2)">Navigation Aids</a><br>
                        </div>
                        <div id = "fly3" class = "fly">
                        <a href = "coloursandgraphics.htm" onMouseOver = "showObject(desc3)" onMouseOut = "hideObject(desc3)">Colours and Graphics</a><br>
                        </div>
                        <div id = "fly4" class = "fly">
                        <a href = "funstuff.htm" onMouseOver = "showObject(desc4)" onMouseOut = "hideObject(desc4)">Fun Stuff</a><br>
                        </div>
                        <div id = "company" class = "logo">JavaScript Resources</div>
                        <div id = "desc1" class = "desc">
                        Introduction and links
                        </div>
                        <div id = "desc2" class = "desc">
                        Aids to Web site navigation
                        </div>
                        <div id = "desc3" class = "desc">
                        Playing with colours and images
                        </div>
                        <div id = "desc4" class = "desc">
                        Games, quizzes, etc.
                        </div>
                        <script type="text/javascript" language="JavaScript">

                        /* Simple version detection */
                        var isNS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);

                        /* They can be used in place
                        of hidden and visible because on occasion Navigator has problems with the two */
                        var HIDDEN = (isNS) ? 'hide' : 'hidden';
                        var VISIBLE = (isNS) ? 'show' : 'visible';

                        /* Create shortcut variables for different absolutely positioned elements */
                        var fly1 = (isNS) ? document.fly1 : document.all.fly1.style;
                        var fly2 = (isNS) ? document.fly2 : document.all.fly2.style;
                        var fly3 = (isNS) ? document.fly3 : document.all.fly3.style;
                        var fly4 = (isNS) ? document.fly4 : document.all.fly4.style;
                        var company = (isNS) ? document.company : document.all.company.style;
                        var desc1 = (isNS) ? document.desc1 : document.all.desc1.style;
                        var desc2 = (isNS) ? document.desc2 : document.all.desc2.style;
                        var desc3 = (isNS) ? document.desc3 : document.all.desc3.style;
                        var desc4 = (isNS) ? document.desc4 : document.all.desc4.style;

                        /* Begin the sliding of the company logo */
                        slideLogo(0, 140);
                        </script>
                        <div id="footer+text" style="position: absolute; left:200; top: 370"><layer name="footer+text" left=200 top=370><form>
                        <input type=button value="Close Window" onClick="exit();">
                        </form> </layer></div>
                        </body>
                        </html>
                        #27
                          CDDLT 27.10.2005 19:14:31 (permalink)
                          Một dạng đồng hồ khác trên trang web

                          <body onLoad="show5()">
                          <span id="liveclock" style="position:absolute;left:10;top:10;">
                          </span>
                          <script language="JavaScript">
                          <!--
                          /*Upper Corner Live clock script credit: Website Abstraction (www.wsabstract.com) More free scripts here!
                          */
                          function show5(){
                          if (!document.layers&&!document.all)
                          return
                          var Digital=new Date()
                          var hours=Digital.getHours()
                          var minutes=Digital.getMinutes()
                          var seconds=Digital.getSeconds()
                          var dn="AM"
                          if (hours>12){ dn="PM"; hours=hours-12;
                          }
                          if (hours==0){ hours=12;}
                          if (minutes<=9){ minutes="0"+minutes;}
                          if (seconds<=9){ seconds="0"+seconds;}
                          //change font size here to your desire
                          myclock="<font size='3' face='Arial' ><b><font size='1'>Current Time:</font></br>"+hours+":"+minutes+":"
                          +seconds+" "+dn+"</b></font>"
                          if (document.layers){
                          document.layers.liveclock.document.write(myclock);
                          document.layers.liveclock.document.close();
                          }
                          else if (document.all){liveclock.innerHTML=myclock;}
                          setTimeout("show5()",1000);
                          }
                          //-->
                          </script>
                          #28
                            CDDLT 27.10.2005 19:15:18 (permalink)
                            Chuyển đổi các đơn vị đo chiều dài

                            <script language="JavaScript" type="text/javascript">
                            <!--
                            // Script Editor: Howard Chen

                            // Browser Compatible for the script: IE 3.0 or Higher

                            // Netscape 2.0 or Higher

                            // This script is free as long as you keep its credits

                            /*The way this works is the converter converts the number

                            into the smallest unit in the converter, in this case it will

                            be centimeter, and then it converts the unit fram centimeterto

                            other units.*/

                            function nofocus()

                            {

                            document.convert.InUnit.focus()

                            }

                            var cmValue = 1

                            var mValue = 100

                            var kmValue = 100000

                            var inValue = 2.54000843476

                            var ftValue = 30.4801012183

                            var ydValue = 91.440275784

                            var miValue = 160934.708789

                            function toCM()

                            {

                            var i = document.convert.unit.selectedIndex

                            var thisUnit = document.convert.unit.options.value

                            if (thisUnit == "CM")

                            {

                            document.convert.cm.value = document.convert.InUnit.value

                            }

                            else if(thisUnit == "M")

                            {

                            document.convert.cm.value = document.convert.InUnit.value * mValue

                            }

                            else if(thisUnit == "KM" )

                            {

                            document.convert.cm.value = document.convert.InUnit.value * kmValue

                            }

                            else if(thisUnit == "IN" )

                            {

                            document.convert.cm.value = document.convert.InUnit.value * inValue

                            }

                            else if(thisUnit == "FT" )

                            {

                            document.convert.cm.value = document.convert.InUnit.value * ftValue

                            }

                            else if(thisUnit == "YD" )

                            {

                            document.convert.cm.value = document.convert.InUnit.value * ydValue

                            }

                            else if(thisUnit == "MI" )

                            {

                            document.convert.cm.value = document.convert.InUnit.value * miValue

                            }

                            toAll()

                            }

                            function toAll()

                            {

                            var m = document.convert.cm.value

                            document.convert.m.value = m / mValue

                            document.convert.km.value = m / kmValue

                            document.convert.inch.value = m / inValue

                            document.convert.ft.value = m / ftValue

                            document.convert.yd.value = m / ydValue

                            document.convert.mi.value = m / miValue

                            }
                            //-->
                            </script>
                            <div align="center"><h1>Length Converter</h1></div>
                            <p>Simply choose the unit you want to use, type the value in the field next to it, and click the 'Convert' button.</p>
                            <div align="center"><form name="convert">
                            <table border=1>
                            <tr><th>Unit</th><th>Number</th></tr>
                            <tr>
                            <td>
                            <select name="unit">
                            <option value="CM">Centimetre
                            <option value="M">Metre
                            <option value="KM">Kilometre
                            <option value="IN">Inch
                            <option value="FT">Foot
                            <option value="YD">Yard
                            <option value="MI">Mile
                            </select>
                            </td>
                            <td>
                            <input type="text" name="InUnit" size="20" maxlength="20" value="0">
                            </td>
                            </tr>
                            <tr>
                            <td>
                            Centimetre: </td>
                            <td>
                            <input type="text" name="cm" size="20" maxlength="20" value="0" onFocus="nofocus()">
                            </td>
                            </tr>
                            <tr>
                            <td>
                            Metre:
                            </td>
                            <td>
                            <input type="text" name="m" size="20" maxlength="20" value="0" onFocus="nofocus()">
                            </td>
                            </tr>
                            <tr>
                            <td>
                            Kilometre: </td>
                            <td>
                            <input type="text" name="km" size="20" maxlength="20" value="0" onFocus="nofocus()">
                            </td>
                            </tr>
                            <tr>
                            <td>
                            Inch: </td>
                            <td>
                            <input type="text" name="inch" size="20" maxlength="20" value="0" onFocus="nofocus()">
                            </td>
                            </tr>
                            <tr>
                            <td>
                            Foot: </td>
                            <td>
                            <input type="text" name="ft" size="20" maxlength="20" value="0" onFocus="nofocus()"> </td>
                            </tr>
                            <tr>
                            <td>
                            Yard: </td>
                            <td>
                            <input type="text" name="yd" size="20" maxlength="20" value="0" onFocus="nofocus()">
                            </td>
                            </tr>
                            <tr>
                            <td>
                            Mile: </td>
                            <td>
                            <input type="text" name="mi" size="20" maxlength="20" value="0" onFocus="nofocus()">
                            </td>
                            </tr>
                            <tr>
                            <td align="center">
                            <input type="Reset" value="Start Over">
                            </td>
                            <td align="center">
                            <input type="button" value="Convert" onClick="toCM()">
                            </td>
                            </tr>
                            </table>
                            </form>
                            </div>
                            #29
                              CDDLT 27.10.2005 19:15:39 (permalink)
                              Tạo một menu list

                              <script language="JavaScript">

                              <!-- Begin
                              function go_to_station() {
                              if (document.stationform.stationselect.options[0].selected) {
                              window.location.href = "http://www.shop4all.com";}
                              else if (document.stationform.stationselect.options[1].selected) {
                              window.location.href = "http://www.coomedia.com";}
                              else if (document.stationform.stationselect.options[2].selected) {
                              window.location.href = "http://www.microsoft.com";}
                              else if (document.stationform.stationselect.options[3].selected) {
                              window.location.href = "http://www.yahoo.com";}
                              else if (document.stationform.stationselect.options[4].selected) {
                              window.location.href = "http://www.netscape.com";}
                              else if (document.stationform.stationselect.options[5].selected) {
                              window.location.href = "http://msdn.microsoft.com";}
                              return true;
                              }
                              function textValue() {
                              var stationInteger, stationString
                              stationInteger=document.stationform.stationselect.selectedIndex
                              stationString=document.stationform.stationselect.options[stationInteger].text
                              document.stationform.stationtext.value = "Go to " + stationString +"!"
                              }
                              // End -->
                              </script>
                              <body>
                              <center>
                              <table align="center" bgcolor="#b8860b" cellspacing="2" cellpadding="2" border="2">
                              <tr>
                              <td align="center">
                              <table border="0" cellspacing="2" cellpadding="2" align="CENTER" valign="MIDDLE" bgcolor="#deb887"><tr><td align="CENTER" valign="MIDDLE"><form name="stationform">
                              <select name="stationselect" onchange="textValue()" multiple size="5">
                              <option>Shopping Home Page
                              <option>BDG Home Page
                              <option>Microsoft Home Page
                              <option>Yahoo
                              <option>Netscape
                              <option>Developer's Page
                              </select></td></tr>
                              <tr><td align="CENTER" valign="MIDDLE">
                              <input type="button" name="stationbutton" value="Go!" onclick="go_to_station()">
                              </td></tr>
                              <tr><td align="CENTER" valign="MIDDLE"><input type="text" name="stationtext" value="" size="35" maxlength="35">
                              <p>
                              </form></td></tr></table></td>
                              </tr>
                              </table></center>
                              #30
                                Thay đổi trang: < 123 > >> | Trang 2 của 4 trang, bài viết từ 16 đến 30 trên tổng số 58 bài trong đề mục
                                Chuyển nhanh đến:

                                Thống kê hiện tại

                                Hiện đang có 0 thành viên và 2 bạn đọc.
                                Kiểu:
                                2000-2024 ASPPlayground.NET Forum Version 3.9