<%
'*******************************
'Fonction: BBIMG (L1, MaximGheight, MaximGWidth)
«Paramètres: L1, chemin d'image; Maximheight, hauteur d'image maximale autorisée; maximgwidth, largeur d'image maximale autorisée
'Auteur: Alixi
'Date: 2007/7/12
'Description: Limitez la hauteur et la largeur maximales de l'image de la page
'Exemple: <% = bbimg ("Alixixi.gif", 300,100)%>
'*******************************
functionbbimg (l1, maximgheight, maximgwidth)
diml2, i2: l2 = l1
seti2 = newregexp
I2.global = true
I2.ignorecase = true
I2.pattern = "<img. [^>] * (Src =" ". [^>] +?"). [^>] *> "
l2 = i2.replace (l2, "<img 1 1onload =" "javascript: if (this.width>" & maximgwidth & ") this.style.width =" & maximgwidth & " this.height> "& maximgheight &") this.style.width = (this.width * "& maximgheight &") / this.height; "" // this.height; "" //> ")
bbimg = l2
seti2 = rien
finition de fin
%>