How to show the various time zones of the world on your website
Here is how you can show the various time zones of the world on your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | <!-- this script is from www.manycodes.com --> <table border= "0" width= "200" cellspacing= "0" cellpadding= "3" > <form name= "where" > <tr> <td width= "100%" > <select name= "city" size= "1" onchange= "updateclock(this);" > <option value= "" selected>Local time</option> <option value= "0" >London GMT</option> <option value= "1" >Rome</option> <option value= "7" >Bangkok</option> <option value= "8" >Hong Kong</option> <option value= "9" >Tokyo</option> <option value= "10" >Sydney</option> <option value= "12" >Fiji</option> <option value= "-10" >Hawaii</option> <option value= "-8" >San Francisco</option> <option value= "-5" >New York</option> <option value= "-3" >Buenos Aires</option> </select> </td> </tr> <tr> <td width= "100%" > <script language= "JavaScript" > /* Drop Down World Clock- By Learn iran (http://www.webloger.5u.com) Portions of code by Kurt @ http://www.webloger.5u.com/ This credit notice must stay intact */ if (document.all||document.getElementById) document.write( '<span id="worldclock" style="font:bold 16px Arial;"></span><br>' ) zone= 0 ; isitlocal= true ; ampm= '' ; function updateclock(z){ zone=z.options[z.selectedIndex].value; isitlocal=(z.options[ 0 ].selected)? true : false ; } function WorldClock(){ now= new Date(); ofst=now.getTimezoneOffset()/ 60 ; secs=now.getSeconds(); sec=- 1.57 +Math.PI*secs/ 30 ; mins=now.getMinutes(); min=- 1.57 +Math.PI*mins/ 30 ; hr=(isitlocal)?now.getHours():(now.getHours() + parseInt(ofst)) + parseInt(zone); hrs=- 1.575 +Math.PI*hr/ 6 +Math.PI*parseInt(now.getMinutes())/ 360 ; if (hr < 0 ) hr+= 24 ; if (hr > 23 ) hr-= 24 ; ampm = (hr > 11 )? "PM" : "AM" ; statusampm = ampm.toLowerCase(); hr2 = hr; if (hr2 == 0 ) hr2= 12 ; (hr2 < 13 )?hr2:hr2 %= 12 ; if (hr2< 10 ) hr2= "0" +hr2 var finaltime=hr2+ ':' +((mins < 10 )? "0" +mins:mins)+ ':' +((secs < 10 )? "0" +secs:secs)+ ' ' +statusampm; if (document.all) worldclock.innerHTML=finaltime else if (document.getElementById) document.getElementById( "worldclock" ).innerHTML=finaltime else if (document.layers){ document.worldclockns.document.worldclockns2.document.write(finaltime) document.worldclockns.document.worldclockns2.document.close() } setTimeout( 'WorldClock()' , 1000 ); } window.onload=WorldClock //--> </script> <!--Place holder for NS4 only--> <ilayer id= "worldclockns" width= 100 % height= 35 ><layer id= "worldclockns2" width= 100 % height= 35 left= 0 top= 0 style= "font:bold 16px Arial;" ></layer></ilayer> </td> </form> </tr> </table> <font face= "Tahoma" ><a target= "_blank" href= "http://www.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |
How to redirect to another webpage when a visitor visits your website
Here is how you can redirect to another webpage when a visitor visits your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <!-- this script is from www.manycodes.com --> <p><!--webbot bot= "HTMLMarkup" startspan --><form name= "redirect" > <center> <font face= "Arial" ><b>You will be redirected to the script in<br><br> <form> <input type= "text" size= "3" name= "redirect2" > </form> seconds</b></font> </center> <script> <!-- var targetURL= "http://www.javakhafan.7p.com" var countdownfrom= 5 var currentsecond=document.redirect.redirect2.value=countdownfrom+ 1 function countredirect(){ if (currentsecond!= 1 ){ currentsecond-= 1 document.redirect.redirect2.value=currentsecond } else { window.location=targetURL return } setTimeout( "countredirect()" , 1000 ) } countredirect() //--> </script> <!--webbot bot= "HTMLMarkup" endspan --></p> <font face= "Tahoma" ><a target= "_blank" href= "http://www.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |
How to automatically maximize the browser window when a visitor accesses your website
Here is how you can automatically maximize the browser window when a visitor accesses your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <!-- this script is from www.manycodes.com --> <!-- 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.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |
How to move/shake the internet explorer window when a visitor accesses your website
Here is how you can move/shake the internet explorer window when a visitor accesses your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <!-- this script is from www.manycodes.com --> <!-- START CODE Powered javascript code by WWW.javakhafan.7p.COM--> <meta http-equiv= "Content-Language" content= "en-us" > <SCRIPT language=JavaScript> <!-- Begin function shake(n) { if (parent.moveBy) { for (i = 10 ; i > 0 ; i--) { for (j = n; j > 0 ; j--) { parent.moveBy(-i, 0 ); parent.moveBy( 0 ,-i); parent.moveBy(-i, 0 ); parent.moveBy( 0 ,i); parent.moveBy(i, 0 ); parent.moveBy( 0 ,-i); parent.moveBy(-i, 0 ); parent.moveBy( 0 ,i); parent.moveBy(i, 0 ); parent.moveBy( 0 ,-i); parent.moveBy(-i, 0 ); parent.moveBy( 0 ,-i); parent.moveBy(i, 0 ); parent.moveBy( 0 ,i); parent.moveBy(i, 0 ); parent.moveBy( 0 ,i); } } } } // End --> <!-- shake( 1 ); //--> </SCRIPT> <font face= "Tahoma" ><a target= "_blank" href= "http://www.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |
How to show an alert by click (msg box) on your website
Here is how you can show an alert by click (msg box) on your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 | <!-- this script is from www.manycodes.com --><!-- Start of Message Alert --> <!-- Use this button in a form to pop-up a message when the user clicks it --> <form> <input type= "button" value= "message" onClick= "alert('YOUR MESSAGE GOES HERE'); return true" > </form> <!-- End of Message Alert --> <font face= "Tahoma" ><a target= "_blank" href= "http://www.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |
How to have a opening popup with your website
Here is how to have a opening popup with your website.
Put the code below within your site's <head> </head> tags. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | <!-- this script is from www.manycodes.com --> <!-- DESCRIPTION: This will make a small Navigation Window in which you can place links to different pages. INSTRUCTIONS: Place this script in the HEAD tags of your webpage. FUNCTIONALITY: Works in both Netscape & IE. --> <SCRIPT LANGUAGE= "JavaScript" > //Modified by CoffeeCup Software //This code is Copyright (c) 1997 CoffeeCup Software //all rights reserved. License is granted to a single user to //reuse this code on a personal or business Web Site. <!-- coffeeWin=window.open( "" , "coffeeWin" , "toolbar=no,width=200,height=250,directories=no,menubar=no,SCROLLBARS=no" ); coffeeWin.document.write( "<HTML>" ); coffeeWin.document.write( "<HEAD>" ); coffeeWin.document.write( "</HEAD>" ); coffeeWin.document.write( "<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#0000FF VLINK=#0000FF>" ) coffeeWin.document.write( "<CENTER>" ) coffeeWin.document.write( "<FONT FACE=VERDANA,ARIAL SIZE=2>" ); coffeeWin.document.write( "<B>" ); coffeeWin.document.write( "<FONT SIZE=3>Navigation Window</FONT>" ); coffeeWin.document.write( "<BR><HR WIDTH=180><BR><P>" ); coffeeWin.document.write( "<P>" ); coffeeWin.document.write( "<P>" ); coffeeWin.document.write( "<P>" ); coffeeWin.document.write( "<P>" ); coffeeWin.document.write( "</B>" ); coffeeWin.document.write( "</FONT>" ); coffeeWin.document.write( "</BODY>" ); coffeeWin.document.write( "</HTML>" ); //--> </SCRIPT> <font face= "Tahoma" ><a target= "_blank" href= "http://www.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |
How to have your visitor add your website to his web browser bookmarks with just a click
Here is how you can have your visitor add your website to his web browser bookmarks with just a click.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <!-- this script is from www.manycodes.com --> <!-- Start of Add to Favorites IE --> <!-- Put this script anywhere in your webpage and when a visitor goes to your webpage using Internet Explorer, they only need to click on the link to add your webpage to their FAVORITES folder. Netscape users will simply get a reminder to press CTRL-D to bookmark. --> <SCRIPT LANGUAGE= "JavaScript" > <!-- if ((navigator.appName == "Microsoft Internet Explorer" ) && (parseInt(navigator.appVersion) >= 4 )) { var title= "Webloger - Web Authoring Tools" ; document.write( '<A HREF="javascript:window.ext' ); document.write( 'ernal.AddFavorite(url,title);" ' ); document.write( 'onMouseOver=" window.status=' ); document.write( "'Add our site to your favorites!'; return true " ); document.write( '"onMouseOut=" window.status=' ); document.write( "' '; return true " ); document.write( '">Add our site to your favorites!</a>' ); } else { var msg = "Don't forget to bookmark us!" ; if (navigator.appName == "Netscape" ) msg += " (CTRL-D)" ; document.write(msg); } // --> </script> <!-- End of Add to Favorites IE --> <font face= "Tahoma" ><a target= "_blank" href= "http://www.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |
How to have date and time following mouse in your website
Here is how you can have date and time following mouse in your website.
Put the code below within your site's source code. If you dont know how to implement this code into your site, please goto how to implement the code to your website
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | <!-- this script is from www.manycodes.com --> <span lang= "en-us" ><font color= "#FFFFFF" ><b> <font size= "5" color= "#FFFFFF" > <a href= "http://www.javakhafan.9f.com.com" >http://www.javakhafan.9f.com.com</a></font></b></font></span>--> <SCRIPT language=JavaScript> dCol= 'cc0099' ; //date colour. fCol= 'ff99cc' ; //face colour. sCol= 'cc99ff' ; //seconds colour. mCol= '008000' ; //minutes colour. hCol= '000080' ; //hours colour. ClockHeight= 40 ; ClockWidth= 40 ; ClockFromMouseY= 0 ; ClockFromMouseX= 100 ; //Alter nothing below! Alignments will be lost! d= new Array( "SUNDAY" , "MONDAY" , "TUESDAY" , "WEDNESDAY" , "THURSDAY" , "FRIDAY" , "SATURDAY" ); m= new Array( "JANUARY" , "FEBRUARY" , "MARCH" , "APRIL" , "MAY" , "JUNE" , "JULY" , "AUGUST" , "SEPTEMBER" , "OCTOBER" , "NOVEMBER" , "DECEMBER" ); date= new Date(); day=date.getDate(); year=date.getYear(); if (year < 2000 ) year=year+ 1900 ; TodaysDate= " " +d[date.getDay()]+ " " +day+ " " +m[date.getMonth()]+ " " +year; D=TodaysDate.split( '' ); H= 'ooo' ; H=H.split( '' ); M= 'oooo' ; M=M.split( '' ); S= '.....' ; S=S.split( '' ); Face= '1 2 3 4 5 6 7 8 9 10 11 12' ; font= 'tohoma' ; size= 1 ; speed= 0.6 ; ns=(document.layers); ie=(document.all); Face=Face.split( ' ' ); n=Face.length; a=size* 10 ; ymouse= 0 ; xmouse= 0 ; scrll= 0 ; props= "<font face=" +font+ " size=" +size+ " color=" +fCol+ "><B>" ; props2= "<font face=" +font+ " size=" +size+ " color=" +dCol+ "><B>" ; Split= 360 /n; Dsplit= 360 /D.length; HandHeight=ClockHeight/ 4.5 HandWidth=ClockWidth/ 4.5 HandY=- 7 ; HandX=- 2.5 ; scrll= 0 ; step= 0.06 ; currStep= 0 ; y= new Array();x= new Array();Y= new Array();X= new Array(); for (i= 0 ; i < n; i++){y[i]= 0 ;x[i]= 0 ;Y[i]= 0 ;X[i]= 0 } Dy= new Array();Dx= new Array();DY= new Array();DX= new Array(); for (i= 0 ; i < D.length; i++){Dy[i]= 0 ;Dx[i]= 0 ;DY[i]= 0 ;DX[i]= 0 } if (ns){ for (i= 0 ; i < D.length; i++) document.write( '<layer name="nsDate' +i+ '" top=0 left=0 height=' +a+ ' width=' +a+ '><center>' +props2+D[i]+ '</font></center></layer>' ); for (i= 0 ; i < n; i++) document.write( '<layer name="nsFace' +i+ '" top=0 left=0 height=' +a+ ' width=' +a+ '><center>' +props+Face[i]+ '</font></center></layer>' ); for (i= 0 ; i < S.length; i++) document.write( '<layer name=nsSeconds' +i+ ' top=0 left=0 width=15 height=15><font face=Arial size=3 color=' +sCol+ '><center><b>' +S[i]+ '</b></center></font></layer>' ); for (i= 0 ; i < M.length; i++) document.write( '<layer name=nsMinutes' +i+ ' top=0 left=0 width=15 height=15><font face=Arial size=3 color=' +mCol+ '><center><b>' +M[i]+ '</b></center></font></layer>' ); for (i= 0 ; i < H.length; i++) document.write( '<layer name=nsHours' +i+ ' top=0 left=0 width=15 height=15><font face=Arial size=3 color=' +hCol+ '><center><b>' +H[i]+ '</b></center></font></layer>' ); } if (ie){ document.write( '<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">' ); for (i= 0 ; i < D.length; i++) document.write( '<div id="ieDate" style="position:absolute;top:0px;left:0;height:' +a+ ';width:' +a+ ';text-align:center">' +props2+D[i]+ '</B></font></div>' ); document.write( '</div></div>' ); document.write( '<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">' ); for (i= 0 ; i < n; i++) document.write( '<div id="ieFace" style="position:absolute;top:0px;left:0;height:' +a+ ';width:' +a+ ';text-align:center">' +props+Face[i]+ '</B></font></div>' ); document.write( '</div></div>' ); document.write( '<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">' ); for (i= 0 ; i < H.length; i++) document.write( '<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:' +hCol+ ';text-align:center;font-weight:bold">' +H[i]+ '</div>' ); document.write( '</div></div>' ); document.write( '<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">' ); for (i= 0 ; i < M.length; i++) document.write( '<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:' +mCol+ ';text-align:center;font-weight:bold">' +M[i]+ '</div>' ); document.write( '</div></div>' ) document.write( '<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">' ); for (i= 0 ; i < S.length; i++) document.write( '<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:' +sCol+ ';text-align:center;font-weight:bold">' +S[i]+ '</div>' ); document.write( '</div></div>' ) } (ns)?window.captureEvents(Event.MOUSEMOVE): 0 ; function Mouse(evnt){ ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY; xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX; } (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse; function ClockAndAssign(){ time = new Date (); secs = time.getSeconds(); sec = - 1.57 + Math.PI * secs/ 30 ; mins = time.getMinutes(); min = - 1.57 + Math.PI * mins/ 30 ; hr = time.getHours(); hrs = - 1.575 + Math.PI * hr/ 6 +Math.PI*parseInt(time.getMinutes())/ 360 ; if (ie){ Od.style.top=window.document.body.scrollTop; Of.style.top=window.document.body.scrollTop; Oh.style.top=window.document.body.scrollTop; Om.style.top=window.document.body.scrollTop; Os.style.top=window.document.body.scrollTop; } for (i= 0 ; i < n; i++){ var F=(ns)?document.layers[ 'nsFace' +i]:ieFace[i].style; F.top=y[i] + ClockHeight*Math.sin(- 1.0471 + i*Split*Math.PI/ 180 )+scrll; F.left=x[i] + ClockWidth*Math.cos(- 1.0471 + i*Split*Math.PI/ 180 ); } for (i= 0 ; i < H.length; i++){ var HL=(ns)?document.layers[ 'nsHours' +i]:ieHours[i].style; HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll; HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs); } for (i= 0 ; i < M.length; i++){ var ML=(ns)?document.layers[ 'nsMinutes' +i]:ieMinutes[i].style; ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll; ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min); } for (i= 0 ; i < S.length; i++){ var SL=(ns)?document.layers[ 'nsSeconds' +i]:ieSeconds[i].style; SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll; SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec); } for (i= 0 ; i < D.length; i++){ var DL=(ns)?document.layers[ 'nsDate' +i]:ieDate[i].style; DL.top=Dy[i] + ClockHeight* 1.5 *Math.sin(currStep+i*Dsplit*Math.PI/ 180 )+scrll; DL.left=Dx[i] + ClockWidth* 1.5 *Math.cos(currStep+i*Dsplit*Math.PI/ 180 ); } currStep-=step; } function Delay(){ scrll=(ns)?window.pageYOffset: 0 ; Dy[ 0 ]=Math.round(DY[ 0 ]+=((ymouse)-DY[ 0 ])*speed); Dx[ 0 ]=Math.round(DX[ 0 ]+=((xmouse)-DX[ 0 ])*speed); for (i= 1 ; i < D.length; i++){ Dy[i]=Math.round(DY[i]+=(Dy[i- 1 ]-DY[i])*speed); Dx[i]=Math.round(DX[i]+=(Dx[i- 1 ]-DX[i])*speed); } y[ 0 ]=Math.round(Y[ 0 ]+=((ymouse)-Y[ 0 ])*speed); x[ 0 ]=Math.round(X[ 0 ]+=((xmouse)-X[ 0 ])*speed); for (i= 1 ; i < n; i++){ y[i]=Math.round(Y[i]+=(y[i- 1 ]-Y[i])*speed); x[i]=Math.round(X[i]+=(x[i- 1 ]-X[i])*speed); } ClockAndAssign(); setTimeout( 'Delay()' , 20 ); } if (ns||ie)window.onload=Delay; </SCRIPT> <font face= "Tahoma" ><a target= "_blank" href= "http://www.manycodes.com/category/java/javascript-codes/" ><span style= "font-size: 8pt; text-decoration: none" >JavaScript Free Code</span></a></font> |