简单伸缩面板制作(来源于CSS彻底设计与研究)

本文介绍了如何使用CSS和JavaScript创建一个基本的伸缩面板(Accordion)效果。通过阅读,你可以学习到如何利用HTML结构、CSS样式以及JavaScript交互来实现这一常见的网页组件。
摘要由CSDN通过智能技术生成

accordion.html

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>自动伸缩面板</title>
        <link href="pages/accord1/accordion.css" type="text/css" rel="stylesheet">
        <script src="pages/accord1/accordion.js" type="text/javascript"></script>
    </head>
    <body>
        <div id="Accordion1" class="Accordion" tabindex="0">
            <div class="AccordionPanel">
                <div class="AccordionPanelTab top">Home</div>
                <div class="AccordionPanelContent"><img src="cup.gif">
                    <p>An anchor tag can be used inside of a Collapsible Panel Tab so that the
                        key board focus ring appears *inside* the tab instead of around the tab.
                        This is an example of how to make the text within the anchor tag look
                        like non-anchor (normal) text.This is an example of how to change the appearance of the panel tab that is
                        currently open. The class "CollapsiblePanelOpen" is programatically added and removed
                        from panel.</p>
                </div>
            </div>
            <div class="AccordionPanel">
                <div class="AccordionPanelTab">Web Design</div>
                <div class="AccordionPanelContent">An anchor tag can be used inside of a Collapsible Panel Tab so that the key board focus ring appears *inside* the tab instead of around the tab. This is an example of how to make the text within the anchor tag look like non-anchor (normal) text.This is an example of how to change the appearance of the panel tab that is currently open. The class "CollapsiblePanelOpen" is programatically added and removed from panels as the user clicks on the tabs within the CollapsiblePanel. on the tabs within the CollapsiblePanel
                </div>
            </div>
            <div class="AccordionPanel">
                <div class="AccordionPanelTab">Web Dev</div>
                <div class="AccordionPanelContent">An anchor tag can be used inside of a Collapsible Panel Tab so that the key board focus ring appears *inside* the tab instead of around the tab. This is an example of how to make the text within the anchor tag look like non-anchor (normal) text.This is an example of how to change the appearance of the panel tab that is currently open. The class "CollapsiblePanelOpen" is programatically added and removed from panels as the user clicks on the tabs within the CollapsiblePanel. on the tabs within the CollapsiblePanel
                </div>
            </div>
            <div class="AccordionPanel">
                <div class="AccordionPanelTab">Map</div>
                <div class="AccordionPanelContent">An anchor tag can be used inside of a Collapsible Panel Tab so that the key board focus ring appears *inside* the tab instead of around the tab. This is an example of how to make the text within the anchor tag look like non-anchor (normal) text.This is an example of how to change the appearance of the panel tab that is currently open. The class "CollapsiblePanelOpen" is programatically added and removed from panels as the user clicks on the tabs within the CollapsiblePanel. on the tabs within the CollapsiblePanel
                </div>
            </div>
        </div>
        <script type="text/javascript">
            var Accordion1 = new Spry.Widget.Accordion("Accordion1");
        </script>
    </body>
</html>

accordion.css

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值