$(document).ready(function() { $('.next_folder_2').hover(function(){ var ul = $(this).find('ul'); $('.next_folder_2 ul').css('top', 0); var ul_count = ul.find('li').size(); if(ul_count > 1){ $('.next_folder_2 ul').css('top', 0); ul_count--; move_ul = (ul_count*27) if(move_ul > 200){ move_ul = 200; } ul.animate({ top: -move_ul }, 400, function() { // Animation complete. }); } }) $('.zamknij_komunikat').click(function(){ $( ".kurs_komunikat_tlo" ).animate({ opacity: 0 }, 1000, function() { $('.kurs_komunikat_tlo').css('display','none'); }); }); $('.kurs_zapis').click(function(){ $('.kurs_komunikat_tlo').css('display','block').css('opacity',0); $( ".kurs_komunikat_tlo" ).animate({ opacity: 1 }, 1000, function() { // Animation complete. }); }); });