This page you sent does not load Javascript codes during execution, it just dynamically manipulates some HTML elements. Let’s see how to recreate this effect.
When performing the mouseover, the site shows a div in the mouse position and loads within it an iframe with the link url (in this case, a Google Plus profile).
Let’s see how we can reproduce this effect
this is the window where will be rotated ajax to load
<div id="user"></div>
she needs to have this CSS attribute
#user{
position: absolute; //para ficar em qualquer lugar da página
display: none; //para ficar escondida
}
Let’s take a look at the links with the user name:
<a ... class="g-profile" href="https://plus.google.com/9999999999999999999" ...>
....
</a>
The links contain the class g-profile
and an attribute href
. That’s all we need to go on.
Now let’s go to the scripts. As we will handle many elements, I recommend using jQuery to save syntax and debug time.
$(document).ready(function(){
$('.g-profile').hover(function(){
//quando o mouse ficar em cima do link...
var mouseX = e.pageX; //pegue a coordenada x do mouse
var mouseY = e.pageY; //pegue a coordenada y do mouse
var url = $(this).attr('href'); //pegue a url do link
$('#user').html("<iframe src="+url+"></iframe>"); // crie o iframe com a url
//mova a div e mostre-a
$('#user').css({'top':mouseY,'left':mouseX,'display':'block'});
},function(){
// quando o mouse sair...
$('#user').css('display','none'); //esconda a div
});
});