如何创建一个功能,例如单击左侧的标题并自动在右侧显示详细信息。它在 Wordpress 中使用什么插件或短代码?请给个建议,谢谢。
问问题
136 次
1 回答
0
Hope this will help you:
It is just an Example:-
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
.details {display : none;width:50%;float:left;}
.title{
float: left;
width:50%
}
.extra{width:100%;float:left;}
</style>
<script>
$(document).ready(function(){
$(".title").click(function(){
$('.details').hide();
$(this).next().toggle();
});
});
</script>
</head>
<body>
<div class="extra">
<div class="title">Title1</div>
<div class="details">
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>
</div>
</div>
<div class="extra">
<div class="title">Title2</div>
<div class="details">
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>
</div>
</div>
<div class="extra">
<div class="title">Title3</div>
<div class="details">
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>
</div>
</div>
</body>
于 2018-04-27T06:07:36.773 回答