i have this example in jsfiddle of a accordion only made with css3, no js.
<>光>:>
<div class="ac-container">
<div>
<input id="ac-1" name="accordion-1" type="radio" checked />
<label for="ac-1">About us</label>
<article class="ac-small">
<p id="test_small">test</p> <-- this tag will come from php
</article>
</div>
<div>
<input id="ac-2" name="accordion-1" type="radio" />
<label for="ac-2">How we work</label>
<article class="ac-medium">
<p id="test_medium">test</p>
</article>
</div>
</div>
http://www.ohchr.org。
.ac-container input:checked ~ article.ac-small{
height: 140px;
}
.ac-container input:checked ~ article.ac-medium{
height: 180px;
}
.ac-container input:checked ~ article.ac-large{
/* height: 240px;*/
}
问题一是,高点已经确定,一是增加原样,一是不能确定有多少内容需要具有动态的高度。
the php will be loading the p tag so i can find the height like this:
var v = $("#test_small").height();
// add the height to the .ac-small
$( .ac-container input:checked article.ac-small ).css("height", v+ px );
问题一是,胜数适用于选任人,即认为选任人<代码>(......ac-container content:checked article.ac-small >是错的。