当前位置:编程学习 > JAVA >>

多个相同元素的展开和收起

在多个相同属性和元素实现展开和收起效果是,应该该是用元素或者class属性绑定事件,使用prev()和next()方法调用相应的方法。
如html代码:
 
<dl class="Ecom_list Eposition_rel Elinedash_bot_grey Emar10">

                <dt>

                    <img src="/Content/Images/photo/012.jpg" alt="" width="50" height="50" class="Eborder_grey" />

                </dt>

                <dd >

                    <span class="Efont_blue"></span>

                    曾湘平

                    <font class="Efont_grey Emar_left">2012/5/22 0:00:00</font>

                </dd>

                 <dd  id="Expansion" class="Ehidden_2">

                    阿斯顿发斯蒂芬法国恢复到更好fgsdfgsdfgsdfgdsfgdsfg易做图师打发阿斯蒂芬 阿斯顿发大水飞大厦发大水飞大厦

                </dd>

                <dd class="Efont_blue Emar_top Ealign_r">

                    <a href="#" class="show"> 展开</a><span id="Direction" class="Ejiantou_blue_down"></span>

                </dd>

            </dl>

            <dl class="Ecom_list Eposition_rel Elinedash_bot_grey Emar10">

                <dt>

                    <img src="/Content/Images/photo/012.jpg" alt="" width="50" height="50" class="Eborder_grey" />

                </dt>

                <dd >

                    <span class="Efont_blue"></span>

                    曾湘平

                    <font class="Efont_grey Emar_left">2012/5/22 0:00:00</font>

                </dd>

                 <dd  id="Expansion" class="Ehidden_2">

                    阿斯顿发斯蒂芬法国恢复到更好fgsdfgsdfgsdfgdsfgdsfg易做图师打发阿斯蒂芬 阿斯顿发大水飞大厦发大水飞大厦

                </dd>

                <dd class="Efont_blue Emar_top Ealign_r">

                    <a href="#" class="show"> 展开</a><span id="Direction" class="Ejiantou_blue_down"></span>

                </dd>

            </dl>

            <dl class="Ecom_list Eposition_rel Elinedash_bot_grey Emar10">

                <dt>

                    <img src="/Content/Images/photo/012.jpg" alt="" width="50" height="50" class="Eborder_grey" />

                </dt>

                <dd >

                    <span class="Efont_blue"></span>

                    曾湘平

                    <font class="Efont_grey Emar_left">2012/5/22 0:00:00</font>

                </dd>

                 <dd  id="Expansion" class="Ehidden_2">

                    阿斯顿发斯蒂芬法国恢复到更好fgsdfgsdfgsdfgdsfgdsfg易做图师打发阿斯蒂芬 阿斯顿发大水飞大厦发大水飞大厦

                </dd>

                <dd class="Efont_blue Emar_top Ealign_r">

                    <a href="#" class="show"> 展开</a><span id="Direction" class="Ejiantou_blue_down"></span>

                </dd>

            </dl>

            <dl class="Ecom_list Eposition_rel Elinedash_bot_grey Emar10">

                <dt>

                    &

补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,