扩展/折叠按钮Won'
Epand/Collapse Toggle Won't Float Down with Expanding Content
我有一些展开/折叠代码的问题。我希望HTML中的p class="heading"标签(这是切换展开/折叠框的标签)随着展开的内容向下移动。现在,内容正在扩展并填充在按钮下方。
我试着弄乱代码,但是扩展函数不能工作,所以我很抱歉不能提供一个。
问题代码如下。
CSS<style>
/* mouse over link */
p {
color: rgb(206, 134, 57);
margin-left: -10px;
margin-right: -10px;
margin-bottom: 0px;
transition: background .75s ease-in-out, box-shadow .5s ease-in-out;
}
p:hover { text-decoration: underline;
cursor: pointer;
color: rgb(206, 134, 57);
-moz-box-shadow: 0 -2px 2px;
-webkit-box-shadow: 0 -2px 2px;
box-shadow: .1px .1px 5px .1px #787878;
}
.heading {
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
text-align: center;
padding:7px 14px 7px 12px;
border-bottom-left-radius:5px;
border-bottom-right-radius:5px;
text-decoration:none;
background: -moz-linear-gradient(top, #dedede, white 75%);
background: -webkit-gradient(linear, 0 0, 0 75%, from(#dedede), to(white));
border-top: 1px solid #A6A6A6;
outline:none;
}
a {
color: rgb(206, 134, 57);
}
.heading:hover {
transition: background .75s ease-in-out, box-shadow .5s ease-in-out;
}
a:hover {
color: rgb(137, 90, 39);
}
.transition {
border: 1px solid #A6A6A6;
border-radius: 5px;
background:white;
padding-top: 7px;
padding-right: 10px;
padding-bottom: 0px;
padding-left: 10px;
transition: background .75s ease-in-out, box-shadow .5s ease-in-out;
}
.transition:hover {
background:#e6ebef;
box-shadow: .1px .1px 5px .1px #787878;
transition: background .75s ease-in-out, box-shadow .5s ease-in-out;
}
</style>
JQuery JavaScript/ <script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".content").hide();
//toggle the componenet with class msg_body
jQuery(".heading").click(function() {
var s = $(this);
jQuery(this).next(".content").slideToggle(500);
s.html(s.text() == 'Click here for less information...' ? 'Click here for more information...' : 'Click here for less information...');
});
});
</script>
HTML <div class="transition"><span style="font-weight: bold; font-size: 18px; color: rgb(0, 130, 200);"><u>Tree Removal Permit</u><br>
</span> <br>
A tree removal permit is required for removal of any tree on a commercial or multi-family property.<br>
<p class="heading">Click here for more information... </p>
<div class="content">
<div style="height:7px;font-size:7px;"> </div>
<span style="font-size: 14px; color: rgb(6, 78, 137);"><b>Online Application Process</b></span>
<ul>
<li type="square">For an easy, step-by-step permit application process visit our Online Licensing and Permitting Portal</a>.</li>
</ul>
<div style="height:7px;font-size:7px;"> </div>
</div>
</div>
任何帮助都将非常感激!
您的<div class="content"..
在less information按钮上方。把它放在<p class="heading"..
前面,改变这一行
jQuery(this).next(".content").slideToggle(500);
jQuery(this).prev(".content").slideToggle(500);
你是这个意思吗?https://jsfiddle.net/inkedraskal/319j8vwr/
你需要将"p"标签移动到"content"div下面,然后相应地切换js:
jQuery(document).ready(function() {
jQuery(".content").hide();
//toggle the componenet with class msg_body
jQuery(".heading").click(function() {
var s = $(this);
jQuery(".content").slideToggle(500);
s.html(s.text() == 'Click here for less information...' ? 'Click here for more information...' : 'Click here for less information...');
});
});
相关文章:
- 创建一个类似链接的按钮,并通过Javascript函数打开一个新的弹出窗口
- 正在添加'X'按钮,在文本字段旁边使用javascript
- 多个单选按钮组相互干扰
- JavaScript下拉菜单-点击按钮并根据所选值重定向到url
- Javascript按钮下拉列表
- jquery试图按名称获取按钮位置
- 漂亮照片图片库中的Facebook赞按钮
- 扩展移相器按钮类不工作
- 通过单击表单中的按钮,在代码生成中使用javascript生成字母数字代码
- 单击按钮以等待单击按钮
- 剑道UI内联编辑:如何在点击其他按钮时隐藏按钮
- 单击按钮后如何逐个调用分区,上一个分区将隐藏
- 如何从querySelectorAll中获取按钮类型
- 如何在输入字段中的按钮的帮助下打开日历,该字段的类型为“=”;日期”;
- 按下按钮时保存cookie
- vue-js-单选按钮won't默认情况下使用v-model属性进行检查
- Salesforce按钮:如果机会阶段不相等,如何显示错误“;Closed Won”;
- Javascript - Won't工作为第二个日期范围/ Won't重新加载按钮按下
- 对话框中的按钮won'
- 扩展/折叠按钮Won'