javascript - 如何实现点击切换图
天蓬老师
天蓬老师 2017-04-10 15:52:01
[JavaScript讨论组]

想要实现如下效果:

当点击右边的其中一栏时,增加选中效果,如图:

部分代码:`<p id="pic-right">

                <p class="right" id="right1">
                    <p class="pic1">PIC</p>
                    <p class="jieshao">
                        <h3>TITLE OF HIGHLIGHT</h3>
                        <h4>Short descriptions of the highlight on the left.</h4>
                    </p>
                    <p class="xiajiao">
                        <img src="images/xiajiao.png">
                    </p>
                </p>
                <p class="right" id="right2">
                    <p class="pic1">PIC</p>
                    <p class="jieshao">
                        <h3>TITLE OF HIGHLIGHT</h3>
                        <h4>Short descriptions of the highlight on the left.</h4>

                    </p>
                    <p class="xiajiao">
                        <img src="images/xiajiao.png">
                    </p>
                </p>
                <p class="right" id="right3">
                    <p class="pic1">PIC</p>
                    <p class="jieshao">
                        <h3>TITLE OF HIGHLIGHT</h3>
                        <h4>Short descriptions of the highlight on the left.</h4>

                    </p>
                    <p class="xiajiao">
                        <img src="images/xiajiao.png">
                    </p>
                </p>
            </p>`
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(1)
高洛峰

个人觉着选中右侧缩略图+描述左侧增加小三角可以使用伪元素:after或者:before进行绝对定位不占用原有空间的。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号