2个回答
推荐于2016-01-21
展开全部
<style type="text/css">
.mouseout
{
background:"";
background-color:#6E97B3;
font-weight:normal;
}
.mouseon
{
background:url(images/bg1.gif);
background-color:none;
font-weight:bold;
}
</style>
<script type="text/javascript">
function $(id)
{
return document.getElementById(id);
}
function classNormal()
{
var focusBtn = $('nb').getElementsByTagName('li');
var focusImg = $('show').getElementsByTagName('li');
for (var i = 0; i < 3; i++) {
focusBtn[i].className = '芹和mouseout';
focusImg[i].style.display="none";
}
}
function change()
{
var focusBtn = $('nb'戚森).getElementsByTagName('li');
var focusImg = $('show').getElementsByTagName('li');
focusBtn[0].onmouseover = function() {
classNormal();
focusBtn[0].className = 'mouseon';
focusImg[0].style.display='block';
}
focusBtn[1].onmouseover = function() {
classNormal();
focusBtn[1].className = 'mouseon';
focusImg[1].style.display='block';
}
focusBtn[2].onmouseover = function() {
classNormal();
focusBtn[2].className = 'mouseon';
focusImg[2].style.display='block';
}
}
window.onload = function() {
change();
}
</script><body>
<div id="show" style="width:345px;height:110px; padding:0; margin:0;">
<ul style="width:345px;height:110px;float:left;list-style-type:none; padding:0; margin:0;">
<li style="list-style-type:none;float:left;width:165px;height:110px;background:url(images/t-1.jpg);display:block;"></li>高首亩
<li style="list-style-type:none;float:left;width:165px;height:110px;background:url(images/t-2.jpg);display:none;"></li>
<li style="list-style-type:none;float:left;width:165px;height:110px;background:url(images/t-3.jpg);display:none;"></li>
<li style="list-style-type:none;float:left;width:180px;height:110px">
<div id="nb" style="width:180px;height:110px;padding:0; margin:0;">
<ul style="width:180px;height:110px;list-style-type:none;padding:0; margin:0;">
<li class="mouseon" style="width:180px;height:36px;list-style-type:none;color:#FFFFFF;font-size:12px;">测试一</li>
<li style="width:180px;height:36px;list-style-type:none;margin-top:1px;background-color:#6E97B3;color:#FFFFFF;font-size:12px;">测试二</li>
<li style="width:180px;height:36px;list-style-type:none;margin-top:1px;background-color:#6E97B3;color:#FFFFFF;font-size:12px;">测试三</li>
</ul>
</div>
</li>
</ul>
</div>
</body>
-------------------------------
最简单的
.mouseout
{
background:"";
background-color:#6E97B3;
font-weight:normal;
}
.mouseon
{
background:url(images/bg1.gif);
background-color:none;
font-weight:bold;
}
</style>
<script type="text/javascript">
function $(id)
{
return document.getElementById(id);
}
function classNormal()
{
var focusBtn = $('nb').getElementsByTagName('li');
var focusImg = $('show').getElementsByTagName('li');
for (var i = 0; i < 3; i++) {
focusBtn[i].className = '芹和mouseout';
focusImg[i].style.display="none";
}
}
function change()
{
var focusBtn = $('nb'戚森).getElementsByTagName('li');
var focusImg = $('show').getElementsByTagName('li');
focusBtn[0].onmouseover = function() {
classNormal();
focusBtn[0].className = 'mouseon';
focusImg[0].style.display='block';
}
focusBtn[1].onmouseover = function() {
classNormal();
focusBtn[1].className = 'mouseon';
focusImg[1].style.display='block';
}
focusBtn[2].onmouseover = function() {
classNormal();
focusBtn[2].className = 'mouseon';
focusImg[2].style.display='block';
}
}
window.onload = function() {
change();
}
</script><body>
<div id="show" style="width:345px;height:110px; padding:0; margin:0;">
<ul style="width:345px;height:110px;float:left;list-style-type:none; padding:0; margin:0;">
<li style="list-style-type:none;float:left;width:165px;height:110px;background:url(images/t-1.jpg);display:block;"></li>高首亩
<li style="list-style-type:none;float:left;width:165px;height:110px;background:url(images/t-2.jpg);display:none;"></li>
<li style="list-style-type:none;float:left;width:165px;height:110px;background:url(images/t-3.jpg);display:none;"></li>
<li style="list-style-type:none;float:left;width:180px;height:110px">
<div id="nb" style="width:180px;height:110px;padding:0; margin:0;">
<ul style="width:180px;height:110px;list-style-type:none;padding:0; margin:0;">
<li class="mouseon" style="width:180px;height:36px;list-style-type:none;color:#FFFFFF;font-size:12px;">测试一</li>
<li style="width:180px;height:36px;list-style-type:none;margin-top:1px;background-color:#6E97B3;color:#FFFFFF;font-size:12px;">测试二</li>
<li style="width:180px;height:36px;list-style-type:none;margin-top:1px;background-color:#6E97B3;color:#FFFFFF;font-size:12px;">测试三</li>
</ul>
</div>
</li>
</ul>
</div>
</body>
-------------------------------
最简单的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |