We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Mouse Over on Text?
Topic Started: Nov 22 2011, 08:14 PM (428 Views)
ABGirl
Member
[ * ]
Hi. I've tried running a search for something like this, but it may be that I'm search challenged. I would like to know if there is a code/mod for mousing over the title of a thread, and getting the first few words/part of the opening sentence.

I'm lazy like that. :p I like to hover over the thread title, and get a preview, as it were, as to what the thread is about, and whether or not I even want to bother opening it to reply/participate. :D
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
InvisionFree version: http://resources.zetaboards.com/topic/5075529/1/
ZetaBoards version: http://resources.zetaboards.com/topic/5104183/1/

The ZetaBoards version isn't exactly what you want, but you may like it more. Here's a ZetaBoards version that does what you want:
Choco
 
Name: Topic Preview Tooltip
Description: When your mouse is held over a topic link for more than 1 second, it'll show a little box next to your mouse with some of the first post of the topic, to let you know what it's like.
Bugs: If you hover over a topic link and display the box, then clicking that topic link will bring you to the last post in the topic.
Installation: Place it in the last wrapper box.
Code:
Code:
 
<script type="text/javascript">
//Topic Preview code
//By Choco of zbcode.com
var timer,hold;
var sub = 150;
$("<div id='tip' class='description tip_hidden' style='width:200px;display:none;position:fixed;'><img src='http://aquate.us/u/ajax-lo8.gif' /><br /><strong>Loading...</strong></div>").appendTo("body");
function tip(x,y) {
$("#tip").css("left",x+5).css("top",y+15).fadeIn("fast").removeClass("tip_hidden").addClass("tip_shown");
if(hold.match(/topic\/(\d+)/i)) {
$.get(main_url+"topic/"+RegExp.$1+"/1/",function(d) {
$(".tip_shown").slideUp("fast",function(){$(this).html($(".c_post:eq(0)",d).text().substring(0,sub)+"...");$(this).slideDown("fast");});
});
}
}
function unTip(){
$("#tip").fadeOut("fast",function() {
$(this).html("<img src='http://aquate.us/u/ajax-lo8.gif' /><br /><strong>Loading...</strong>");
});
}$(function(){
$("a[href*=topic]").attr("title","").attr("alt","").mouseover(function(e) {
timer=setTimeout("tip("+e.clientX+","+e.clientY+")",1000);
hold=$(this).attr("href");
}).mouseout(function() {
clearTimeout(timer);
unTip();
hold=null;
});});</script>
Customization:
You can style the box in your Theme Appearance section.
Just add some CSS:
#tip {
background:white;
border:1px dashed grey;
padding:8px;
text-align:center;
}
Also, at the top of the code, you should see this:
var sub = 150;
Change the numbers to how much content you want to display of the first post. So if you wanted 300 characters to display instead, use var sub=300;

That's about it. Enjoy!
Offline Profile Goto Top
 
Brendan
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic