0
尋找一種方法,使上雙擊一個切換,這是我的代碼:切換上雙擊
$('#mydiv').toggle(function() {
$('#post').css({'height' : '188'});
}, function() {
$('#post').css({'height' : '48'});
});
尋找一種方法,使上雙擊一個切換,這是我的代碼:切換上雙擊
$('#mydiv').toggle(function() {
$('#post').css({'height' : '188'});
}, function() {
$('#post').css({'height' : '48'});
});
$('#mydiv').dblclick(function() {
$('#post').height($('#post').height() > 100 ? 48 : 180);
});
,也可以是你想要的:
$(".generic-expand-button").each(function() {
$(this).dblclick(function() {
$(this).closest(".post").height($(this).closest(".post").height() > 100 ? 48 : 180);
});
});
使用jQuery雙擊事件:http://api.jquery.com/dblclick/
這有效,但我正在尋找一種方式來處理更多的選擇器,任何新的想法?提前致謝。 – greenbandit 2011-05-28 07:14:08
更多選擇器...在$('#mydiv .toggle-buttons') - > toggle(「#post-」+ somethingDynamicallyCalculated)''中? – 2011-05-28 09:10:32
nope,雙擊,我需要修改更多#,在此先感謝。 – greenbandit 2011-05-28 16:31:47