求网页特效源代码

来源:百度知道 编辑:UC知道 时间:2024/05/24 11:51:13
http://www.ied.go.kr/
http://www.yuexiu.gov.cn/index/
我想知道这两个网页中中间都有一个表格可以点一下上方的按钮就能换下面列表的内容(无须刷新页面),这是怎么实现的??
http://www.yuexiu.gov.cn/index/我把鼠标移动到街道信息或部门信息他就会自动改变下面列表的内容.
代码越简单越好,最好说明是什么原理.

这个是用 JAVASCRIPT做的.
就是用了隐藏,显示功能.其实你打开此页面时本来都是输出的.但是用JS来控制把某些给隐藏.然后你把鼠标放上去的话(onMouseover)就让隐藏的显示出来的.
如果需要此类代码的话我可以写给你.
msn cuihu0706@hotmail.com

只是2个Table
当点部门信息 该表格显示
街道信息 的表格隐藏

当点 街道信息 该表格显示

街道信息 的表格隐藏

给你个参考

<head>
<script>
startList = function()
{
if (document.all&&document.getElementById)
{
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[ i ];
if (node.nodeName=="LI")
{
node.onmouseover=function()
{this.className+=" over";}
node.onmouseout=function()
{this.className=this.className.replace(" over", "");}
}
}
}
}
window.onload=startList;
</script>
<style>
body {
font: normal 11px verdana;
}

ul {
margin: 0;
padding: