中国教程网论坛's Archiver

tearstop 发表于 2008-5-5 14:12

求助iframe的自动收缩高度

 ASP页面使用iframe调用另外一个ASP页面,iframe无法自动控制收缩高度。在网上找了下试了试别人的办法,可是不管用,因为我的被调用ASP页面文件还嵌入了其它的ASP页面,头大啊。
 请高手指教
 调用语句
 <%
  dim mytype
  set mytype=request("type")
  if trim(mytype)="" then
  mytype="indexright.asp"
end if
response.write("<iframe  align='left' name='rightframe' frameBorder=0 marginheight=0 marginwidth=0   width=100% height=1250 allowtransparency='true' id='rightframe' scrolling='no' src="&mytype&"></iframe></TD>")
  %>
 被调用页面
 <!--#include file="msconnect/dbconn.asp"-->
<!--#include file="include/ModuleF.asp"-->
<%
Call CheckReq()
dim res
Call ConnectionDatabase("mhcmember")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<style type="text/css">
<!--
#Layer1 {
        position:absolute;
        width:131px;
        height:64px;
        z-index:1;
        left: 573px;
        top: 269px;
}
#Layer2 {
        position:absolute;
        width:110px;
        height:78px;
        z-index:1;
        left: 579px;
        top: 129px;
}
#Layer3 {
        position:absolute;
        width:200px;
        height:115px;
        z-index:1;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j];
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
  //Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (numGotos != null)
    if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
    else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
  jmpFwd = (fNew > tmLn.curFrame);
  for (i = 0; i < tmLn.length; i++) {
    sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
    if (sprite.charAt(0) == "s") {
      numKeyFr = sprite.keyFrames.length;
      firstKeyFr = sprite.keyFrames[0];
      lastKeyFr = sprite.keyFrames[numKeyFr - 1];
      if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
      for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
      for (j=0; j<sprite.values.length; j++) {
        props = sprite.values[j];
        if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
        else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
        if (sprite.obj != null) {
          if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
          else        sprite.obj[props.prop2][props.prop] = props[propNum];
      } }
    } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
  }
  tmLn.curFrame = fNew;
  if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');
}

function MM_initTimelines() { //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    var macIE5 = (navigator.platform ? (navigator.platform == "MacPPC") : false) && (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4);
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(1);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 10;
    document.MM_Time[0][0] = new String("behavior");
    document.MM_Time[0][0].frame = 45;
    document.MM_Time[0][0].value = "MM_timelineGoto('Timeline1','1')";
    document.MM_Time[0].lastFrame = 45;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}
//-->
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<LINK href="FrameStyle.css" type=text/css rel=stylesheet>
<title>Main</title>
</head>

<body bgcolor="transparent" onLoad="MM_timelinePlay('Timeline1')">
<table id=formfra border=0>
<tr><td>
<TABLE width=705 border=0 align=center cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD width="702"
      align=left vAlign=top><!-- menu start */ --><IMG height=36
      src="images/hr.gif" width=700><BR>
          <!-- menu end */ --><!-- content start */ -->
      </TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><HR></TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><TABLE height="154"   cellPadding=0>
      <TBODY>
        <TR>
          <TD width="510" height="58" align=left vAlign=bottom><IMG height=40
                  src="images/sub_title001a.gif"
              width=195></TD>
        </TR>
        <TR>
          <TD   class="main_subtitle_main"><br>
                 <script language="JavaScript" src="http://bbs.yz-ms.com.cn/new.php?action=article&fidin=2&digest=0&length=80&postdate=1&num=20&pre=0&order=2&author=0&replies=0"></script>
                 <br> </TD>
        </TR>
        <TR>
          <TD height="38" align=right valign="top"><a href="http://bbs.yz-ms.com.cn" target="_blank"><IMG
                  height=20 src="images/more.gif" width=105
                  border=0></a></TD>
        </TR>
      </TBODY>
    </TABLE>
      </TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><HR></TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><TABLE cellPadding=0>
      <TBODY>
        <TR>
          <TD width="512" align=left vAlign=bottom><IMG
            src="images/sub_title_forum.gif"></TD>
        </TR>
        <TR>
          <TD class="main_subtitle_main"><br>
                  <script language="JavaScript" src="http://bbs.yz-ms.com.cn/new.php?action=article&fidin=2&digest=0&length=30&postdate=1&num=20&pre=0&order=2&author=0&replies=0">
