Iframe resizing of when using the +/- buttons

Last post 11-22-2005, 4:08 PM by rcroeder. 0 replies.
Sort Posts: Previous Next
  •  11-22-2005, 4:08 PM 12876

    Iframe resizing of when using the +/- buttons

    Since my emails to tech support have gone unanswered, I am putting my problems here now.

    One of the features and headaches of 4.x CuteEdit is the +/- button for resizing the editor. One of the problems when using CuteEdit within an Iframe, is that when CuteEdit resizes, the Iframe does not since there is no event to the user to trap this change. To resolve this headache, I had added a small javascript code to include_CuteEditor.asp. the script is simply:

    < script type='text/javascript'>
      function OnResize(){if(resize!=null){resize();}}
    < /script>

    I also had to change the code around line 655 to add the OnResize() to the on OnClick events for those buttons.

    Response.Write ("<td "&ieMouseEvent&" align=""right""><img title="""&G_Str("Enlarge")&""" class=""CuteEditorButton"" onclick=""_Format("&obj_ID&",'sizeplus');OnResize()""  type=""btn"" src="""&ProcessThemeWebPath("plus.gif")&""" border=""0"" /><img title="""&G_Str("Decrease")&""" class=""CuteEditorButton"" onclick=""_Format("&obj_ID&",'sizeminus');OnResize()""  type=""btn"" src="""&ProcessThemeWebPath("minus.gif")&""" border=""0"" />&nbsp;&nbsp;&nbsp;&nbsp;</td>")

    The vb code that is needed on my side is:

    sub resize_form(a,b)%>

      <script type='text/javascript'>
      function resize()
        {
        if(parent.document.getElementById("<%=a%>")!=null)
          { parent.document.getElementById("<%=a%>").height=document.getElementById("<%=b%>").offsetHeight +20;
          }
        if(parent.resize!=null){parent.resize();}
        }
      resize();
      </script>
    <% end sub

    where ‘a’ is the id of the iframe to resize, and ’b’ is the id of an object (form or table) inside of the iframe. The nice feature of the resize_form is that it will fire off the resize in the parent iframe if it exists.

View as RSS news feed in XML