好了,所以我有一個工作手風琴,由此可以看出here加減手風琴
這是我的javascript
$(document).ready(function ($) {
$('#accordion').find('.accordion-toggle').click(function() {
//Expand
$(this).next().slideDown('fast');
$(this).children(".plusminus").text('-');
//hide other panels
$(".accordion-content").not($(this).next()).slideUp('fast');
});
});
顯然在那裏的地方,我需要的線沿線的東西:
$(this).next().slideUp('fast');
$(this).children(".plusminus").text('+');
使內容框關閉和 - 獲得更改回+符號,但我不知道我會如何做到這一點。任何幫助?
提示:你必須檢查的符號,看它是否是一個'+'或'-'第一。 –
使用CSS分配':之後'或':之前'內容。 – Blazemonger
小提琴更新:http://jsfiddle.net/rW3KU/2/ –