Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#topnav').bind({
- mouseenter: function() {
- $("#topnav").animate({opacity: 1.0, width: '98%', height: '38px'});
- },
- mouseleave: function() {
- $("#topnav").delay(2000).animate({opacity: 0.9, width: '310px', height: '33px'});
- }
- });
- var tout;
- $('#topnav').bind({
- mouseenter: function() {
- clearTimeout(tout);
- $("#topnav").animate({opacity: 1.0, width: '98%', height: '38px'});
- },
- mouseleave: function() {
- tout = setTimeout(function() {
- $("#topnav").animate({opacity: 0.9, width: '310px', height: '33px'});
- }, 2000);
- }
- });
- var timeout = null
- var onMouseEnter = function(){
- clearTimeout(timeout)
- $("#topnav").animate({opacity: 1.0, width: '98%', height: '38px'})
- }
- var onMouseLeave = function(){
- timeout = setTimeout(function(){
- $("#topnav").animate({opacity: 0.9, width: '310px', height: '33px'});
- },1000)
- }
- $('#topnav').bind({ mouseenter: onMouseEnter, mouseleave: onMouseLeave })
Add Comment
Please, Sign In to add comment