Coding-Spot

You are not connected. Please login or register

 
 

Simple Tooltip with jQuery

Message (Page 1 of 1)


 
Senior Member

Posted on Sat May 18, 2013 5:38 pm

 

*
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:



View user profile



 
Senior Member

Posted on Mon May 20, 2013 11:15 pm

 
BUMP!!!

Please help me mr.mark :)



View user profile



 
Senior Member

Posted on Thu May 23, 2013 12:05 pm

 
BUMP!!!

please help me mr.mark :):



View user profile



 
Administrator
Administrator

Posted on Wed May 29, 2013 12: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" />



View user profile http://coding-spot.darkbb.com



 
Administrator
Administrator

Posted on Sun Jun 16, 2013 1:54 pm

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



View user profile http://coding-spot.darkbb.com


#6

Sponsored content


 

Posted Today at 11:52 am

 





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