</script>
                  <br>
                  </TD>
        </TR>
        <TR>
          <TD height="38" align=right vAlign=top><a href="http://bbs.yz-ms.com.cn" target="_blank"><IMG height=20 src="images/more.gif"
            width=105 border=0></a></TD>
        </TR>
      </TBODY>
    </TABLE></TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><hr></TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><TABLE width=548 height="146"
              border=0  cellPadding=0 cellSpacing=0>
      <TBODY>
        <TR>
          <TD  align=left vAlign=bottom><IMG height=41
                  src="Images/sub_title_itemshop_top.gif"
                  width=215></TD>
        </TR>
        <TR>
          <TD height="36" class="main_subtitle_main">
                   <marquee onmouseover="this.stop()" onmouseout="this.start()" direction="left" behavior="scroll">
                           <% dim p                                       
                              set res=server.CreateObject("adodb.recordset")
                                                 res.open "select top 20 * from onlineshop where tuijian=1",conn,1,1
                                                 if res.eof then
                                                response.Write "&nbsp;"
                                                else       
                                                while not res.eof and p<20
                                               
                                        if isnull (res("gmpic")) or res("gmpic")="" then%>
                        <a href="/msoshop.asp?class=100&zbname=<%=res("ItemName")%>" target="_blank"><img alt=<%=res("ItemName")%> src="gmpic/nopic.gif" width="100" height="100" border="0"></a>
                                  <%else%>
                         <a href="/msoshop.asp?class=100&zbname=<%=res("ItemName")%>" target="_blank"><img alt=<%=res("ItemName")%> src="<%=mid(res("Gmpic"),3)%>" width="100px" height="100px" border="0"></a>
                                  <%end if
                                         res.movenext
                                          p=p+1
                                          wend
                                          res.close : set res=nothing
                                          end if
                                          %> </marquee>                   
                   </TD>
        </TR>
        <TR>
          <TD height="38" valign="top" align=right><a href="msoshop.asp" target="rightframe"><IMG height=20
                  src="images/more.gif" width=105
                border=0></a></TD>
        </TR>
      </TBODY>
    </TABLE></TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><HR></TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><TABLE cellSpacing=0 cellPadding=0 width=549  border=0>
      <TBODY>
        <TR>
          <TD width="523" align="center" vAlign="middle"><IMG
            src="images/top_rank.gif" width=420 height=259
            border=0 useMap=#MapMap href="rank.asp?type=1"></TD>
        </TR>
      </TBODY>
    </TABLE>
     </TD>
  </TR>
  <TR>
    <TD vAlign=top
      align=left><hr></TD>
  </TR>
  <TR>
    <TD  align=left vAlign=top><IMG height=36
      src="images/hr.gif" width=700></TD>
  </TR>
  <!-- content start */ --><!-- bottom start */ --><!-- bottom end */ -->
</TBODY></TABLE>


<map name="MapMap">
  <area shape="rect" coords="9,124,205,162" href="rank.asp?type=1" target="rightframe">
  <area shape="rect" coords="213,127,404,161" href="rank.asp?type=2" target="rightframe">
  <area shape="rect" coords="13,168,203,204" href="#">
  <area shape="rect" coords="213,169,405,205" href="rank.asp?type=3" target="rightframe">
  <area shape="rect" coords="114,211,308,245" href="msoguild.asp" target="rightframe">
</map>
</td>
</tr>
</table>
</body>
</html>

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.