Javascript实现滚动新闻
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>滚动新闻类</title>
<style type="text/css">
body {
text-align:center;
}
td {
font-size:12px;
line-height:20px;
text-align:left;
}
.marquee {
width:100%;
height:100%;
overflow:hidden;
}
.m {
height:20px;
}
.m2 {
height:90px;
}
</style>
</head>
<body>
<table border='1'>
<tr>
<td height='20' width='250'><div id='marquee1' class='marquee m'></div></td>
<td height='20' width='300'><div id='marquee2' class='marquee m'></div></td>
</tr>
<tr>
<td height='99' colspan='2'>基本上够用了吧!</td>
</tr>
<tr>
<td height='90' colspan='2'><div id='marquee3' class='marquee m2'></div></td>
</tr>
</table>
<script language="JavaScript">
function BYMarquee(){
this.Content = []; //显示内容
this.Speed = 20; //上移速度
this.Object = {}; //marquee容器对象
this.Pause = true; //是否停留
this.Start = function(){
var o = this.Object;
&nbs
相关文档:
通常javascript代码可以与HTML标签一起直接放在前端页面中,但如果JS代码多的话一方面不利于维护,另一方面也对搜索引擎不友好,因
为页面因此而变得臃肿;所以一般有良好开发习惯的程序员都会把javascript代码放到独立的js文件中,其他页面通过引入该js文件来使用相应的
javascript代码。
今天在做一个小新闻系统的管理 ......
正则表达式是一个描述字符模式的对象。
JavaScript的RegExp对象和String对象定义了使用正则表达式来执行强大的模式匹配和文本检索与替换函数的方法.
在JavaScript中,正则表达式是由一个RegExp对象表示的.当然,可以使用一个RegExp()构造函数来创建RegExp对象,也可以用
JavaScript
1.2中的新添加的一个特殊语法 ......
看了很多javascrip代码,发现很多地方用到了this这个对象,那这个到底是什么东西阿?
先让我们来理解一个概念:
在javascript会有一个上下文的概念,任何一个对象无论是Object 还是function 都会有一个专有的上下文对象,也可以理解为它自己的拥有者。
那么我们很容易想到这个拥有者,必然有个终点,那就是window对象。
......