开发者

toggle on double click

looking a way to make a toggle on doubleclick, this is my code:

$('#mydiv'开发者_Go百科).toggle(function() {
  $('#post').css({'height' : '188'});
}, function() {
  $('#post').css({'height' : '48'});
});     


$('#mydiv').dblclick(function () {
  $('#post').height($('#post').height() > 100 ? 48 : 180);
});

Or may be you want this:

$(".generic-expand-button").each(function () {
    $(this).dblclick(function() {
        $(this).closest(".post").height($(this).closest(".post").height() > 100 ? 48 : 180);
    });
});


Use jQuery double click event: http://api.jquery.com/dblclick/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