javascript控制层的问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 13:31:39
1.怎么样实现同一个位置的内容可以变换
(就像网易首面那里上鼠标移动到一个连接就它下面的内容就变成其它的了)
2.在网页就制作右键菜单
代码最简单越好,只要成体现主主题思想就可以了

<span id="clock"></span>

<script type="text/javascript">
// <!CDATA[
setInterval(function() {
document.getElementById('clock').innerHTML = new Date();
}, 1000);
// ]]>
</script>

我这里只是在外面多加了一层计时执行器setInterval
你只需看里面的语句就可以了。

1、简单事例
<span id="show" style="width:150px;"></span>
<a title="我是连接1" href="#" onmouseover="showit(this)" onmouseout="hideit()">连接</a> | <a title="我是连接2" href="#" onmouseover="showit(this)" onmouseout="hideit()">连接</a> | <a title="我是连接3" href="#" onmouseover="showit(this)" onmouseout="hideit()">连接</a>
<script>
function showit(o){document.getElementById('show').innerHTML = o.title;}
function hideit(){document.getElement