婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > asp正則html的圖片,對(duì)圖自動(dòng)縮放大小

asp正則html的圖片,對(duì)圖自動(dòng)縮放大小

熱門(mén)標(biāo)簽:外呼系統(tǒng)怎么話費(fèi) 宿州防封外呼系統(tǒng)平臺(tái) 地圖標(biāo)注還可以做嗎 滴滴地圖標(biāo)注上車(chē)點(diǎn) 硅基電話機(jī)器人加盟 高質(zhì)量的電銷(xiāo)外呼系統(tǒng) 無(wú)營(yíng)業(yè)執(zhí)照地圖標(biāo)注教學(xué) 電銷(xiāo)機(jī)器人采購(gòu) 友邦互聯(lián)電銷(xiāo)機(jī)器人違法嗎
下面這個(gè)是比較不錯(cuò)的一個(gè)
復(fù)制代碼 代碼如下:

Function FormatImg2(content) 
           dim re
           Set re=new RegExp
           re.IgnoreCase =true
           re.Global=True
           re.Pattern="(script)"
           Content=re.Replace(Content,"script")
           re.Pattern="img.[^>]*src(=| )(.[^>]*)>"
         Content=re.replace(Content,"img src=$2  style=""cursor: pointer"" alt=""點(diǎn)此在新窗口瀏覽圖片"" onclick=""javascript:window.open(this.src);"" onload=""javascript:resizepic(this)"" border=""0""/>")
          set re = nothing
          FormatImg = content
        end function

上面有點(diǎn)不好的就是對(duì)于圖片中的寬度和高度都不存在了
復(fù)制代碼 代碼如下:

Function getphoto(strHTML) 
Dim objRegExp, Match, Matches 
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True 
objRegExp.Global = True 
objRegExp.Pattern = "img.+?>" 
tp=""
Set Matches = objRegExp.Execute(strHTML)
For Each Match in Matches 
tp=tp  Match.value 
exit for
Next 
getphoto=tp
Set objRegExp = Nothing 
End Function

下面的代碼時(shí)進(jìn)行圖片按比例縮放
復(fù)制代碼 代碼如下:

function ResizeImage(imageid,limitWidth,limitHeight) 
{     
    var image = new Image(); 
    image.src = imageid.src; 

    if(image.width = 0  image.height = 0) return; 

    if(image.width/image.height >= limitWidth/limitHeight) 
    { 
        if(image.width > limitWidth) 
        { 
            imageid.width = limitWidth; 
            imageid.height = (image.height*limitWidth)/image.width; 
        } 
    } 
    else if(image.height > limitHeight) 
    { 
            imageid.height = limitHeight; 
            imageid.width = (image.width*limitHeight)/image.height;      
    } 

    if (imageid.parentElement.tagName != "A") 
    { 
        imageid.onclick = function(){window.open(this.src);} 
        imageid.style.cursor = "hand"; 
    } 


window.onload = InitImages;
function InitImages() 

//圖片的約束寬度和高度
   var maxWidth = 100; 
    var maxHeight = 100; 
    var imgs = document.getElementsByTagName("img"); 
    for(var i=0; i  imgs.length; i++) 
    { 
        var img = imgs; 
        if(img.width>maxWidth||img.height>maxHeight) 
            ResizeImage(img, maxWidth, maxHeight); 
    } 
}
您可能感興趣的文章:
  • javascript圖片自動(dòng)縮放和垂直居中處理函數(shù)
  • CSS expression控制圖片自動(dòng)縮放效果代碼[兼容 IE,Firefox]
  • 兼容ie、firefox的圖片自動(dòng)縮放的css跟js代碼分享

標(biāo)簽:新余 廣元 雅安 七臺(tái)河 宣城 儋州 江門(mén) 錫林郭勒盟

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp正則html的圖片,對(duì)圖自動(dòng)縮放大小》,本文關(guān)鍵詞  asp,正則,html,的,圖片,對(duì),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp正則html的圖片,對(duì)圖自動(dòng)縮放大小》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于asp正則html的圖片,對(duì)圖自動(dòng)縮放大小的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 冷水江市| 米泉市| 深泽县| 虹口区| 竹山县| 五原县| 墨脱县| 东阳市| 蓝山县| 桐城市| 西青区| 封丘县| 铁岭县| 治县。| 延津县| 锡林浩特市| 宁城县| 阿合奇县| 普安县| 岐山县| 临高县| 和林格尔县| 中卫市| 宜宾县| 洛南县| 禄丰县| 阳西县| 方城县| 临邑县| 巧家县| 京山县| 岳池县| 屏山县| 墨玉县| 县级市| 凤山县| 康乐县| 永川市| 城市| 许昌市| 涟源市|