Forum o programowaniu i nie tylko
Witam!! A tu gotowce.
Zamieszczam tu skrypty na strone HTML.
Zegarek(BODY)
<script language="javascript"> <!--W3e JAVAscript Preset var timerID = null; var timerRunning = false; function stopclock() { if(timerRunning) clearTimeout(timerID) timerRunning = false; } function startclock() { stopclock(); showtime(); } 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; timerID = setTimeout("showtime()",1000); timerRunning = true; } //--> </script> <form name="clock" onSubmit="0"> <input type="text" name="face" size="24"> </form> <script>startclock();</script>
Data i czas-W znaczniku HEAD
<!-- Scripts--> <script Language="JavaScript"> <!-- Helpers for JSI page... // Navigation - Start function goback(){ alert("Good Bye!"); history.go(-1); } function gettheDate() { Todays = new Date(); TheDate = "" + (Todays.getMonth()+ 1) +" / "+ Todays.getDate() + " / " + Todays.getYear() document.clock.date.value = TheDate; } var timerID = null; var timerRunning = false; function stopclock (){ if(timerRunning) clearTimeout(timerID); timerRunning = false; } function startclock () { // Make sure the clock is stopped stopclock(); gettheDate() showtime(); } 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; timerID = setTimeout("showtime()",1000); timerRunning = true; } // end Helpers --> </script>
Data i czas-W znaczniku BODY
<BODY ONLOAD="startclock()" bgcolor="#FFFFFF"> <table> <tr> <td> <form name="clock" onSubmit="0"> <div align=right> <input type="text" name="date" size=12 value=""> <input type="text" name="face" size=12 value=""> </div></form> </td> </tr> </table>
Odliczanie jak dlugo jestes na stronie.(BODY)
<body onLoad="window.setTimeout('getSecs()',1)"> <script> // This script is written by Patrick Meirmans // If you want to use it, send me an e-mail at mijter@dds.nl // and be sure to include your URL, I'ld like to see how you used it // If you have mailed me you are free to change this script // anyway you like // by the way, my homepage is at: // http://www.geocities.com/Nashville/2956/ // You might want to take a look at it. startday = new Date(); clockStart = startday.getTime(); function initStopwatch() { var myTime = new Date(); var timeNow = myTime.getTime(); var timeDiff = timeNow - clockStart; this.diffSecs = timeDiff/1000; return(this.diffSecs); } function getSecs() { var mySecs = initStopwatch(); var mySecs1 = ""+mySecs; mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")); document.tijd.hiero.value=mySecs1 window.setTimeout('getSecs()',1000); if (mySecs1==60) {alert("jesteś tutaj już 60 sekund ...") } if (mySecs1==333) {alert("jesteś tutaj już 333 sekundy...") } if (mySecs1==666) {alert("jesteś tutaj już 666 sekund ...") } if (mySecs1==999) {alert("Ciągle jesteś zainteresowany tą stroną; to już 999 sekund...") } } // To get rid of the alerts, you can just delete the three lines above // or just one or two of them // Change the 333, 666 and 999 to whatever you like // For the messages, just change the text between the " " // to whatever you like, // Have fun!! </script> </P> <P><form name="tijd"><P> <center>Jesteś tutaj już przez: <br> <input size=4 name=hiero> <br>sekund. </form> </center>
Chcecie wiecej?? Piszcie!
Offline
Ok przyznam sie,skopiowane Ale wazne ze jest
Ok daje wiecej skryptuw.
Fajny bajer ;] lecz dziala tylko w Internet explorerze,Dzialanie-Pokazuje czas w oknie statusu.
W znaczniku HEAD.
<!-- Scripts--> <script Language="JavaScript"> <!-- hide// Navigation - Stop 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(); } // un hide ---> </script>
A tu w znaczniku BODY
<BODY ONLOAD="startclock()">
A jak ktos chce wiecej,pisac
Offline