Jump to content

Bu Script Neden Sayfadan Taşıyor ?


Recommended Posts

Merhaba arkadaşlar;

Aşağıdaki vereceğim kodu web siteme yerleştirmek istiyorum.Fakat sayfanın sağında bir hayli boşluk kalıyor ve bir türlü bunu düzenleyemedim.
Kodu body arasına yerleştiriyorum ama olmuyor...

İşte kod:

 

 

<!-- START CODE FOR THE BOARD WITH MANY WORLD TIME CLOCKS -->
 
<!----------------------------------------->
<!-- START OF STYLE-CONFIGURATION -->
<!----------------------------------------->
<style>
.clocktextstyle { /* set the style for the text below the clocks */
font-family:Arial;
font-size:10pt;
color:#aaaaaa;
}
</style>
<!----------------------------------------->
<!-- END OF STYLE-CONFIGURATION -->
<!----------------------------------------->
 
<font color="blue">
 
<script>
// CREDITS:
// Board with many World Time Clocks
// By Peter Gehrig
// Copyright (c) 2010 Peter Gehrig. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.fabulant.com
 
// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a highly visible link to
// http://www.fabulant.com on the webpage
// where this script will be featured
 
/////////////////////////////////////////////////
// START OF SCRIPT-CONFIGURATION
/////////////////////////////////////////////////
 
// Set below the locations and the difference (hours) to Greenich Mean Time
// Add as many locations as you like
// IMPORTANT: study carefully where commas are required
 
var worldtime = [ // do not change this line
 
{
location : "Antalya", // set any location
shift : 2 // set the difference to Greenich Mean Time (hours)
}, // comma is required!
 
{
location : "Berlin", // set any location
shift : 1 // set he difference to Greenich Mean Time (hours)
}, // comma is required!
 
{
location : "Paris", // set any location
shift : 1 // set he difference to Greenich Mean Time (hours)
}, // comma is required!
 
{
location : "Londra", // set any location
shift : 0 // set he difference to Greenich Mean Time (hours)
}, // comma is required!
 
{
location : "Viyana", // set any location
shift : 1 // set the difference to Greenich Mean Time (hours)
} // comma is NOT required for the last very line
 
] // do not change this line
 
// set the length for each hand (pixels)
var hand_sec_length=22
var hand_min_length=25
var hand_hour_length=15
 
// set the color for each hand (hexadecimal values required)
var hand_sec_color="#FF0000"
var hand_min_color="#000000"
var hand_hour_color="#000000"
 
// set the weight for each hand (pixels) 
var hand_sec_weight=1
var hand_min_weight=1
var hand_hour_weight=1
 
// set the weight of the face's outline (pixels)
var face_outlineweight=1
 
// set width and height of the face (pixels)
var face_width=50
var face_height=50
 
// set color of the face's outline
var face_outlinecolor="#000000"
 
// set the horizontal distance between the clocks (pixels)
var distance_between_clocks=40
 
// set the vertical distance to the text below the clocks(pixels)
var distance_to_text=10
 
// set the height of the two text lines below the clocks (pixels)
var text_height=30
 
/////////////////////////////////////////////////
// END OF SCRIPT-CONFIGURATION
/////////////////////////////////////////////////
 
// do not edit below this line
var pi= Math.PI
var x_sec=0
var y_sec=0
var x_min=0
var y_min=0
var x_hour=0
var y_hour=0
var angle=270
var x,y
var i_id=0
var ampm=""
 
function getxy(thistime,thisradius) {
angle=6*parseInt(thistime)-90
x=Math.round((thisradius*Math.cos(angle*(pi/180)))+face_width/2)
y=Math.round((thisradius*Math.sin(angle*(pi/180)))+face_height/2)
}
 
