js艺龙

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>艺龙</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
        ul {
            list-style: none;
        }
        #box {
            margin: 50px auto;
            width: 1205px;
        }
        #box li {
            position: relative;
            float: left;
            width: 200px;
            height: 260px;
            cursor: pointer;
        }
        #box li .shadow {
            position: absolute;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, .2);
        }
        #box li .text {
            position: absolute;
            left: 0;
            right: 0;
            margin: 30px auto 0;
            width: 40px;
            font-size: 30px;
            color: #fff;
            text-align: center;
        }
    </style>
</head>
<body>
    <ul id="box">
        <li style="background:url(images/1.jpg) center no-repeat;">
            <div class="shadow"></div>
            <div class="text">园林酒店</div>
        </li>
        <li style="background:url(images/2.jpg) center no-repeat;">
            <div class="shadow"></div>
            <div class="text">设计师酒店</div>
        </li>
        <li style="background:url(images/3.jpg) center no-repeat;">
            <div class="shadow"></div>
            <div class="text">青年旅社</div>
        </li>
        <li style="background:url(images/4.jpg) center no-repeat;">
            <div class="shadow"></div>
            <div class="text">特色客栈</div>
        </li>
        <li style="background:url(images/5.jpg) center no-repeat;">
            <div class="shadow"></div>
            <div class="text">海岛酒店</div>
        </li>
        <li style="background:url(images/6.jpg) center no-repeat;">
            <div class="shadow"></div>
            <div class="text">海外温泉</div>
        </li>
    </ul>
    <script src="https://cdn.bootcss.com/jquery/1.12.1/jquery.js"></script>
    <script>
        $('#box li').mouseover(function () {
            $(this).stop(true).animate({
                width:400
            }).children().css('display', 'none').end().siblings().stop(true).animate({width:160}).children().css('display', 'block');
        });
 
        $('#box').mouseout(function () {
            $(this).children().animate({width: 200}).children().css('display', 'block');
        });
    </script>
</body>
</html>

  

图片更换即可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值