Welcome Guest [Log In] [Register]
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:
Add Reply
Signature Overflow
Topic Started: Dec 7 2008, 07:19 PM (1,586 Views)
Ellothar121
Member
[ * ]
Name: Signature Overflow
Description: This adds a maximum height to the signature area, and adds a scroll bar to display any signature that exceeds that height.
Browsers: FF3; In IE7, this will create a scroll bar, but there is a large amount of empty space that I'm not positive how to get rid of. Suggestions appreciated.
Installation: Below the Board
Customization: The part in red can be adjusted/added to like normal CSS.

Code:
Quote:
 

<script type="text/javascript">
var allPageTags = new Array();

function addSignatureOverflow() {
var getTableData=document.getElementsByTagName("td");
for (z=0; z<getTableData.length; z++) {
if (getTableData[z].className=="c_sig") {
signature=getTableData[z].innerHTML;
getTableData[z].innerHTML='<div id="signature" style="height: 200px; overflow: auto;">'+signature+'</div>';
}
}
}
document.onLoad = addSignatureOverflow();
</script>
Edited by Ellothar121, Dec 7 2008, 07:22 PM.
Offline Profile Quote Post Goto Top
 
obxbiker
Member Avatar
USMCR
[ *  *  *  * ]
Works GREAT in Google Chrome !
Online Profile Quote Post Goto Top
 
LawGamer
Member
[ * ]
Very nice job, if only it would hug the big empty space it does create =[
Offline Profile Quote Post Goto Top
 
Fission
Member Avatar
SRS BSNS
[ *  *  *  *  * ]
It would be much simpler to find .c_sig in your CSS and add the CSS lines, and your code would be much simpler as Jquery:

Code:
 

$(".c_sig").css("overflow","auto")
$(".c_sig").css("height","200px")


Good work, though.

Edit: Ignore my idiocy, this doesn't work.


This, however, does:

Code:
 

$(function(){
$(".c_sig").each(function(){
$(this).html("<div style='overflow:auto;height:100px;'>"+$(this).html()+"</div>")
})
})
Edited by Fission, Dec 7 2008, 09:42 PM.
Offline Profile Quote Post Goto Top
 
Ellothar121
Member
[ * ]
Yeah, for whatever reason, ZB doesn't support c_sig overflow, and the staff has many more important things to get to. I know this was a relatively quick patch-job, but I didn't see it anywhere on here, and thought others might benefit from this.

That works just as well for a smaller amount of space; If I credit you, would you mind if I replaced mine with that?
Offline Profile Quote Post Goto Top
 
Nicola
.....

Neat, thanks for posting that ^_^ A lot of users have been asking about this for the past year.
Its been irritating that you can't do that via CSS :(
Offline Profile Quote Post Goto Top
 
Uncle Joshua
Member Avatar
Member
[ *  *  * ]
Fission
Dec 7 2008, 09:25 PM



This, however, does:

Code:
 

$(function(){
$(".c_sig").each(function(){
$(this).html("<div style='overflow:auto;height:100px;'>"+$(this).html()+"</div>")
})
})
I just added that code to below your board and can still use large images in my sig area, do I need to do something else too?
Offline Profile Quote Post Goto Top
 
Justin186
Member Avatar
IF / ZB coder
[ *  *  * ]
Fission... it may be simpler as jQuery for the coder, but i don't recommend using it... its the same reason why i try to avoid RegExp in my codes.... Its because it slows down the board... because the Board has to filter it into to normal javascript so that it can run... that's how the libraries work with the board... to make things easier for the coder... but not on the users computer...
Offline Profile Quote Post Goto Top
 
Ellothar121
Member
[ * ]
Uncle Joshua, you need to be sure to enclose that code in <script> tags.

Quote:
 

<script type="text/javascript">
BLAHBLAHBLAH
</script>
Offline Profile Quote Post Goto Top
 
Justin186
Member Avatar
IF / ZB coder
[ *  *  * ]
I dont think you need script tags for jQuery, I can't remember :S please correct me if i'm wrong
Offline Profile Quote Post Goto Top
 
Viral.
Member Avatar
Member
[ *  *  *  *  *  * ]
It's JavaScript, you'll need the script tags, otherwise it will parse HTML and plain text. I'm going to have a guess and say that a td doesn't support overflow? Also, you should use jQuery. $("td.c_sig").wrap("stuff here"); should work.
Offline Profile Quote Post Goto Top
 
Nicola
.....

Viral.
Dec 8 2008, 03:22 PM
$("td.c_sig").wrap("stuff here"); should work.
You're suggesting someone wrap a table cell in something? In what? Another table? If anything you'd want to wrap the contents of the signature in something within the table cell, but not wrapping the table cell in something else.

Rather than starting a debate on what works and doesn't work: If the initial code works then rather than confuse other users who may be viewing, can you take it to PM? Honestly almost every thread in this forum is you lot trying to outdo eachother by trying to write the better code. If it works, it works. Yay. Some users want this, but they don't want to have to read through a lot of confusing rubbish and start wondering which code they should use.
Offline Profile Quote Post Goto Top
 
Uncle Joshua
Member Avatar
Member
[ *  *  * ]
Nicola
Dec 8 2008, 03:25 PM
Honestly almost every thread in this forum is you lot trying to outdo eachother by trying to write the better code. If it works, it works. Yay. Some users want this, but they don't want to have to read through a lot of confusing rubbish and start wondering which code they should use.
Well said Nicola, its a pain trying to work out what code to add when all we seem to have are threads full of peple having a go at each other.

Can anyone please tell me which code to use and where to put it?
Offline Profile Quote Post Goto Top
 
Fission
Member Avatar
SRS BSNS
[ *  *  *  *  * ]
Ellothar121
Dec 8 2008, 06:00 AM
That works just as well for a smaller amount of space; If I credit you, would you mind if I replaced mine with that?
Meh, no credit needed. Take it, it's yours :D
Offline Profile Quote Post Goto Top
 
Viral.
Member Avatar
Member
[ *  *  *  *  *  * ]
Joshua, it's the code in the first post, and it has the installation instructions o.0 .

Nicola, I wasn't debating, I was suggesting that it should have been done in jQuery, then I gave an example, and stated that it may not have worked, just a base.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Code & Modification Database · Next Topic »
Add Reply