PLEASE help to correct function
Hello friends. I need help: Only Hide "div.notification-container" when the page loads.
Demo:
http://jsfiddle.net/P62W4/1/
- $(document).click(function(event) {
- var $target = $(event.target);
-
- if ($target.parents().index($('.notification-container')) == -1) {
- if ($('.notification-container').is(":visible")) {
- $('.notification-container').animate({
- "margin-top": "-15px"
- }, 75, function() {
- $(this).fadeOut(75)
- });
- }
- else {
- if($target.hasClass("notification-button")) {
-
- $('.notification-container').show().animate({
- "margin-top": "0px"
- }, 75);
- }
- }
- }
- });
JAVIER