<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>相册</title> 
    <style>
        *{
            margin:0;
            padding:0;
        }
        ul{
            list-style: none;
            overflow: hidden;
        }
        ul li{
            float: left;
            width: 55px;
            height: 40px;
            margin-top: 10px;
            margin-left: 10px;
            border: 2px solid #fff;
        }
            ul li.active{
                border-color: red;
            }
    </style>
</head>
<body>
        <img src="img/1.jpeg" id="img">
        <ul>
            <li>
                <a href="">
                    <img src="img/1.jpeg" width="55px" height="40px" class="small">
                </a>
            </li>
            <li>
                <a href="">
                    <img src="img/2.jpeg" width="55px" height="40px"  class="small">
                </a>
            </li>
            <li>
                <a href="">
                    <img src="img/3.jpeg" width="55px" height="40px" class="small">
                </a>
            </li>
            <li>
                <a href="">
                    <img src="img/4.jpeg" width="55px" height="40px"  class="small">
                </a>
          </li>
        </ul>
   <script>
    var big=document.getElementById('img');
    var small=document.getElementsByClassName('small');
    for(var i=0;i<small.length;i++)
    {
        small[i].onmouseover=function()
        {
            for(var j=0;j<small.length;j++)
            {
                small[j].parentNode.parentNode.setAttribute('class','');
            }
            var smalls=this.getAttribute('src');
            big.setAttribute('src',smalls);
            this.parentNode.parentNode.setAttribute('class','active');
        }
    }
    </script>
</body>
</html>

最新文章

  1. Struts2 源码分析——调结者(Dispatcher)之执行action
  2. 安装mysql 5.7+版本缺少data文件夹
  3. C#连接Sql Serve数据库及增,删,改操作
  4. 在yii中使用分页
  5. 关于Vim的问题s
  6. Zookeeper 5、Zookeeper应用场景
  7. 用Maven打包成EAR远程部署JBoss(二)——部署到远程JBoss
  8. Eclipse最有用的快捷键
  9. IT连创业系列:App产品上线后,运营怎么搞?(中)
  10. RHCE6.4 rpm 安装gcc
  11. 用JNDI连接数据库
  12. Twisted 使用多线程
  13. QM
  14. LeetCode算法题-Number of Lines To Write String(Java实现)
  15. SpringBoot入门教程(二十一)IntelliJ IDEA配置Quartz启动项
  16. Java菜鸟浅谈OCR
  17. MySQL程序端启动密码错误解决方法
  18. python 进阶(转自http://python.jobbole.com/82633/)
  19. android studio InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annota
  20. Sqlite向MySql导入数据

热门文章

  1. 优雅写Java之四(类与对象)
  2. testng使用详解
  3. 使用jmeter做接口测试
  4. QDialog
  5. 计算机原理基础:DNS
  6. python 2 计算字符串 余弦相似度
  7. Codeforces_832
  8. 一口气说出 9种 分布式ID生成方式,面试官有点懵了
  9. 1 深入Web请求过程
  10. 《Head first设计模式》之适配器模式