MyBB Community Forums

Full Version: Limiting Signature Dimensions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I *think* this is a template question?

How do I limit signature dimensions? I tried this code (that hides the 'excess' image), but it didn't work Sad

Quote:<div style="width:500;height:150;overflow:hidden;">$post[signature]</div>
Insert the following code in your headerinclude template:
<script type="text/javascript">
function sigcheck(sig) {
if (sig.clientHeight >= 100) {
return "100px";
} else {
return "default";
}
}
</script>
After that open the settings of your theme and insert into the additional CSS box:
.signature {
height:expression(sigcheck(this));
max-height:100px;
}
Then open the template postbit_signature and replace its content with this:
<hr size="1" width="25%" align="left" />
<div class="signature">
$post[signature]
</div>
You can change the codes to fit your needs. Wink
How about controlling the WIDTH of the sig ?
I'm not sure if that will work, so you have to test it.

Insert into headerinclude:
<script type="text/javascript">
function sigcheck(sig) {
if (sig.clientHeight >= 100) {
return "100px";
} else {
return "default";
}
}
function sigcheck2(sig) {
if (sig.clientWidth >= 500) {
return "500px";
} else {
return "default";
}
}
</script>
Then change the CSS-Code to:
.signature {
height:expression(sigcheck(this));
max-height:100px;
width:expression(sigcheck2(this));
max-width:500px;
}
Did this work? Anyone who have tried this.
The concept is good, but it doesn't work.