2016-08-05 4 views
0

要素がロードされると、サイズ変更ハンドルが最初に表示されます。その後、ユーザーが赤色のコンテナにカーソルを合わせると、ハンドルの自動隠蔽オプションが呼び出されます。したがって、それはその時点からの自動ヒドゥーの振る舞いをします。Jquery UI resizeable autohide handle

私は、自動非表示オプションをホバーに適用するように設定しましたが、何らかの理由でそれが機能していません。あなたの.hover機能ビットを変更する必要が

DEMO http://jsfiddle.net/xBB5x/12034/

// no auto hide intially 
$('#resize').resizable({ 
    aspectRatio: true, 
    //    autoHide: true, 
    handles: { 
    se: $('#resize').find('.resize_element') 
    }, 
}); 

// apply autohide behaviour when container is first hovered over 
// not currently working though? 
$("#container").hover(function() { 
    $('#resize').resizable("option", "autoHide", true); 
}); 

答えて

0

:ここ

$("#container").hover(function() { 
$('.resize_element').hide() 
}, function(){ 
$('.resize_element').show() 
}); 

ワーキングフィドル:http://jsfiddle.net/xBB5x/12035/

そして、あなたがサイズ変更したくない場合再表示された後、それを戻す2番目の関数を削除します。