$(document).ready(function() { $(".slide").hover(function() { $(".cover", this).stop().animate({ top: '-200px'}, { queue: false, duration: 300 }); }, function() { jQuery(".cover", this).stop().animate({ top: '0'}, { queue: false, duration: 300 }); }); }); var mtop; function slideUp(cover) { mtop = 0; if(typeof temp != "undefined") clearInterval(temp); temp = setInterval( function() { slide(cover, "up"); }, 1 ); } function slideDown(cover) { if(typeof temp != "undefined") clearInterval(temp); temp = setInterval( function() { slide(cover, "down"); }, 1 ); } function slide(cover, dir) { if(dir == "up") { mtop -= 8; if(mtop <= -200) clearInterval(temp); } else if(dir == "down") { mtop += 10; if(mtop >= 0) clearInterval(temp); } document.getElementById(cover).style.top = mtop+"px"; } document.write(''); document.write('\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
\ \
\ \
\ \
\ \
\ \
\ \
\ \
\ ');