function dorotate() {
for (ii=0;ii<worldtime.length;ii++) {
var now = new Date()
var nowsec = now.getUTCSeconds()
var nowmin = now.getUTCMinutes()
var nowhour = now.getUTCHours()
var nowhour=nowhour+worldtime[ii].shift
if (nowhour<=5) {
ampm=""
}
else if (nowhour<12) {
ampm=""
}
else if (nowhour<=18) {
ampm=""
}
else if (nowhour<=20) {
ampm=""
}
else if (nowhour<=24) {
ampm=""
}
 
if (nowhour>=12) {
nowhour-=12
}
nowhour=(30*nowhour+(nowmin/2))/6
for (i=1;i<=hand_sec_length;i++) {
getxy(nowsec,i)
document.getElementById('sec'+(i+(i_id*hand_sec_length))).style.left=(x+(ii*(distance_between_clocks+face_width)))+"px"
document.getElementById('sec'+(i+(i_id*hand_sec_length))).style.top=y+"px"
}
for (i=1;i<=hand_min_length;i++) {
getxy(nowmin,i)
document.getElementById('min'+(i+(i_id*hand_min_length))).style.left=(x+(ii*(distance_between_clocks+face_width)))+"px"
document.getElementById('min'+(i+(i_id*hand_min_length))).style.top=y+"px"
}
for (i=1;i<=hand_hour_length;i++) {
getxy(nowhour,i)
document.getElementById('hour'+(i+(i_id*hand_hour_length))).style.left=(x+(ii*(distance_between_clocks+face_width)))+"px"
document.getElementById('hour'+(i+(i_id*hand_hour_length))).style.top=y+"px"
}
document.getElementById('clocktext'+ii).innerHTML=worldtime[ii].location+"<br>"+ampm
i_id++
}
i_id=0
var timer=setTimeout("dorotate()",1000)
}
 
document.write('<div id="roof" style="position:relative;height:'+(face_width+text_height)+'px;">')
for (ii=0;ii<worldtime.length;ii++) {
for (i=1;i<=12;i++) {
angle=30*parseInt(i)-90
x=(face_width/2*Math.cos(angle*(pi/180)))+face_width/2+(ii*(distance_between_clocks+face_width))
y=(face_height/2*Math.sin(angle*(pi/180)))+face_height/2
if (angle==90) {
document.write('<div style="position:absolute;left:'+(x)+'px;top:'+(y-2)+'px;background-color:'+face_outlinecolor+';width:'+face_outlineweight+'px;height:'+(face_outlineweight+2)+'px;overflow:hidden"></div>')
}
else if (angle==270) {
document.write('<div style="position:absolute;left:'+(x)+'px;top:'+y+'px;background-color:'+face_outlinecolor+';width:'+(face_outlineweight)+'px;height:'+(face_outlineweight+2)+'px;overflow:hidden"></div>')
}
 
else if (angle==0) {
document.write('<div style="position:absolute;left:'+(x-2)+'px;top:'+y+'px;background-color:'+face_outlinecolor+';width:'+(face_outlineweight+2)+'px;height:'+face_outlineweight+'px;overflow:hidden"></div>')
}
 
else if (angle==180) {
document.write('<div style="position:absolute;left:'+(x)+'px;top:'+y+'px;background-color:'+face_outlinecolor+';width:'+(face_outlineweight+2)+'px;height:'+face_outlineweight+'px;overflow:hidden"></div>')
}
else {
document.write('<div style="position:absolute;left:'+x+'px;top:'+y+'px;background-color:'+face_outlinecolor+';width:'+face_outlineweight+'px;height:'+face_outlineweight+'px;overflow:hidden"></div>')
}
}
 
for (i=1;i<=hand_sec_length;i++) {
document.write('<div id="sec'+(i+(i_id*hand_sec_length))+'" style="position:absolute;left:0px;top:0px;background-color:'+hand_sec_color+';width:'+hand_sec_weight+'px;height:'+hand_sec_weight+'px;overflow:hidden"></div>')
}
for (i=1;i<=hand_min_length;i++) {
document.write('<div id="min'+(i+(i_id*hand_min_length))+'" style="position:absolute;left:0px;top:0px;background-color:'+hand_min_color+';width:'+hand_min_weight+'px;height:'+hand_min_weight+'px;overflow:hidden"></div>')
}
for (i=1;i<=hand_hour_length;i++) {
document.write('<div id="hour'+(i+(i_id*hand_hour_length))+'" style="position:absolute;left:0px;top:0px;background-color:'+hand_hour_color+';width:'+hand_hour_weight+'px;height:'+hand_hour_weight+'px;overflow:hidden"></div>')
}
document.write('<span id="clocktext'+(ii)+'" class="clocktextstyle" style="position:absolute;left:'+(ii*(distance_between_clocks+face_width))+'px;top:'+(face_height+distance_to_text)+'px;width:'+face_width+(0.5*distance_between_clocks)+'px;">'+worldtime[ii].location+'</span>')
i_id++
}
document.write('</div')
i_id=0
window.onload=dorotate
 
</script>
 
</font>
 
<!-- END CODE FOR THE BOARD WITH MANY WORLD TIME CLOCKS -->
 

 

 


Yardım edebilecek üstadlara şimdiden teşekkür ederim..

Edited by volkantr19
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...