-
-
'ฟังก์ชั่น: BBIMG (L1, Maximgheight, MaximgWidth)
'พารามิเตอร์: L1, เส้นทางภาพ; ความสูงสูงสุดของภาพสูงสุดที่อนุญาต MaximgWidth ความกว้างของภาพสูงสุดที่อนุญาต
'ผู้แต่ง: Alixi
'วันที่: 2007/7/12
'คำอธิบาย: จำกัด ความสูงและความกว้างสูงสุดของภาพหน้า
'ตัวอย่าง: <%= 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 $ 1onload =" "JavaScript: ถ้า (this.width>" & maximgwidth & ") this.style.width =" & maximgwidth & "; this.height> "& maximgheight &") this.style.width = (this.width*"& maximgheight &")/this.height; "" // this.height; "//>")
bbimg = l2
seti2 = ไม่มีอะไร
endfunction
-