$(document).ready(function() { $('.simpleTooltip').hover(function(){ var hrefval= $(this).attr('href'); hrefval=hrefval.replace('#',''); var title =$('a[name="' + hrefval + '"]').parent().parent().text(); //$(this).attr('title'); if (title.length > 200) { title = title.substring(0,200); title = title + "..........." } $(this).data('tipText', title).removeAttr('title'); $('<p class="tooltip"></p>') .text(title) .appendTo('body') .fadeIn('slow'); }, function() { $(this).attr('title', $(this).data('tipText')); $('.tooltip').remove(); }).mousemove(function(e) { var mousex = e.pageX + 20; var mousey = e.pageY + 20; $('.tooltip') .css({ top: mousey, left: mousex }) }); });
document.ready()
ready
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)