相關(guān)資訊
- 《戰(zhàn)國(guó)無(wú)雙4-2》怎么換服裝?戰(zhàn)國(guó)無(wú)
- 關(guān)于責(zé)任的名言警句大全
- 《戰(zhàn)國(guó)無(wú)雙4-2》PC版如何聯(lián)機(jī)? 戰(zhàn)
- 戰(zhàn)國(guó)無(wú)雙4-2技能覺(jué)醒牛逼嗎 全新
- 《戰(zhàn)國(guó)無(wú)雙4-2》手柄無(wú)效怎么解決
- 戰(zhàn)國(guó)無(wú)雙4-2如何設(shè)置語(yǔ)言 戰(zhàn)國(guó)無(wú)雙
- 戰(zhàn)國(guó)無(wú)雙4-2怎么樣跳過(guò)進(jìn)入開(kāi)場(chǎng)動(dòng)畫
- 什么是應(yīng)屆生畢業(yè)生
- 應(yīng)屆生簡(jiǎn)歷自我評(píng)價(jià)
- 應(yīng)屆生簡(jiǎn)歷怎么寫
本類常用軟件
-
福建農(nóng)村信用社手機(jī)銀行客戶端下載下載量:584204
-
Windows優(yōu)化大師下載量:416896
-
90美女秀(視頻聊天軟件)下載量:366961
-
廣西農(nóng)村信用社手機(jī)銀行客戶端下載下載量:365699
-
快播手機(jī)版下載量:325855
本文將給大家分享學(xué)習(xí)的是關(guān)于利用ASP使圖片自動(dòng)縮放以適合界面大小的實(shí)例代碼分享,希望能夠給大家?guī)?lái)幫助或啟發(fā)。
如何讓圖片自動(dòng)縮放以適合界面大小,拿出你的Editplus,打開(kāi)c_function.asp文件,找到UBBCode函數(shù),在第417行有如下語(yǔ)句
If Instr(strType,"[image]")>0 And ZC_UBB_IMAGE_ENABLE Then
'[img]
objRegExp.Pattern="(\[IMG=)([0-9]*),([0-9]*),(.*)(\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<img src=""$6"" title=""$4"" width=""$2"" height=""$3""/>")
objRegExp.Pattern="(\[IMG=)([0-9]*),(.*)(\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<img src=""$5"" title=""$3"" width=""$2""/>")
objRegExp.Pattern="(\[IMG\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<img src=""$2"" title=""""/>")
End If
在其中加上onload='java script:if(this.width>400)this.width=400;',這里400是要讓超過(guò)400的圖片小于400,你可以自己設(shè)定寬度.
下面是已經(jīng)改好的
If Instr(strType,"[image]")>0 And ZC_UBB_IMAGE_ENABLE Then
'[img]
objRegExp.Pattern="(\[IMG=)([0-9]*),([0-9]*),(.*)(\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<img onload='java script:if(this.width>400)this.width=400;' src=""$6"" title=""$4"" width=""$2"" height=""$3""/>")
objRegExp.Pattern="(\[IMG=)([0-9]*),(.*)(\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<img onload='java script:if(this.width>400)this.width=400;' src=""$5"" title=""$3"" width=""$2""/>")
objRegExp.Pattern="(\[IMG\])(.+?)(\[\/IMG\])"
strContent= objRegExp.Replace(strContent,"<img onload='java script:if(this.width>400)this.width=400;' src=""$2"" title=""""/>")
End If