社区
ASP
帖子详情
这段JS代码怎么改 ?
lijun521
2005-01-07 02:27:29
http://www.blueidea.com/bbs/newsdetail.asp?lp=1&daysprune=5&id=1887129
这段JS代码怎么改
...全文
85
6
打赏
收藏
这段JS代码怎么改 ?
http://www.blueidea.com/bbs/newsdetail.asp?lp=1&daysprune=5&id=1887129 这段JS代码怎么改
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
scoutlin
2005-01-07
打赏
举报
回复
或者改这行,将 CELLSPACING=0 cellpadding=0
可减少一些高度
var HTML_String = '<table><tr><td valign="top"><table BORDER=1 CELLSPACING=0 cellpadding=0 FRAME="box" BGCOLOR="f0f0f0" BORDERCOLOR="ffffff">';
scoutlin
2005-01-07
打赏
举报
回复
这么大的字
就注定了要这么大
如果要小
只能调字的大小
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, 宋体;
font-size: 8px;/*改成8,很小了*/
}
-->
</style>
lijun521
2005-01-07
打赏
举报
回复
太感谢了 那么这么控制高度啊 把我用PS做的页面撑破了!
急啊! 高度是134px
scoutlin
2005-01-07
打赏
举报
回复
太长了,分两节回复
其实只在这两个地方,加了display:none
<div id=NavBar style="position:relative;top:-1px;display:none">
<div id="Clock" style="position:relative;top:-2px;display:none"></div>
scoutlin
2005-01-07
打赏
举报
回复
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);
document.when.month.selectedIndex = Selected_Month;
document.when.year.value = Selected_Year;
}
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;
window.setTimeout("tick();", 100);
}
//-->
</script>
<body onLoad="Defaults();tick()" >
<form name="when">
<div id=NavBar style="position:relative;top:-1px;display:none">
<br>
<select name="month" onChange="On_Month()" style="border: 1 solid #C0C0C0" size="1">
<script language="JavaScript1.2">
<!--
if (document.all){
for (j=0;j<Month_Label.length;j++) {
document.writeln('<option value=' + j + '>' + Month_Label[j]);
}
}
//-->
</script>
</select>
<input type="text" name="year" size=4 maxlength=4 onKeyPress="return Check_Nums()" onKeyUp="On_Year()" style="border: 1 solid #C0C0C0"><br>
<div id="Clock" style="position:relative;top:-2px;display:none"></div>
</div>
<div id=Calendar style="position:relative;top:-3px;"></div>
</form>
</body>
</html>
scoutlin
2005-01-07
打赏
举报
回复
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, 宋体;
font-size: 12px;
}
-->
</style></head>
<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;
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><tr><td valign="top"><table BORDER=1 CELLSPACING=1 cellpadding=2 FRAME="box" BGCOLOR="f0f0f0" BORDERCOLOR="ffffff">';
HTML_String += '<tr><th colspan=7 BGCOLOR="f0f0f0" BORDERCOLOR="ffffff">'+ Heading + '</font></th></tr>';
HTML_String += '<tr><th ALIGN="CENTER" BGCOLOR="e0f0f0" BORDERCOLOR="ffffff"><font color="ff0000">日</font></th><th ALIGN="CENTER" BGCOLOR="e0f0f0" BORDERCOLOR="ffffff">一</th><th ALIGN="CENTER" BGCOLOR="e0f0f0" BORDERCOLOR="ffffff">二</th><th ALIGN="CENTER" BGCOLOR="e0f0f0" BORDERCOLOR="ffffff">三</th>';
HTML_String += '<th ALIGN="CENTER" BGCOLOR="e0f0f0" BORDERCOLOR="ffffff">四</th><th ALIGN="CENTER" BGCOLOR="e0f0f0" BORDERCOLOR="ffffff">五</th><th ALIGN="CENTER" BGCOLOR="e0f0f0" BORDERCOLOR="ffffff"><font color="007f00">六</font></th></tr>';
var Day_Counter = 1;
var Loop_Counter = 1;
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 == Today) && (Year == Current_Year) && (Month == Current_Month)) {
HTML_String += '<td BGCOLOR="F0F0F0" BORDERCOLOR="ffffff"><strong><font color="red">' + Day_Counter + '</font></strong></td>';
}
else {
HTML_String += '<td BGCOLOR="F0F0F0" BORDERCOLOR="ffffff">' + Day_Counter + '</td>';
}
Day_Counter++;
}
else {
HTML_String += '<td BORDERCOLOR="ffffff"> </td>';
}
Loop_Counter++;
}
HTML_String += '</tr>';
}
HTML_String += '</table></td></tr></table>';
document.all.Calendar.innerHTML = HTML_String;
}
function Check_Nums() {
if ((event.keyCode < 48) || (event.keyCode > 57)) {
return false;
}
}
function On_Year() {
var Year = document.when.year.value;
if (Year.length == 4) {
Selected_Month = document.when.month.selectedIndex;
Selected_Year = Year;
Make_Calendar(Selected_Year, Selected_Month);
}
}
function On_Month() {
var Year = document.when.year.value;
if (Year.length == 4) {
Selected_Month = document.when.month.selectedIndex;
Selected_Year = Year;
Make_Calendar(Selected_Year, Selected_Month);
}
else {
alert('Please enter a valid year.');
document.when.year.focus();
}
}
function Defaults() {
if (!document.all)
return
var Mid_Screen = Math.round(document.body.clientWidth / 2);
document.when.month.selectedIndex = Current_Month;
document.when.year.value = Current_Year;
Selected_Month = Current_Month;
Selected_Year = Current_Year;
Make_Calendar(Current_Year, Current_Month);
}
纯
js
改
变web客户端DNS
之前java中试过N多种方法都只能
改
变服务器的DNS,最后发现要
改
客户端DNS只能插件、脚本,
这段
代码
简单易懂有效,希望对大家有帮助
js
代码
-笔试
代码
提交 sample
在这样的笔试场景中,`main.
js
`可能包含了一段未完成或需要优化的
代码
,求职者需要根据题目要求来完善或
改
进
这段
代码
。 另一方面,`README.txt`文件通常是项目说明或者指导文件,里面可能包含了一些关于如何运行、...
JavaScript判断用户是否对表单进行了修
改
的方法
这段
JS
代码
可以判断出用户是否对表单内容进行了修
改
,如果修
改
了表单,并退出浏览器,则会提醒用户是否要保存表单的内容,是非常有用的
代码
。 function formIsDirty(form) { for (var i = 0; i < form.elements...
javascript textarea字数限制
这一个是读取textarea的maxlength属性的值,进行计算,思路很好,... [Ctrl+A 全选 注:如需引入外部
Js
需刷新才能执行]下面的
这段
代码
是网络上应用比较广泛的,有剩余字数提示的效果
代码
,推荐
JS
限制textarea输入框
Yii2 加载css、
js
载静态资源的方法
本文详细介绍了Yii2中管理静态资源的方法,特别强调了如何在页面底部加载JavaScript
代码
以避免页面空白问题,以及如何解决在页面底部加载
JS
时的语法提示失效问题。 首先,Yii2通过AppAsset类来管理静态资源。在布局...
ASP
28,409
社区成员
356,971
社区内容
发帖
与我相关
我的任务
ASP
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
复制链接
扫一扫
分享
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章