Coding-Spot

You are not connected. Please login or register

 
 
 

Simple Tooltip with jQuery

Message (Page 1 of 1)

#1

weeknight

weeknight
 
Senior Member

Posted May 19th 2013, 12:38 am

 

*
THANKED

Hello Guys :)
I need help you :D

can you explain again this tutorial on this forum??
demo and tutorial
http://www.alessioatzeni.com/wp-content/tutorials/jquery/simple-tooltip/index.html

yeah, i like that tooltip^^

very nice because have many feature, like:
-Applied to a link
-Applied to an entire paragraph
-Applied to an entire heading tag
-Applied to an image
-Applied to a button
-Applied to a input field

please help me for this tutorial,
mr.mark please help me ^^

this tutorial very useful :D

thanks before :D:





#2

weeknight

weeknight
 
Senior Member

Posted May 21st 2013, 6:15 am

 
BUMP!!!

Please help me mr.mark :)





#3

weeknight

weeknight
 
Senior Member

Posted May 23rd 2013, 7:05 pm

 
BUMP!!!

please help me mr.mark :):





#4

Mark

Mark
 
Administrator
Administrator

Posted May 29th 2013, 7:16 am

 
Add this to your CSS:
Code:
.tooltip {
   display:none;
   position:absolute;
   border:1px solid #333;
   background-color:#161616;
   border-radius:5px;
   padding:10px;
   color:#fff;
   font-size:12px Arial;
}

Now go to overall_header, find the body tag and place this below it:
Code:
<script type="text/javascript">
$(document).ready(function() {
// Tooltip only Text
$('.masterTooltip').hover(function(){
        // Hover over code
        var title = $(this).attr('title');
        $(this).data('tipText', title).removeAttr('title');
        $('<p class="tooltip"></p>')
        .text(title)
        .appendTo('body')
        .fadeIn('slow');
}, function() {
        // Hover out code
        $(this).attr('title', $(this).data('tipText'));
        $('.tooltip').remove();
}).mousemove(function(e) {
        var mousex = e.pageX + 20; //Get X coordinates
        var mousey = e.pageY + 10; //Get Y coordinates
        $('.tooltip')
        .css({ top: mousey, left: mousex })
});
});
</script>

Now to apply the tooltip, just add this inside the html tag:
Code:
title="This is what will show up on the tooltip" class="masterTooltip"

And here are some examples:
Code:
<a href="#" title="This will show up in the tooltip" class="masterTooltip">Your Text</a>
<p title="Mouse over the heading above to view the tooltip." class="masterTooltip">Mouse over the heading text above to view it's tooltip.</p>
<img src="http://i.imgur.com/nmzLvJt.png" class="masterTooltip" title="Tooltip on image" />



https://coding-spot.darkbb.com


#5

Mark

Mark
 
Administrator
Administrator

Posted June 16th 2013, 8:54 pm

 
Since the question was answered and the codes worked perfectly.
~ Locked and moved



https://coding-spot.darkbb.com


#6

Sponsored content


 

Posted

 





Message (Page 1 of 1)

Permissions in this forum:
You cannot reply to topics in this forum

In total there is 0 user online :: 0 Registered, 0 Hidden and 0 Guests

Users browsing this forum: None