The Arcive of vBulletin Modifications Site. |
|
Facebook-like tooltip for forum descriptions Details »»
|
|||||||||||||||||||||||||||||
|
Facebook-like tooltip for forum descriptions
Developer Last Online: Sep 2011
Hello guys,
Someone asked me to write this small mod for him and I decided to release it free for everybody here at vb.org.
I only use very small jquery and css to display it, then it won't do any effect to your site load.
Installation: I. Add the following css in your additional.css Code:
.tip {
background: none repeat scroll 0 0 #1D1D1D;
color: #FFFFFF;
display: none;
font-size: 11px;
font-weight: normal;
margin-left: 10px;
padding: 3px 7px;
position: absolute;
width: 300px;
z-index: 1000;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
filter: alpha(opacity=80);
-moz-opacity: 0.8;
-khtml-opacity: 0.8;
opacity: 0.8;
}
Code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//Tooltips
$(".tip_trigger").hover(function(){
tip = $(this).find('.tip');
tip.show(); //Show tooltip
}, function() {
tip.hide(); //Hide tooltip
}).mousemove(function(e) {
var tipWidth = tip.width(); //Find width of tooltip
var tipHeight = tip.height(); //Find height of tooltip
//Distance of element from the right edge of viewport
var tipVisX = $(window).width() - (mousex + tipWidth);
//Distance of element from the bottom of viewport
var tipVisY = $(window).height() - (mousey + tipHeight);
if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
mousex = e.pageX - tipWidth - 20;
} if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
mousey = e.pageY - tipHeight - 20;
}
//Absolute position the tooltip according to mouse position
tip.css({ top: mousey, left: mousex });
});
});
</script>
III. Open template forumhome_forumbit_level2_post Find the following code Code:
<h2 class="forumtitle"><a href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}</a></h2>
Code:
<h2 class="forumtitle"><a title="" class="tip_trigger" style="" href="{vb:link forum, {vb:raw forum}}">{vb:raw forum.title}<span class="tip"><vb:if condition="$show['forumdescription']"><p class="forumdescription">{vb:raw forum.description}</p></vb:if></span></a></h2>
Code:
<vb:if condition="$show['forumdescription']"><p class="forumdescription">{vb:raw forum.description}</p></vb:if>
Pretty simple huh ? If you using it on your site, please mark as installed to show your support. More will come, I promised. Regards, Jeff Ledger Screenshots
Show Your Support
|
|||||||||||||||||||||||||||||
| 7 благодарности(ей) от: | ||
| Dr.osamA, Fuhrmann, hoangserip, Khriz, Last_Zero, Nacho Vidal, xuanhuy238 | ||
| Comments |
|
#2
|
|||
|
|||
|
awesome men, thanks. I'll put it in my web, looks awesome
thankyou
|
|
#3
|
|||
|
|||
|
I've done the installation but it's not exactly in you demo, I got a green underline in tooltips.
How to remove it? |
|
#4
|
|||
|
|||
|
Stylevers / linkhover_linkDecoration
text-underline set to no |
|
#5
|
|||
|
|||
|
Cool!!
|
|
#6
|
||||
|
||||
|
installed thank you bro
5 stars |
|
#7
|
||||
|
||||
|
I guess that with a few small changes this can be used for vb3.8.6?
|
|
#8
|
|||
|
|||
|
wow mate, Im loving this
|
|
#9
|
|||
|
|||
|
You are welcome!
Thank you so much Thanks Quote:
Jeff |
|
#10
|
||||
|
||||
|
As of 4.1.0 (maybe earlier), jquery is included in the vBulletin download in clientscript/jquery.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|