-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadsnotify2.js
More file actions
26 lines (23 loc) · 885 Bytes
/
adsnotify2.js
File metadata and controls
26 lines (23 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<script type="text/javascript">
$(function () {
var $window = $(window),
$body = $('body'),
$note = $("#note"),
notifyCookie = document.cookie;
$window.scroll(function () {
if (($window.scrollTop() > $body.height() / 2) &&
(notifyCookie.search('hideNote') === -1)) {
$note.fadeIn();
}
else {
$note.fadeOut();
}
});
$('.close').on('click', function () {
$note.fadeOut("slow");
$window.off('scroll');
document.cookie = 'hideNote=true; expires=' +
(new Date(Date.now() + (10000 * 1)).toUTCString());
});
});
</script>