Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- searchShowOnHover: function() {
- var mainCont = this;
- var searchCont = mainCont.children('#search');
- var isHovered = false;
- //// WHEN WE HOVER IT
- mainCont.hover(function() {
- isHovered = true;
- /// CALCULATES THE HEIGHT OF THE SEARCH
- var searchHeight = searchCont.outerHeight();
- var actualHeight = searchHeight + 70;
- //// ANIMATES THE HEIGHT
- mainCont.stop().animate({ height: actualHeight+'px' }, { easing: 'easeInOutCubic', duration: 300 });
- mainCont.find('.up-arrow, .down-arrow').stop().animate({ opacity: 0 }, 250);
- }, function() {
- var unHover = true;
- isHovered = false;
- //// IF WE HAVE A SELECT OPEN
- if(mainCont.find('select:focus').length > 0 && navigator.userAgent.toLowerCase().indexOf('msie') != -1) {
- unHover = false;
- jQuery('#search-spots').one('submit', function() {
- //// ANIMATES THE HEIGHT
- mainCont.stop().animate({ height: '70px' }, { easing: 'easeInOutCubic', duration: 300 });
- mainCont.find('.up-arrow, .down-arrow').stop().animate({ opacity: 1 }, 250);
- });
- }
- if(jQuery('.pac-container').length > 0) {
- if(jQuery('.pac-container').is(':visible')) { unHover = false; }
- }
- //// IF ITS NOT HOVERED
- if(unHover) {
- //// ANIMATES THE HEIGHT
- mainCont.stop().animate({ height: '70px' }, { easing: 'easeInOutCubic', duration: 300 });
- mainCont.find('.up-arrow, .down-arrow').stop().animate({ opacity: 1 }, 250);
- }
- });
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement