jqury+css實現可彈出伸縮層,jqurycss

來源:互聯網
上載者:User

jqury+css實現可彈出伸縮層,jqurycss

1、使用可彈出伸縮窗調整了之前的頁面配置,使用這種布局使整個介面看起來更加清爽也更簡潔



2、以左側面板為例,實現比較簡單,只需瞭解html和css布局就大致差不多了

html代碼:

<div id="shortcutPanelDiv">    <button id="shortcutPanelSwitcher" title="快捷面板">    </button>    <div id="shortcutPanelContent">        <div id="shortcutPanel-1">            <button id="btn-snq">            </button>            <button id="btn-sbq">            </button>            <button id="btn-lcq">            </button>        </div>        <div id="shortcutPanel-2">            <button id="btn-cyq">            </button>            <button id="btn-lsq">            </button>            <button id="btn-hdq">            </button>        </div>        <div id="shortcutPanel-3">            <button id="btn-jzs">            </button>            <button id="btn-jms">            </button>            <button id="btn-pds">            </button>        </div>        <div id="shortcutPanel-4">            <button id="btn-lxs">            </button>        </div>    </div></div>
CSS:

#shortcutPanelDiv{left: 0;bottom: 100px;position: absolute;z-index: 1;width: 22px;height: 170px;} #shortcutPanelSwitcher{margin-top: 45px;height: 80px;width: 22px;border: 0;right: 0;position: absolute;background-color: #F0F0F0;background-image: url("../img/table/RightArrow.png");background-position: center;background-repeat: no-repeat;} #shortcutPanelContent{background-color: #F0F0F0;position: absolute;right: 22px;height: 100%;width: 230px;}#shortcutPanel-1{margin-top: 10px;margin-left: 5px;} #shortcutPanel-2{margin-top: 10px;margin-left: 5px;} #shortcutPanel-3{margin-top: 10px;margin-left: 5px;} #shortcutPanel-4{margin-top: 10px;margin-left: 5px;}
js代碼:

var isShortcutPanelShow = false;$(function(){    $("#shortcutPanelSwitcher").click(function()    {        if (isShortcutPanelShow == false)         {            $("#shortcutPanelDiv").animate(            {                width: '252px',            }, "slow");            isShortcutPanelShow = true;            $("#shortcutPanelSwitcher").css("background-image", "url('img/table/LeftArrow.png')");        } else         {            $("#shortcutPanelDiv").animate(            {                width: '22px',            }, "slow");            isShortcutPanelShow = false;            $("#shortcutPanelSwitcher").css("background-image", "url('img/table/RightArrow.png')");        }    });});
布局需要有耐心,一點點調整已到達自己認為滿意的程度




著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.