$(function() {
console.log('ready');
//hide all tool tips
$('.tip').hide();
//tooltip for eat (hover takes two functions)
$('#eat').hover(function() { // first function
//change background
$('body').css('background-image', "url('http://www.redrocketmedia.com/des157/images/bg_or.gif')");
}, function() { // second function
//change background
$('body').css('background-image', 'none');
});
//tooltip for sleep (hover takes two functions)
$('#sleep').hover(function() { // first function
//change background
$('body').css('background-color', 'black');
}, function() { // second function
//change background
$('body').css('background-color', '#1c5284');
});
//tooltip for design (hover takes two functions)
$('#design').hover(function() { // first function
//change background
$('body').css('background-image', "url('http://www.redrocketmedia.com/des157/images/check.gif')");
}, function() { // second function
//change background
$('body').css('background-image', 'none');
});
$('#design').click(function() {
console.log('click');
//add a variable called "center" that locates the center of the window
//set the left property for the overlay to the center variable
$('section#overlay').animate({
width: '100%',
left: '0',
});
$('section p').css('visibility', 'visible');
return false;
});
$('nav#close').click(function() {
console.log('click');
$('section#overlay').css('width', '0px');
$('section p').css('visibility', 'hidden');
return false;
});
});
jQuery animate overlay start
----------------------------
Forked from [glenda drew](http://codepen.io/glendadrew/)'s Pen [target practice complete](http://codepen.io/glendadrew/pen/wMPpKr/).
A [Pen](http://codepen.io/spencermathews/pen/GoXbgp) by [Spencer Mathews](http://codepen.io/spencermathews) on [CodePen](http://codepen.io/).
[License](http://codepen.io/spencermathews/pen/GoXbgp/license).