xui と emile を使用して折りたたみ可能なパネルを作成していますが、最初のクリックにはダブルクリックが必要で、それ以降のすべてのクリックはシングルクリックで正常に機能します。シングルクリックで機能するには、最初のクリックが必要です。また、JavaScript を使用していないユーザーのために、JavaScript を使用してリストを最初に非表示にする必要もあります。
誰が私がどこで間違っているかを見ることができますか?
これが私がxuiを拡張した場所です
xui.extend ( {
togglePanel:function(dur,thePanel)
{
var panel = document.getElementById(thePanel);
var theHeight = document.getElementById(thePanel).scrollHeight;
if(panel.closed){
emile(panel, 'height:'+theHeight+'px',{duration:dur});
panel.closed = false;
}
else{
emile(panel, 'height:0px', {duration:dur});
panel.closed = true;
}
}
});
そして、これがパネルの呼び出しと非表示です
x$(window).load(function(e){
emile('item', 'height:0px', {duration:-0});
x$('.panel a.panelItem').click(function(e){
x$().togglePanel(900,'item');})
});
私も試してみました
x$('#item')setStyle ('height','0px');
コンテンツを非表示にします。