用iframe,我只会写简单的js。应该可以把iframe放到div里弄的漂亮点。我自己没试过
<html>
<head>
</head>
<body>
<a href="#">公司简介</a>|<A href="#" onmouseover="showProduct()" onmouseout="hiddenProduct()">产品</A>|<a href="#">联系我们</a>
<br>
<iframe id="frame" src="a.html" height="0" width="100" style="margin-left:45"></iframe>
</body>
<script type="text/javascript">
var frame=document.getElementById("frame").style;
function showProduct(){
frame.height="100";
}
function hiddenProduct(){
frame.height="0";
}
</script>
</html>
<html>
<head>
</head>
<body>
<a href="#">公司简介</a>|<A href="#" onmouseover="showProduct()" onmouseout="hiddenProduct()">产品</A>|<a href="#">联系我们</a>
<br>
<iframe id="frame" src="a.html" height="0" width="100" style="margin-left:45"></iframe>
</body>
<script type="text/javascript">
var frame=document.getElementById("frame").style;
function showProduct(){
frame.height="100";
}
function hiddenProduct(){
frame.height="0";
}
</script>
</html>
用JS控制div的显示和隐藏,以及位置
内容显示在div里面的iframe里面,可以通过
iframe的src 指定显示的页面。
当然,你用Ajax也可以,不过有点自己给自己找麻烦了!
用没有简单又好的办法?
因为产品品种想存放在一个单独的地方,以便维护,然后在其它页面中来调用.
不甚感激..
我就想改成onmouseover来处理,但一看里面却是rel="ajaxcontentarea",
这个要如何修改的?
期待高手帮忙..
这个只是它的一个属性而已,具体的处理在js里
打开"ajaxtabs.js"
找到:
ulistlink.onmouseover=function(){
ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this)
loadobjs(this.getAttribute("rev"))
return false
}
这里就是在onmouseover里处理的,你可以改为你想要的.
心里一阵冲动.太好了,就是要这种效果..
对了,还有一个问题,就是如果鼠标移走后,我要让它还来成原来的样子呢.
代码要加在哪里的?
ulistlink.onmouseout的函数就可以
谢谢您.我找到这里的代码:
ulistlink.onmouseover=function(){
ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this)
loadobjs(this.getAttribute("rev"))
return false
}然后,在下面加多一个onmouseout的函数吧,
但是这个ulistlink.onmouseout的函数要怎么写:ulistlink.onmouseout=function(){}
期待解答,谢谢..
谢谢各位的解答,郁闷,就是看不懂恢复是用到那些代码的.
//在那个js中找到上面这行,然后把它下面的都用下面的代码替换
canchange = false;document.getElementById(ulistlink.getAttribute("rel")).onmouseover=function(){canchange=false;}
document.getElementById(ulistlink.getAttribute("rel")).onmouseout=function(){canchange=true}
ulistlink.onmouseover=function(){
canchange=false;
ajaxpage(this.getAttribute("href"), this.getAttribute("rel"), this)
loadobjs(this.getAttribute("rev"))
return false
}
ulistlink.onmouseout=function(){
var obj = this.parentNode.parentNode.firstChild.firstChild
canchange=true
t=setTimeout(function(){show(obj)},100);
}
if (ulist[x].className=="selected"){
ajaxpage(ulistlink.getAttribute("href"), ulistlink.getAttribute("rel"), ulistlink) //auto load currenly selected tab content
loadobjs(ulistlink.getAttribute("rev")) //auto load any accompanying .js and .css files
}
}
}
}
}
function show(obj){
if(!canchange){
//alert(obj);
t = setTimeout(function(){show(obj)},1000)
return
}
ajaxpage(obj.getAttribute("href"), obj.getAttribute("rel"), obj)
loadobjs(obj.getAttribute("rev"))
}
谢谢您,真的,没您帮忙真的搞不定.
就是想要这种效果,谢谢您了.
%_%