На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
  
> Изменился ли размер фрейма ?
    Каким образом узнать в runtime, не изменился ли размер фрейма? Просьба привести кусочек живого кода!
      Помнится, код для скрытия/показа фрейма (VBScript, но это по барабану):

      Sub SwitchTOC_OnClick
      Set TOCBody=top.TocFrame.idBody
      if document.readyState="loading" then Exit Sub
      if Action="hide" then
           OldTOCPercents=Top.TOC_and_Main.cols
           Action="show"
           SwitchTOC.title="Показать содержание."
           
           TOCBody.filters.item(0).Apply
           TOCBody.style.visibility="hidden"
           SetTimeOut "Top.TOC_and_Main.cols='0\%,1*'",1000,"VBS"
           TOCBody.filters.item(0).Play
      else
           Action="hide"
           SwitchTOC.title="Скрыть содержание."
           
           TOCBody.filters.item(0).Apply
           TOCBody.style.visibility="visible"
           Top.TOC_and_Main.cols=OldTOCPercents
           TOCBody.filters.item(0).Play
      End If
      End Sub

      Т.е. юза свойство cols окна (фрейма).
        Перефразирую вопрос:
        В Netscape есть такие свойства окна: window.innerWidth и window.innerHeight,
        которые изменяют свои значения при ресайзинге окна.
        Внимание, вопрос:
        Нужны аналогичные свойства окна, реализованные в MSIE.
          Очень странно.. Я со скриптами сто  лет не работал, раньше вроде делал...
          Посмотри (MSDNL August 2001)->PSDK->WebDevelopment->CSS->Measuroing Element dimensions...
            DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
            <HTML>
            <HEAD><TITLE>Measure for Measure</TITLE>
            <SCRIPT>
            <!--
            function one() {
            report.value = "The DIV above is relatively positioned in the BODY.  The style object contains the information that was set in the inline style to position this object.  The following are the values that would be reported for the various position and dimension properties on the style object for the DIV:" + "\n\n";
            report.value= report.value + " mydiv.style.top (string) = " + foodiv.style.top + "\n";
            report.value= report.value + " mydiv.style.left (string) = " + foodiv.style.left + "\n";
            report.value= report.value + " mydiv.style.height (string) = " + foodiv.style.height + "\n";
            report.value= report.value + " mydiv.style.width (string) = " + foodiv.style.width + "\n";
            report.value= report.value + " mydiv.style.pixelTop (long) = " + foodiv.style.pixelTop + "\n";
            report.value= report.value + " mydiv.style.pixelLeft (long) = " + foodiv.style.pixelLeft + "\n";
            report.value= report.value + " mydiv.style.pixelHeight (long) = " + foodiv.style.pixelHeight + "\n";
            report.value= report.value + " mydiv.style.pixelWidth (long) = " + foodiv.style.pixelWidth + "\n";
            report.value= report.value + " mydiv.style.posTop (long) = " + foodiv.style.posTop + "\n";
            report.value= report.value + " mydiv.style.posLeft (long) = " + foodiv.style.posLeft + "\n";
            report.value= report.value + " mydiv.style.posHeight (long) = " + foodiv.style.posHeight + "\n";
            report.value= report.value + " mydiv.style.posWidth (long) = " + foodiv.style.posWidth + "\n";
            }
            function two() {
            report.value = "Each object has a set of offset positions.  The offset properties for the positioned darkBlue DIV above are: \n";
            report.value= report.value + "   offsetLeft = " + foodiv.offsetLeft + "\n";
            report.value= report.value + "   offsetTop = " + foodiv.offsetTop + "\n";
            report.value= report.value + "   offsetHeight = " + foodiv.offsetHeight + "\n";
            report.value= report.value + "   offsetWidth = " + foodiv.offsetWidth + "\n";

            report.value= report.value + "   offsetLeft = " + document.body.offsetLeft + "\n";
            report.value= report.value + "   offsetTop = " + document.body.offsetTop + "\n";
            report.value= report.value + "   offsetHeight = " + document.body.offsetHeight + "\n";
            report.value= report.value + "   offsetWidth = " + document.body.offsetWidth + "\n";
            }
            function three() {
            report.value = "Scroll values for the darkBlue DIV object" + "\n";
            report.value= report.value + "   scrollLeft = " + foodiv.scrollLeft + "\n";
            report.value= report.value + "   scrollTop = " + foodiv.scrollTop + "\n";
            report.value= report.value + "   scrollHeight = " + foodiv.scrollHeight + "\n";
            report.value= report.value + "   scrollWidth = " + foodiv.scrollWidth + "\n";
            report.value = report.value  + "Scroll values for the BODY" + "\n";

            report.value= report.value + "   scrollLeft = " + document.body.scrollLeft + "\n";
            report.value= report.value + "   scrollTop = " + document.body.scrollTop + "\n";
            report.value= report.value + "   scrollHeight = " + document.body.scrollHeight + "\n";
            report.value= report.value + "   scrollWidth = " + document.body.scrollWidth + "\n";
            }

              function four() {
              report.value = "";
              report.value= report.value + " clientHeight for the BODY: " + document.body.clientHeight + "\n";
              report.value= report.value + " clientWidth for the BODY:" + document.body.clientWidth + "\n";
              report.value= report.value + " clientTop for the BODY:" + document.body.clientTop + "\n";
              report.value= report.value + " clientLeft for the BODY:" + document.body.clientLeft + "\n";
              report.value= report.value + " clientHeight for this TEXTAREA:" + report.clientHeight + "\n";
              report.value= report.value + " clientWidth for this TEXTAREA: " + report.clientWidth + "\n";
              report.value= report.value + " clientTop for this TEXTAREA:" + document.body.clientTop + "\n";
              report.value= report.value + " clientLeft for this TEXTAREA:" + document.body.clientLeft + "\n";
              }
              function five() {
              report.value = "You clicked the mouse in the input button.  The following reports the various x and y values that are passed on the event object for this mouse click event \n";
              report.value= report.value + "   window.event.x = " + window.event.x + "\n";
              report.value= report.value + "   window.event.y = " + window.event.y + "\n";
              report.value= report.value + "   window.event.offsetX = " + window.event.offsetX + "\n";
              report.value= report.value + "   window.event.offsetY = " + window.event.offsetY + "\n";
              report.value= report.value + "   window.event.screenX = " + window.event.screenX + "\n";
              report.value= report.value + "   window.event.screenY = " + window.event.screenY + "\n";
              report.value= report.value + "   window.event.clientX = " + window.event.clientX + "\n";
              report.value= report.value + "   window.event.clientY = " + window.event.clientY + "\n";

              }
              -->
              </script>
              <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
              <META NAME="AUTHOR" CONTENT="InetSDK">
              <META NAME="MS.LOCALE" CONTENT="EN-US">
              <META NAME="ROBOTS" CONTENT="noindex">

              <!-- SAMPLE_STYLE_START -->
              <LINK REL="stylesheet" HREF="/workshop/basicSDKIE4.css" TYPE="text/css">
              <!-- SAMPLE_STYLE_END -->
              </HEAD>
              <!--TOOLBAR_START-->
              <!--TOOLBAR_EXEMPT-->
              <!--TOOLBAR_END-->

              <BODY style="border:lightBlue solid 15;margin:10px;padding:10px;background-color:navy;font-family:arial" LINK="#FFFFFF" VLINK="#808080" ALINK="#000000">

              <DIV id="foodiv" style="position:relative;top:5;left:5;height:150;width:200;overflow:scroll;margin:20px;background-color:white;padding:20px;border-color:lightBlue;border-width:10;border-style:solid">
              DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool! DHTML is so cool!
              </DIV>

              <input type=button onclick=one() value="Style Positions" style="background-color:lightBlue;font-family:arial">
              <input type=button onclick=two() value="Object Offset" style="background-color:lightBlue;font-family:arial">
              <input type=button onclick=three() value="Scroll Positions" style="background-color:lightBlue;font-family:arial">
              <input type=button onclick=four() value="Client Area" style="background-color:lightBlue;font-family:arial">
              <input type=button onclick=five() value="Event Object" style="background-color:lightBlue;font-family:arial">

              <BR>
              <center id="title"></center>
              <TEXTAREA id="report" rows=10 cols=50 wrap=physical style="font-family:arial">
              </TEXTAREA>


              <!-- START_PAGE_FOOTER -->
              <BR><BR><BR>
              © <A CLASS="clsIncCpyRt" HREF="/isapi/gomscom.asp?target=/misc/cpyright.htm" TARGET="_top">Microsoft Corporation. All rights reserved. Terms of use</A>.
              <!-- END_PAGE_FOOTER -->
              </BODY>
              </HTML>
                Урра! Заработало! (с) ;))))))
                Спасибо, это именно то, что нужно!
                Блин, ну почему разработчики не сделали все проще и понятнее?!
                Нет, чтоб сделать просто window.width/height :(((
                А еще говорят, что только у нас в стране все делается через задний проход...
                Вот вам доказательство, что не только у нас  ;D
                Еще раз спасибо!!!
                0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
                0 пользователей:


                Рейтинг@Mail.ru
                [ Script execution time: 0,0208 ]   [ 15 queries used ]   [ Generated: 27.04.24, 07:35 GMT ]