一个关于控制浏览器的问题。。。。十万火急。。。。!!!!!!!!!!谢谢各位了
mxyun 2002-06-06 03:37:47 在 javascript 中我要用到超连接。。但是我要怎么才能控制我打开的页面的大小呢?比如:我要控制tj9.asp的大小
程序代码全部如下:注释的就是我要实现的功能。我要把上一句实现成下一句的的功能。。。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>日历</title>
<style type="text/css">
<!--
A:link {COLOR: #666666; TEXT-DECORATION: none}
A:visited {COLOR: #666666; TEXT-DECORATION: none}
A:hover {COLOR: #0066CC; TEXT-DECORATION: underline}
body { font-size: 9pt}
table { font-size: 9pt}
a { text-decoration: none}
-->
</style>
<script language="JavaScript">
<!--
var Selected_Month;
var Selected_Year;
var Current_Date = new Date();
var Current_Month = Current_Date.getMonth();
var Days_in_Month = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var Month_Label = new Array('一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月');
var Current_Year = Current_Date.getYear();
var Today = Current_Date.getDate();
function Header(Year, Month) {
if (Month == 1) {
if ((Year % 400 == 0) || ((Year % 4 == 0) && (Year % 100 != 0))) {
Days_in_Month[1] = 29;
}
}
var Header_String = Year + '年' + Month_Label[Month];
return Header_String;
}
function Make_Calendar(Year, Month) {
var First_Date = new Date(Year, Month, 1);
var Heading = Header(Year, Month);
var First_Day = First_Date.getDay() + 1;
var Ydate=Year;
var Mdate=Month+1
if (((Days_in_Month[Month] == 31) && (First_Day >= 6)) ||
((Days_in_Month[Month] == 30) && (First_Day == 7))) {
var Rows = 6;
}
else if ((Days_in_Month[Month] == 28) && (First_Day == 1)) {
var Rows = 4;
}
else {
var Rows = 5;
}
var HTML_String = '<table width=120 height=146><tr><td valign="top"><table BORDER=0 CELLSPACING=0 cellpadding=0 FRAME="box" BGCOLOR="#ffffff" BORDERCOLORLIGHT="808080" width=124 height=146>';
HTML_String += '<tr><th colspan=7 BGCOLOR="FFFFFF" BORDERCOLOR="000000">' + Heading + '</th></tr>';
HTML_String += '<tr><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">日</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">一</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">二</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">三</th>';
HTML_String += '<th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">四</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">五</th><th ALIGN="CENTER" BGCOLOR="FFFFFF" BORDERCOLOR="000000">六</th></tr>';
var Day_Counter = 1;
var Loop_Counter = 1;
var strToday=Current_Year+'-';
if(Current_Month<9)
strToday+='0';
strToday+=(1+Current_Month)+'-';
if(Today<10)
strToday+='0';
strToday+=Today;
var theDay='';
var theYearMonth='';
theYearMonth=Year+'-';
if(Month<9)
theYearMonth+='0';
theYearMonth+=(1+Month)+'-';
for (var j = 1; j <= Rows; j++) {
HTML_String += '<tr ALIGN="left" VALIGN="top">';
for (var i = 1; i < 8; i++) {
if ((Loop_Counter >= First_Day) && (Day_Counter <= Days_in_Month[Month]))
{
if(Day_Counter<10)
theDay=theYearMonth+'0'+Day_Counter;
else
theDay=theYearMonth+Day_Counter;
if (theDay==strToday)
{
HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000"><a href="tj9.asp?tdate='+Year+'-'+Mdate +'-'+Day_Counter+ '" target=_blank><strong><font color="red">' + Day_Counter + '</font></strong></a></td>';
//HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000"><a href="openwindow('tj9.asp?tdate='+Year+'-'+Mdate +'-'+Day_Counter+ '' ,'公司简介','scrollbars=no,resizable=no,width=640,height=450,top=200,left=300');"><strong><font color="red">' + Day_Counter + '</font></strong></a></td>';
}
else if(theDay<strToday && theDay>'2002-05-31')
{
HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000"><a href="tj9.asp?tdate='+Ydate+'-'+Mdate +'-'+Day_Counter+ '" target=_blank>' + Day_Counter + '</a></td>';
// HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000"><a href="openwindow('tj9.asp?tdate='+Year+'-'+Mdate +'-'+Day_Counter+ '','公司简介','scrollbars=no,resizable=no,width=640,height=450,top=200,left=300');">' + Day_Counter + '</a></td>';
}
else
{
HTML_String += '<td BGCOLOR="FFFFFF" BORDERCOLOR="000000">' + Day_Counter + '</td>';
}
Day_Counter++;
}
else {
HTML_String += '<td BORDERCOLOR="C0C0C0"> </td>';
}
Loop_Counter++;
}
HTML_String += '</tr>';
}
HTML_String += '</table></td></tr></table>';
document.all.Calendar.innerHTML = HTML_String;
}
function openwindow(theURL,name,features){
window.open(theURL,name,features);
}
function Check_Nums() {
if ((event.keyCode < 48) || (event.keyCode > 57)) {
return false;
}
}
function Defaults() {
if (!document.all)
return
var Mid_Screen = Math.round(document.body.clientWidth / 2);
Selected_Month = Current_Month;
Selected_Year = Current_Year;
Make_Calendar(Current_Year, Current_Month);
}
function Skip(Direction) {
if (Direction == '+') {
if (Selected_Month == 11) {
Selected_Month = 0;
Selected_Year++;
}
else {
Selected_Month++;
}
}
else {
if (Selected_Month == 0) {
Selected_Month = 11;
Selected_Year--;
}
else {
Selected_Month--;
}
}
Make_Calendar(Selected_Year, Selected_Month);
}
function tick() {
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0) {
hours = "12:";
xfile = "午夜 ";
} else if (intHours < 12) {
hours = intHours+":";
xfile = "上午 ";
} else if (intHours == 12) {
hours = "12:";
xfile = "正午 ";
} else {
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午 ";
}
if (intMinutes < 10) {
minutes = "0"+intMinutes+":";
} else {
minutes = intMinutes+":";
}
if (intSeconds < 10) {
seconds = "0"+intSeconds+" ";
} else {
seconds = intSeconds+" ";
}
timeString = xfile+hours+minutes+seconds;
//document.all.Clock.innerHTML = timeString;
document.all.Clock.innerHTML = '<font color=white>'+timeString+'</font>';
window.setTimeout("tick();", 100);
}
//-->
</script>
<base target="rtop">
</head>
<body onLoad="Defaults();tick()">
<table width="124" height="132" border="1" cellspacing="0" cellpadding="0">
<form name="when">
<tr>
<td align="center" width="143" height="130">
<div id=NavBar style="position:relative;top:-1px;">
<div id="Clock" style="position: relative; top: 0px; width: 128; height: 19"></div>
</div>
<div id=Calendar style="position:relative;top:-3px;"></div>
<input type="button" value=" << " onClick="Skip('-')" id=button1 name=button1>
<input type="button" value=" >> " onClick="Skip('+')" id=button2 name=button2>
</td>
</tr>
</form>
</table>
</body>
</html>