国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

.fck編輯器插入圖片去掉默認的width和height屬性的有效方法

2024-07-12 08:43:05
字體:
來源:轉載
供稿:網友

.fck編輯器插入圖片去掉默認的width和height屬性的處理方法,打開文件 fckeditor/editor/dialog/fck_image/fck_images.js找到對應的代碼段即可處理了.

打開文件 fckeditor/editor/dialog/fck_image/fck_images.js,注釋以下代碼即可,代碼如下:

  1.     if ( oImage.style.width ) 
  2.     { 
  3.         var aMatchW  = oImage.style.width.match( regexSize ) ; 
  4.         if ( aMatchW ) 
  5.         { 
  6.             iWidth = aMatchW[1] ; 
  7.             oImage.style.width = '' ; 
  8.             SetAttribute( oImage, 'width' , iWidth ) ; 
  9.         } 
  10.     } 
  11.     if ( oImage.style.height ) 
  12.     { 
  13.         var aMatchH  = oImage.style.height.match( regexSize ) ; 
  14.         if ( aMatchH ) 
  15.         { 
  16.             iHeight = aMatchH[1] ; 
  17.             oImage.style.height = '' ; 
  18.             SetAttribute( oImage, 'height', iHeight ) ; 
  19.         } 
  20.     } 
  21.     GetE('txtWidth').value    = iWidth ? iWidth : GetAttribute( oImage, "width"'' ) ; 
  22.     GetE('txtHeight').value    = iHeight ? iHeight : GetAttribute( oImage, "height"'' ) ; 
  23. ---------- 
  24.     SetAttribute( e, "width" , GetE('txtWidth').value ) ; 
  25.     SetAttribute( e, "height", GetE('txtHeight').value ) ; 
  26. ---------- 
  27.     if ( bLockRatio ) 
  28.     { 
  29.         if ( GetE('txtWidth').value.length > 0 ) 
  30.             OnSizeChanged( 'Width', GetE('txtWidth').value ) ; 
  31.         else 
  32.             OnSizeChanged( 'Height', GetE('txtHeight').value ) ; 
  33.     } 
  34. ---------- 
  35.     var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ; 
  36. ---------- 
  37.     if ( dimension == 'Width' ) 
  38.         value = value == 0 ? 0 : Math.round( oImageOriginal.height * ( value  / oImageOriginal.width ) ) ; 
  39.     else //開源軟件:Vevb.com 
  40.         value = value == 0 ? 0 : Math.round( oImageOriginal.width  * ( value / oImageOriginal.height ) ) ; 
  41. ---------- 
  42.     GetE('txtWidth').value  = oImageOriginal.width ; 
  43.     GetE('txtHeight').value = oImageOriginal.height ; 
  44. ---------- 
  45.         GetE('txtWidth').value = width ? width : '' ; 
  46.         GetE('txtHeight').value = height ? height : '' ;

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 盘锦市| 鄂伦春自治旗| 泸西县| 囊谦县| 孟津县| 宣化县| 涡阳县| 泉州市| 含山县| 资源县| 墨江| 乐业县| 高雄县| 泽普县| 建德市| 通辽市| 台湾省| 盐亭县| 宝鸡市| 新干县| 六安市| 禄丰县| 佛学| 赤壁市| 青海省| 龙江县| 都昌县| 望谟县| 万全县| 阳城县| 开封市| 夏津县| 南昌市| 松原市| 南投市| 巨鹿县| 漳州市| 太湖县| 浦北县| 罗平县| 镇远县|