当前位置: 首页> 文旅> 美景 > 网页设计教程谁的好_电商平面设计前景如何_网站及推广_seo教程技术优化搜索引擎

网页设计教程谁的好_电商平面设计前景如何_网站及推广_seo教程技术优化搜索引擎

时间:2025/7/29 11:39:01来源:https://blog.csdn.net/scimence/article/details/142454676 浏览次数:0次
网页设计教程谁的好_电商平面设计前景如何_网站及推广_seo教程技术优化搜索引擎


效果图: 


1、单个隐藏div项 html布局


<div class="question-detail active"><div class="item-handle"><span class="btn-detail">作答详情 <i class="layui-icon layui-icon-down layui-font-12"></i></span></div><div class="item-answer"><div class="item-answer-content"></div></div>
</div>

2、style样式


<style type="text/css">.item-handle {height: 40px;}.question-detail .item-handle .btn-detail {-webkit-font-smoothing: antialiased;-webkit-box-orient: horizontal;-webkit-box-direction: normal;flex-direction: row;-webkit-box-align: center;align-items: center;-webkit-box-pack: center;justify-content: center;vertical-align: middle;position: relative;text-decoration: none;display: inline-block;line-height: 1;white-space: nowrap;background: #fff;-webkit-appearance: none;box-sizing: border-box;outline: none;margin: 0;transition: .1s;font-weight: 500;-webkit-user-select: none;float: right;width: 130px;height: 40.5px;text-align: center;color: #3c7af7;border: 1px solid #3c7af7;cursor: pointer;padding: 12px 20px;font-size: 14px;border-color: #fff;border-radius: 5px;}.question-detail.active .item-handle .btn-detail {float: right;width: 130px;height: 40.5px;text-align: center;color: #3c7af7;border: 1px solid #3c7af7;border-bottom-color: #fff;border-radius: 5px 5px 0 0;cursor: pointer;padding: 12px 20px;font-size: 14px;}.question-detail .item-answer {margin-top: -1px;border: 1px solid #3c7af7;padding: 15px 20px;display: none;}.question-detail.active .item-answer {display: block;}.item-answer-content {font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;-webkit-font-smoothing: antialiased;color: #2c3e50;font-size: 14px;box-sizing: border-box;margin: 0;padding: 0;min-height: 100px;}</style>

3、js控制代码


/** 点击作答详情, 通过修改css样式,控制item-answer对应div的显示与隐藏 */
$(document).on("click", ".item-handle .btn-detail", function () {var detailElem = $(this).parents(".question-detail");var isActive = detailElem.hasClass("active")if (isActive) detailElem.removeClass("active");else {detailElem.addClass("active");}
});

关键字:网页设计教程谁的好_电商平面设计前景如何_网站及推广_seo教程技术优化搜索引擎

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: