当前位置: 首页 > 图文教程 > Java技术 > Java Web开发 > Java Web开发:小编浅谈JavaScript小技巧(9)
在网上查了许多相关的资料,今天整理一下文章,发布到软晨学习网网站上,希望对大家有所帮助。JavaScript是人们俗称的脚本语言,一些页面特效程序员们往往选择使用它来实现。JavaScript在编程中起着至关重要的作用。下面小编分享一些JavaScript常用技巧。
1、页面的打开移动
把如下代码加入 <body>区域中
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
for (t = 2; t > 0; t--) {
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(0,-x);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(0,x);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(x,0);
}
}
for (x = 20; x > 0; x--) {
for (y = 10; y > 0; y--) {
parent.moveBy(-x,0);
}
}
}
//-->
// End -->
</script>
2、显示个人客户端机器的日期和时间
<script language="LiveScript">
<!-- Hiding
today = new Date()
***("现 在 时 间 是: ",today.getHours(),":",today.getMinutes())
***(" <br>今 天 日 期 为: ", today.getMonth()+1,"/",today.getDate(),"/",today.getYear());
// end hiding contents -->
</script>
评论 (0) All