$(document).ready(function(){ /* * Bublinova napoveda */ $("a.ref-image-link, a.ref-image-link>img").live("mouseenter", function(e) { // $(this).children().css("cursor","hand"); // alert($(this).attr("title")); var title=$(this).attr("title"); if(title && !$(this).parent().attr("title")) { $(this).attr('title',""); if($("#bubble-ref").length<1) { $("body").append("
"+ title+"
"); }else { $("#bubble-ref").html(title); } // alert($(this).attr("tagName")); var bubble=$("#bubble-ref"); // alert($(this).offset().top); bubble.css("top",$(this).offset().top - bubble.height()+80); if($(this).offset().left+$(this).width() + bubble.width() > $(window).width()) {bubble.css("left",$(this).offset().left-bubble.width()-15);} else {bubble.css("left",$(this).offset().left+$(this).width());} // alert($(window).width()); bubble.hide().fadeIn(500); // return false; // e.preventDefault(); } }).live("mouseleave mousedown",function(e) { var bubble=$("#bubble-ref"); if(bubble.text().length>0) $(this).attr("title",bubble.html()); if($(this).attr("title") && !$(this).parent().attr("title")) { // alert(bubble.text()); bubble.stop(true,true).hide(); bubble.text(""); // e.preventDefault(); // bubble.remove(); } }); });