YUI3:
<Script>
YUI (). use ('node', function (Y ){
Var links = Y. all ('div # latest-list. bd li ');
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 ")
. 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>