jQuery,别具一格的手风琴菜单

比特星途者
• 阅读 992

jQuery,别具一格的手风琴菜单

css的全部代码!!!
<style type="text/css" media="screen">
*{
    margin: 0;
    padding: 0;
}
.da{
    width: 1200px;
    height: 260px;
    margin:50px auto;
}
li{
    width: 171px;
    height: 260px;
    list-style: none;
    background: url(../images/20150120_ifold1.jpg) no-repeat center center;
    float: left;
    position: relative;
}
li:nth-child(1){
    width: 174px;
}
li:nth-child(2){
    background: url(../images/20150120_ifold2.jpg) no-repeat center center;
}
li:nth-child(3){
    background: url(../images/20150120_ifold3.jpg) no-repeat center center;
}
li:nth-child(4){
    background: url(../images/20150120_ifold4.jpg) no-repeat center center;
}
li:nth-child(5){
    background: url(../images/20150120_ifold5.jpg) no-repeat center center;
}
li:nth-child(6){
    background: url(../images/20150120_ifold6.jpg) no-repeat center center;
}
li:nth-child(7){
    background: url(../images/20150120_ifold7.jpg) no-repeat center center;
}
.mask{
    display: block;
    height: 100%;
    background: rgba(0,0,0,0.5);
}
p{
    color: #fff;
    font-size: 32px;
    width:42px;
    position: absolute;
    top: 20px;
    left: 50%;
    margin-left: -21px;
}
</style>

html的全部代码!!!!
<div class="da">
    <ul>
        <li>
            <span class="mask"></span>
            <p>温泉酒店</p>
        </li>
        <li>
            <span class="mask"></span>
            <p>情侣酒店</p>
        </li>
        <li>
            <span class="mask"></span>
            <p>设计师酒店</p>
        </li>
        <li>
            <span class="mask"></span>
            <p>青年旅舍</p>
        </li>
        <li>
            <span class="mask"></span>
            <p>特色客栈</p>
        </li>
        <li>
            <span class="mask"></span>
            <p>海岛酒店</p>
        </li>
        <li>
            <span class="mask"></span>
            <p>海外温泉</p>
        </li>
    </ul>
</div>

$(function(){
    $("li").mouseenter(function(){
        $(this).find("span").removeClass("mask");
        $(this).find("p").hide();
        $(this).siblings().stop().animate({
            "width":"133px"
        },50);
        $(this).stop().animate({
            "width":"400px"
        },50);
    });
    $("li").mouseleave(function(){
        $(this).find("span").addClass("mask");
        $(this).find("p").show();
    });
    $("ul").mouseleave(function(){
        $("li").eq(0).stop().animate({
            "width":"174px"
        },50);
        $("li").not(":first").stop().animate({
            "width":"171px"
        },50);
    });
});

基于jquery横向手风琴效果是一款基于jquery实现的左右滑动手风琴图片轮播切换特效。效果图如下:

jQuery,别具一格的手风琴菜单


亲们,这次我们做的和上次的手风琴不一样,这次是横向的,很多网站里都会用到,希望我的可以帮到大家,see you!!!
点赞
收藏
评论区
推荐文章
美凌格栋栋酱 美凌格栋栋酱
7个月前
Oracle 分组与拼接字符串同时使用
SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(
待兔 待兔
1年前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
linbojue linbojue
1年前
html--心花怒放
代码Canvas绘制一个❤html,bodyheight:100%;padding:0;margin:0;canvasposition:absolute;width:100%;height:100%;CanvasNotSupport/Settings/va
Easter79 Easter79
3年前
Springmvc异步上传文件
<scriptsrc"js/jquery.js"type"text/javascript"</script<scriptsrc"js/jquery.ext.js"type"text/javascript"</script<scriptsrc"js/jquery.form.js"type"text/javascript"
Stella981 Stella981
3年前
JQuery
一、jq简介jq其实就是js的一个文件。二、jq书写步骤1、先引入jq文件(min的文件)<scripttype"text/javascript"src"file:///C|/jquery/jquery3.3.1.min.js"</script2、换新的一行写js代码<scripttype"text/javascri
Stella981 Stella981
3年前
Boost(1.69.0) windows入门(译)
<head<title缩进2字符</title<styletype"text/css".yindent,.yblock{padding:1em1em01em;marginright:0;}.yindent{margin:0.7em2em;border:mediumoutset;}.yblock{margin
Stella981 Stella981
3年前
JQValidate使用说明
JQueryValidate使用总结:一、导入js库<scriptsrc"../js/jquery.js"type"text/javascript"</script<scriptsrc"../js/jquery.validate.js"type"text/javascript"</script二、默认校验规则
Stella981 Stella981
3年前
Html5添加三联切换仿3D效果旋转木马jQuery插件教程
一、使用方法<script type"text/javascript" src"js/jquery.min.js"</script<script type"text/javascript" src"js/gallery.js"</script   二、Html结构<div id"wrapper"<div id"mai
Wesley13 Wesley13
3年前
html元素摇摆
<scripttype"text/javascript"src"jquery1.9.0.min.js"</script<scripttype"text/javascript"jQuery.fn.shakefunction(intShakes/\Amountofshakes\/,intDistance/\S
Wesley13 Wesley13
3年前
JQ面试问题(转载)
1你在公司是怎么用jquery的?答:在项目中是怎么用的是看看你有没有项目经验(根据自己的实际情况来回答)你用过的选择器啊,动画啊,表单啊,ajax事件等配置Jquery环境下载jquery类库在jsp页面引用jquery类库即可<scripttype"text/javascript"src"jquery/jquery1.7.2
可莉 可莉
3年前
10 个非常酷的基于jQuery的菜单效果插件
除了直观的界面效果外,炫酷的网站导航菜单或右键菜单也能为访问者带来眼前一亮的感觉。本文为你带来10个非常酷的基于jQuery的菜单效果插件。 1. 右击菜单 一个创建右击菜单的插件,简洁且易用。 !(http://static.oschina.net/uploads/img/201112/20185535_