Advertisement
morpe

lezione di 1 feb 2010

Feb 1st, 2011
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3.  
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <title>tab switch</title>
  8. <meta name="author" content="morpe">
  9. <!-- Date: 2011-01-23 -->
  10.  
  11. <style type="text/css">
  12.  
  13. #mio_gif{
  14. text-align: center;
  15.  
  16. width:250px;
  17. height: 250px;
  18. margin: auto auto;
  19.  
  20. </style>
  21.  
  22. <script type="text/javascript" >
  23. /*
  24. var fufu = true;
  25. numero = 0;
  26. immagini = new Array(19);
  27. nomi = new Array();
  28.  
  29. for( i=1; i<immagini.length; i++)
  30. {
  31. immagini[i] = "banner/c"+i+".gif";
  32. }
  33.  
  34. for (i=1; i<immagini.length; i++)
  35. {
  36. nomi[i] = "mia_img"+i;
  37. }
  38.  
  39. for (i=1; i<immagini.length; i++)
  40. {
  41. nomi[i] = new Image();
  42. nomi[i].src = immagini[i];
  43. }
  44.  
  45.  
  46. function scorri(){
  47. numero++;
  48. if(numero == 19)numero = 1;
  49. document.satan.src = nomi[numero].src;
  50. setTimeout("scorri()",1500);
  51. document.getElementById("mostra_nome").innerHTML = immagini[numero];
  52. //alert("funzione scorri()");
  53. }
  54.  
  55. function scambia(){
  56. var controlla = document.satan.src;
  57. if(controlla == nomi[1].src){
  58.  
  59. document.satan.src = nomi[2].src;
  60.  
  61. }
  62. else{
  63. document.satan.src = nomi[1].src;
  64.  
  65. }
  66.  
  67. }
  68.  
  69. function ferma(){
  70. fufu = false;
  71. document.getElementById("play_stop").innerHTML = '<a href="#" onclick="ferma();">riparti</a>';
  72.  
  73. }
  74.  
  75. function calcola()
  76. {
  77. num1 = document.f1.t1.value;
  78. num2 = document.f1.t2.value;
  79. num3 = document.f1.t3.value;
  80.  
  81.  
  82.  
  83. potenza = Math.pow(num1, num2)
  84. document.getElementById("risultato").innerHTML = num1 * num2;
  85.  
  86.  
  87.  
  88. //alert(potenza);
  89. //numero = 321,1473333;
  90.  
  91. //alert("round: "+Math.round(numero))
  92. //alert("floor: "+Math.floor(numero))
  93. //alert("ceil: "+Math.ceil(numero))
  94. }
  95.  
  96. */
  97.  
  98. function mia_str()
  99. {
  100. var indirizzo ="nixon@nwo.com";
  101. var mostra = indirizzo.indexOf("@");
  102. alert("indexOf: "+mostra);
  103.  
  104. var nome_str = indirizzo.substring(0, mostra);
  105. alert("substring: "+nome_str+" l'user");
  106.  
  107. var nome_str2 = indirizzo.substr(mostra +1, mostra);
  108. alert("substr: "+nome_str2+" il server");
  109.  
  110. var carattere = indirizzo.charAt(mostra);
  111. alert("charAt: "+carattere);
  112.  
  113. var codiceAsci = indirizzo.charCodeAt(mostra);
  114. alert("codice asci: "+codiceAsci);
  115.  
  116.  
  117. }
  118. </script>
  119.  
  120. </head>
  121.  
  122.  
  123.  
  124. <body onload="mia_str()">
  125. <!--
  126. <div id="mio_gif">
  127. onload="javascript: //scorri();"
  128. <div id="mostra_nome"><h1>huuuuuuuuu!!</h1></div>
  129. <div id="play_stop">
  130. <a href="#" onclick="ferma();">ferma</a>
  131. </div>
  132. <img src="banner/c5.gif" name="satan" width="100%" border="0" alt="banner" title="animation"/><br>
  133. </div>
  134. -->
  135.  
  136. <div id="calcolatrice">
  137. <form name="f1">
  138. <!-- <input type="text" name="t1" value="0.45"><br>
  139. <input type="text" name="t2" value="3.14"><br>
  140. <input type="text" name="t3" value="10">round<br> -->
  141. <span id="risultato">risultato</span><br>
  142.  
  143.  
  144. </form>
  145. </div>
  146. </body>
  147. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement