YUI3:
<script>
YUI().use('node', function(Y){
var links = Y.all('div#latest-list .bd li a');
links.on('mouseover', function(ev){
var desc = this.get('parentNode').query('.news-desc');
var popup = Y.get('.popup-desc');
if(!popup){
Y.get(document.body).appendChild(popup = Y.Node.create('<div></div>'));
}
popup.set('innerHTML', desc.get('innerHTML')).setStyles({
display: "block",
opacity: 0.9,
top: (ev.clientY + 10) + "px",
left: (ev.clientX + 10) + "px"
});
});
links.on('mouseout', function(ev){
Y.get('.popup-desc').setStyle("display", "none");
});
});
</script>
jquery:
<script>
$(document).ready(function(){
$("div#latest-list .bd li a")
.mouseover(function(ev){
var desc = $("div.news-desc", this.parentNode);
var popup = $("div.popup-desc");
if(popup.length === 0){
popup = $('<div></div>').appendTo(document.body);
}
popup.html(desc.html())
.show()
.css("opacity", 0.9)
.css("top", (ev.clientY + 10) + "px")
.css("left", (ev.clientX + 10) + "px");
})
.mouseout(function(ev){
$("div.popup-desc").hide();
});
});
</script>