Re: Max Image Size..

  •  02-05-2013, 12:38 PM

    Re: Max Image Size..

    Hi Sky_Chief,

     

    You can use the code below to change the image size if it large than the value you set. the width is set to 400px below, you can limit the height as the same way. Just need to add the code to the bottom of your page, it will automatically perform.

     

    1. <script>  
    2. function CuteEditor_FilterHTML(editor,code)     
    3. {     
    4.     var editdoc = editor.GetDocument();  
    5.     for(var i=0;i<editdoc.images.length;i++)  
    6.     {  
    7.         if(editdoc.images[i].width>400)  
    8.         {  
    9.             editdoc.images[i].width=400;  
    10.         }  
    11.     }  
    12.     return code;  
    13. }     
    14. function CuteEditor_FilterCode(editor,code)     
    15. {     
    16.          var editdoc = editor.GetDocument();  
    17.     for(var i=0;i<editdoc.images.length;i++)  
    18.     {  
    19.         if(editdoc.images[i].width>400)  
    20.         {  
    21.             editdoc.images[i].width=400;  
    22.         }  
    23.     }  
    24.     return code;  
    25. }  
    26. </script>  
     

    Regards,

     

    Ken 

View Complete Thread