• 滑动选项卡特效


    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
            <style type="text/css">
                *{margin: 0;padding: 0;}
                #container{ 
                    width: 980px; 
                    height: 600px;
                    /*background: #ffcccc;*/
                    margin: 50px auto;
                }
                #container .header {
                    height: 45px;
                    line-height: 45px;
                    border-bottom: 2px solid #000;
                }
                #container .header h3 {
                    float: left;
                    margin-left: 20px;
                }
                #container .header ul {
                    float: right;
                    margin-top: -2px;
                }
                #container .header ul li {
                    list-style: none;
                    float: left;
                    width: 100px;
                    text-align: center;
                    border: 1px solid #ccc;
                    border-right: none;
                }
                #container .header ul li:last-child {
                    border-right: 1px solid #ccc;
                }
                #container .header ul li.active {
                    border: 2px solid #000;
                    border-bottom: 2px solid #fff;
                }
                #container .showCon {
                    margin-top: 10px;
                }
                #container .showCon img {
                    width: 980px;
                }
            </style>
        </head>
        <body>
            <div id="container">
                <div class="header">
                    <h3>服装</h3>
                    <ul>
                        <li class="active">经典男装</li>
                        <li>靓丽女装</li>
                        <li>可爱童装</li>
                    </ul>
                </div>
                <div class="showCon">
                    <img src="images/1.jpg" />
                </div>
            </div>
            <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
            <script type="text/javascript">
                $("#container .header ul li").hover(function() {
                    var index = $(this).index() + 1;
                    console.log(index);
                    $(this).addClass("active").siblings().removeClass("active");
                    $("#container .showCon").html("<img src='images/" + index + ".jpg' />");
                });
            </script>
        </body>
    </html>
  • 相关阅读:
    《剑指offer》39题—数组中出现次数超过一半的数字
    常见排序算法实现
    剑指offer题目分类
    腾讯2019实习面试题
    Word2vec资料
    Hello World投票以太坊Dapp教程-Part1
    以太坊开发框架Truffle学习笔记
    linux查看端口进程占用情况
    重置fedora root密码
    docker挂载本地目录的方法总结
  • 原文地址:https://www.cnblogs.com/qixin622/p/6848218.html
Copyright © 2020-2023  润新知