Hello,
i have the following code example (see below), my problem is that the tooltip doesn't show the "old" text after i go away with the cursor - any ideas? Regards
<style type="text/css">
#tooltip {
position: absolute;
background: #FFF;
display: none;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('body').append('<div id="tooltip"></div>');
var tt = $('#tooltip');
$('a.tooltip').each(function(){
$(this).data('title', this.title).attr('title', '');
}).hover(function(){
var t = $(this), o = t.offset();
tt.html(t.data('title')).css({top: o.top, left: o.left}).fadeIn('fast');
},
function(){
tt.css({display: 'none'});
});
});
</script>
</head>
<body>
<a href="#" class="tooltip" title="VeryLongTextMoreTextVeryLongText">VeryLongText...VeryLongText</a>