div+css 鼠标移动上去显示不一样的内容, 如图 怎么能实现啊?

就是 上图显示的样子 鼠标移动到不同条目 就显示不同的内容

第1个回答  2012-05-30
滑动门技术,一下代码直接保存为html。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>滑动门</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" href="http://c1.neweggimages.com.cn/WebResources/2009/Default/Css/frame091107.css" />
</head>
<body>

<div class="tabContainer">
<ul class="tabHead" id="tabCot_product-li-currentBtn-">
<li class="currentBtn"><a href="javascript:void(0)" title="产品描述">产品描述</a></li>
<li><a href="javascript:void(0)" title="规格参数">规格参数</a></li>
</ul>
</div>

<div id="tabCot_product_1" >
111111111111111
</div>
<div id="tabCot_product_2" style="display: none;">
22222222222222
</div>

<div class="noprint">
<script type="text/javascript" language="jscript">
function tab(o, s, cb, ev){//tab切换类
var $ = function(o){return document.getElementById(o)};
var css = o.split((s||'_'));
if(css.length!=4)return;
this.event = ev || 'onmouseover';
o = $(o);
if(o){
this.ITEM = [];
o.id = css[0];
var item = o.getElementsByTagName(css[1]);
var j=1;
for(var i=0;i<item.length;i++){
if(item[i].className.indexOf(css[2])>=0 || item[i].className.indexOf(css[3])>=0){
if(item[i].className == css[2])o['cur'] = item[i];
item[i].callBack = cb||function(){};
item[i]['css'] = css;
item[i]['link'] = o;
this.ITEM[j] = item[i];
item[i]['Index'] = j++;
item[i][this.event] = this.ACTIVE;
}
}
return o;
}
}
tab.prototype = {
ACTIVE:function(){
var $ = function(o){return document.getElementById(o)};
this['link']['cur'].className = this['css'][3];
this.className = this['css'][2];
try{
$(this['link']['id']+'_'+this['link']['cur']['Index']).style.display = 'none';
$(this['link']['id']+'_'+this['Index']).style.display = 'block';
}catch(e){}
this.callBack.call(this);
this['link']['cur'] = this;
}
}
new tab('tabCot_product-li-currentBtn-', '-');
</script>
</div>
</body>
</html>追问

谢谢阁下的帮助,我运行了这个代码看了看,里面的“1111111111”和“22222222”能不能创建连接呢? 该如何做? 谢谢。

本回答被提问者采纳
第2个回答  2012-05-30
没看到代码哎,截图或者发下代码可以看看
相似回答