我得到了显示的necassary信息,但手风琴的原始功能不再起作用了(我不能再折叠手风琴了,除非我删除data-bind
):
<div id="accordion" data-bind="foreach: @PageData[0]">
<h3>Schaden: @ViewItem.Label("text: Id")</h3>
<div>
<p>
@ControlItem.TextArea("text: Beschreibung")
@ViewItem.Label("text: FotoURLs")
<div class="ui-widget photo">
<a href="http://en.wikipedia.org/wiki/File:Wien_Stefansdom_DSC02656.JPG" target="_blank">
<img src="~/Images/test/800px-Tower_bridge_London_Twilight_-_November_2006.jpg" width="150" height="150" data-ccuCustomEnlarge="" class="ui-corner-all">
</a>
</div>
</p>
</div>
<h3>Section 2</h3>
<div>
<p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p>
</div>
<h3>Section 3</h3>
<div>
<p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p>
<ul>
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
<li>List item</li>
</ul>
</div>
</div>
我无法改变元素的顺序,否则jquery不会将其识别为手风琴。
怎么办?
答案 0 :(得分:0)
你需要自定义绑定处理程序,以便jQuery和Knockout能够彼此了解并且不会互相攻击。