Я не знаю такого плагина для jQuery, но написание пользовательского интерфейса довольно просто.
( Редактировать : На самом деле я просто подумал о месте, где я мог бы использовать эту функцию сам. Я мог бы с таким же успехом написать подходящий плагин на основе этой следующей недели, если у меня будет время, и отредактировать его здесь. В настоящее время ниже то, что я первоначально отправил ...)
Все, что вам нужно, это пара div:
<div id="thebutton">Click me!</div>
<div id="thebox" style="display:none;">Content goes here</div>
И немного jQuery:
<script type="text/javascript">
$(function () {
$('#thebutton')
.click(function () {
//Show/hide the box
$(this).toggleClass('activated');
$(this).hasClass('activated') ? $('#thebox').fadeIn() : $('#thebox').fadeOut();
})
.mouseenter(function () {
//If the button is .activated, cancel any delayed hide and display the box
$(this).addClass('hovering');
if ($(this).hasClass('activated')) {
$('#thebox').clearQueue().fadeIn();
}
})
.mouseleave(function () {
//Hide the box after 300 milliseconds (unless someone cancels the action)
$(this).removeClass('hovering');
$('#thebox').delay(300).fadeOut();
});
$('#thebox')
//When hovering onto the box, cancel any delayed hide operations
.mouseenter(function () { $(this).clearQueue(); })
//When hovering off from the box, wait for 300 milliseconds and hide the box (unless cancelled)
.mouseleave(function () { $(this).delay(300).fadeOut(); });
});
</script>
Остальное в значительной степени просто CSS для #thebutton, #thebox, .hovering и .acactive.
Вот спартанский взгляд, который я использовал, когда писал это:
<style type="text/css">
#thebutton { width: 100px; background-color: #eee; text-align: center; padding: 10px; cursor: pointer; }
#thebutton.activated { font-weight: bold; }
#thebutton.hovering { color: Blue; }
#thebox { background-color: #eee; position:relative; width: 300px; height: 200px; padding: 10px; top: 5px; display: none;}
</style>