Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    dove inserire la scritta

    Salve a tutti, io ho questo script:

    <SCRIPT LANGUAGE="JavaScript">

    var timerID = null;

    var timerRunning = false;

    function stopclock (){

    if(timerRunning)

    clearTimeout(timerID);

    timerRunning = false;

    }

    function showtime () {

    var now = new Date();

    var hours = now.getHours();

    var minutes = now.getMinutes();

    var seconds = now.getSeconds()

    var timeValue = "" + ((hours >12) ? hours -12 :hours)

    timeValue += ((minutes < 10) ? ":0" : ":") + minutes

    timeValue += ((seconds < 10) ? ":0" : ":") + seconds

    timeValue += (hours >= 12) ? " p.m." : " a.m."

    document.clock.face.value = timeValue;

    // you could replace the above with this

    // and have a clock on the status bar:

    // window.status = timeValue;

    timerID = setTimeout("showtime()",1000);

    timerRunning = true;

    }

    function startclock () {

    // Make sure the clock is stopped

    stopclock();

    showtime();

    }

    </SCRIPT>

    </HEAD>

    <BODY bgcolor="black" onLoad="startclock(); timerONE=window.setTimeout" scroll="no">
    <form name="clock" onSubmit="0">
    <input type="text" name="face" size=13 value=""></font>



    Vorrei sapere dove inserire la seguente scritta:

    "In questo momento sono le ore:"



    Grazie.
    Io sono il regista del mio film; scelgo io la trama e finale.

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    3,259
    devi inserire una nuova variabile...

    usa questo

    codice:
    <SCRIPT LANGUAGE="JavaScript"> 
    
    var timerID = null; 
    
    var timerRunning = false; 
    
    function stopclock (){ 
    
    if(timerRunning) 
    
    clearTimeout(timerID); 
    
    timerRunning = false; 
    
    } 
    
    function showtime () { 
    //Variabile da settare
    var testo="Sono le ore ";
    var now = new Date(); 
    
    var hours = now.getHours(); 
    
    var minutes = now.getMinutes(); 
    
    var seconds = now.getSeconds() 
    
    var timeValue = "" + ((hours >12) ? hours -12 :hours) 
    
    timeValue += ((minutes < 10) ? ":0" : ":") + minutes 
    
    timeValue += ((seconds < 10) ? ":0" : ":") + seconds 
    
    timeValue += (hours >= 12) ? " p.m." : " a.m." 
    
    document.clock.face.value = testo+timeValue; 
    
    // you could replace the above with this 
    
    // and have a clock on the status bar: 
    
    // window.status = timeValue; 
    
    timerID = setTimeout("showtime()",1000); 
    
    timerRunning = true; 
    
    } 
    
    function startclock () { 
    
    // Make sure the clock is stopped 
    
    stopclock(); 
    
    showtime(); 
    
    } 
    
    </SCRIPT> 
    
    </HEAD> 
    
    <BODY bgcolor="black" onLoad="startclock(); timerONE=window.setTimeout" scroll="no"> 
    <form name="clock" onSubmit="0"> 
    <input type="text" name="face" size=13 value=""></font>

  3. #3

    e se

    e se invece di associare l'ora ad una casella di testo volessi semplicemente scriverla ? quale oggetto posso usare ?
    BillyCorgan.it
    http://www.billycorgan.it

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.