summaryrefslogtreecommitdiff
path: root/js/post-hover.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/post-hover.js')
-rw-r--r--js/post-hover.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/post-hover.js b/js/post-hover.js
index 335e3ac4..89808f54 100644
--- a/js/post-hover.js
+++ b/js/post-hover.js
@@ -32,19 +32,19 @@ $(document).ready(function(){
.attr('id', 'post-hover-' + id)
.addClass('post-hover')
.css('position', 'absolute')
- .css('left', e.pageX + 15)
- .css('top', e.pageY - post.height() - 15)
.css('border-style', 'solid')
.css('box-shadow', '1px 1px 1px #999')
.insertAfter($(this).parent());
+ $(this).trigger('mousemove');
}
}, function() {
post.attr('style', '');
$('.post-hover').remove();
}).mousemove(function(e) {
+ var top = e.pageY - post.height() - 15;
$('#post-hover-' + id)
- .css('left', e.pageX + 15)
- .css('top', e.pageY - post.height() - 15);
+ .css('left', $(this).width() + e.pageX)
+ .css('top', top > $(window).scrollTop() ? top : $(window).scrollTop());
});
});
});