Оборачиваю в плагин?)почитайте про плагины, это совсем не то.
(function($) {
$.fn.dropDown = function(){
$(this).hover(function(){
$(this).children('ul').stop(false, true).fadeIn(300);
}, function() {
$(this).children('ul').stop(false, true).fadeOut(300);
});
return this;
};
$('.element').dropDown(); // вот тут dropDown будет доступен
})(jQuery); <button class='block' data-id='1'>Open win 1</button>
<button class='block' data-id='2'>Open win 2</button>
<div class='win' data-id='1'>Win 1</div>
<div class='win' data-id='2'>Win 2</div>$(document).on('click', '.block', function () {
var id = $(this).data('id'),
$target = $('.win').filter('[data-id="' + id + '"]');
$target.addClass('visible');
});