Image Resize Mod
Geplaatst: 29 okt 2004, 11:34
Code: Selecteer alles
##############################################################
## MOD Titel: Image Resize Mod
## MOD Autheur: Gert en Hieronymus - http://www.flabber.nl
## MOD Beschrijving door: !¿!Mats!¿! - http://members.lycos.nl/matsforum
## MOD Beschrijving: Deze mod verkleind plaatjes.
##
##
## Mod Versie: 1.0
##
## Installatie Level: Eenvoudig
## Installatie Tijd: 5 Minuten
## Bestanden te wijzigen: 2
## templates/***/bbcode.tpl
## templates/***/overall_header.tpl
##
## Meegeleverde bestanden: N/A
##############################################################
## Voordat Je Deze Mod Toevoegt Aan Jouw Forum, Back Up Alle Bestanden In Relatie Tot Deze MOD.
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
templates/***/bbcode.tpl
#
#-----[ ZOEK ]------------------------------------------
#
<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->
#
#-----[ VERVANG MET ]------------------------------------------
#
<!-- BEGIN img --><img src="{URL}" border="0" onLoad="scaleImage(this);"/><!-- END img -->
#
#-----[ OPEN ]------------------------------------------
#
templates/***/overall_header.tpl
#
#-----[ ZOEK OP REGEL 81 ]------------------------------------------
#
</script>
#
#-----[ DAARNAA TOEVOEGEN ]------------------------------------------
#
<!-- resize images by Gert en Hieronymus. http://gathering.tweakers.net/forum/list_messages/826648///Images,resizen,javascript -->
<style type="text/css">
img[onload] {
max-width: 580px;
}
img.resized {
border: 2px dashed red;
cursor: pointer;
cursor: hand;
}
</style>
<script type="text/javascript">
var maxWidth = 580;
function scaleImage(im) {
if (typeof im.naturalWidth == 'undefined') im.naturalWidth = im.width;
if (im.naturalWidth > maxWidth) {
im.width = maxWidth;
im.style.maxWidth = im.naturalWidth + 'px';
im.className = 'resized';
im.title = 'Klik voor originele grootte';
im.onclick = unscaleImage;
}
}
function unscaleImage() {
if (this.width == maxWidth) {
this.width = this.naturalWidth;
this.style.borderWidth = '0px';
this.title = 'Klik om te verkleinen';
} else {
this.width = maxWidth;
this.style.borderWidth = '2px';
this.title = 'Klik voor originele grootte';
}
}
</script>
#
#-----[ SLA OP/SLUIT ALLE BESTANDEN ]------------------------------------------
#
#