aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/profile.js
blob: 3695ff6a8607400e3ca0b15962d1dc212f55a33c (plain)
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
27
28
29
30
31
32
33
34
35
36
37
$(document).ready(function() {
	
	$("a.icon").hover(function(e) {										  
		
		var userdescription = this.rel;

		var dwidth = $(document).width();

		$("body").append("<div id='user_menu'>"+ userdescription + "</div>");

		var top = e.pageY - 10;
		var left = e.pageX - 10;
		
		if ((left + 10 + $("div#user_menu").width()) > (dwidth - 10)) {
			left = dwidth - $("div#user_menu").width() - 50;
		}

		$("div#user_menu")
			.css("top",(top) + "px")
			.css("left",(left) + "px")
			.fadeIn("medium");
			
		
		remove_user_menu();
			
    });
	
	function remove_user_menu() {

		$("div#user_menu").hover(function() {}, function () {
			$("div#user_menu").remove();
		});
	}
	

});