Please, help to create the tooltip on a click
Hello everyone.
I ask the help in creation of the
simple tooltip on a click on the link (button).
When we click on the button, nearby appears in advance prepared DIV (Before it had
display:none, anything unusual).
So, a problem: it is necessary, that at a click
out of the tooltip, it disappeared, BUT if we click
on the tooltip, it should remain.
Here has made a demo-page with explanatories:
http://them.do.am/jquery-tooltip/
Code now the such:
-
<a href="" class="fortip">Button 1</a>
<div class="totip">Tooltip 1</div>
<a href="" class="fortip">Button 2</a>
<div class="totip">Tooltip 2</div>
<a href="" class="fortip">Button 3</a>
<div class="totip">Tooltip 3</div>
$(document).ready(function(){
$('.fortip').click(function(){
$(this).parent().next('.totip').slideToggle(0).siblings('.totip:visible').slideToggle(0);
return false;
});
$('.fortip').blur(function(){
$('.totip').hide(0)
return false;
});
});
Does anyone have any suggestions?
pS: Excuse for my English
Thanks)