主题:  在iframe里添加滚动区域插件遇到的问题?

wshijun

职务:普通成员
等级:1
金币:0.0
发贴:30
注册:2003/9/5 16:30:56
#12004/6/26 23:06:32
我在iframe里添加滚动区域插件。在本地打开浏览,上下滚动一切正常。当我把网页放到局域网的服务器上。再回到我机子上浏览服务器上的相同文件时,当鼠标放上去时他不上下滚动,反而消失了(滚动的内容)。我的机子是XP,服务器是2000server.
在服务器上浏览是正常的。请高手指点。多谢



moonly

职务:普通成员
等级:4
金币:2.0
发贴:1614
注册:2004/7/5 11:38:25
#22004/6/28 11:23:14
代码发上来看看
研究研究



wshijun

职务:普通成员
等级:1
金币:0.0
发贴:30
注册:2003/9/5 16:30:56
#32004/6/28 22:13:19
这是调用页面的iframe代码:
<td rowspan="10"><iframe src="kf/kf1.htm" name="kefang" width="367" marginwidth="0" height="350" marginheight="0" scrolling="no" frameborder="0"></iframe></td>
这是被调用的iframe的代码:
<%@LANGUAGE="javascript" CODEPAGE="936"%>
<html><!-- InstanceBegin template="/Templates/about1-1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- InstanceBeginEditable name="doctitle" -->
<title>无标题文档</title>
<!-- InstanceEndEditable -->
<style type="text/css">
#divUpControl{
    position:absolute;
    width:47px;
    left:314px;
    top:7px;
    z-index:1;
    text-align: right;
    height: 16px;
}
#divDownControl{
    position:absolute;
    width:48px;
    left:312px;
    top:327px;
    z-index:1;
    text-align: right;
    height: 16px;
}
#divContainer{
position:absolute;
width:344px;
height:297px;
overflow:hidden;
top:30;
left:9px;
clip:rect(0,340,295,0);
visibility:hidden
}
#divContent{
position:
absolute;
top:0;
left:0
}
</style>
<script language="javascript">// begin absolutely positioned scrollable area object scripts
// Extension developed by David G. Miles
// Original Scrollable Area code developed by Thomas Brattli
function verifyCompatibleBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5">-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;

this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new verifyCompatibleBrowser()


var speed=50

var loop, timer

function ConstructObject(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
this.up=MoveAreaUp;this.down=MoveAreaDown;
this.MoveArea=MoveArea; this.x; this.y;
this.obj = obj + "Object"
eval(this.obj + "=this"
return this
}
function MoveArea(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}

function MoveAreaDown(move){
    if(this.y>-this.scrollHeight+objContainer.clipHeight){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".down("+move+"",speed)
    }
}
function MoveAreaUp(move){
    if(this.y<0){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".up("+move+"",speed)
    }
}

function PerformScroll(speed){
    if(initialised){
        loop=true;
        if(speed>0) objScroller.down(speed)
        else objScroller.up(speed)
    }
}

function CeaseScroll(){
loop=false
if(timer) clearTimeout(timer)
}
var initialised;
function InitialiseScrollableArea(){
objContainer=new ConstructObject('divContainer')
objScroller=new ConstructObject('divContent','divContainer')
objScroller.MoveArea(0,0)
objContainer.css.visibility='visible'
initialised=true;
}
// end absolutely positioned scrollable area object scripts

</script>
<link href="../hotel.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body leftmargin="0" topmargin="0" onLoad="InitialiseScrollableArea()">
<!-- InstanceBeginEditable name="EditRegion3" -->
<table width="367" height="350" border="0" cellpadding="0" cellspacing="0" background="kefang_r3_c3.jpg">
<tr>
<td>
<!-- begin absolutely positioned scrollable area object-->
<div id="divUpControl"> <a href="javascript:;" onMouseOver="PerformScroll(-5)" onMouseOut="CeaseScroll()">[up]</a>
</div>
<div id="divDownControl"> <a href="javascript:;" onMouseOver="PerformScroll(5)" onMouseOut="CeaseScroll()">[down]</a>
</div>
<div id="divContainer">
<div id="divContent"> <span class="myfont">
<p>&nbsp;&nbsp;&nbsp;&nbsp;酒店设有宽敞舒适的豪华套房,温馨浪漫的蜜月套房,时尚潮流的商务套房,以及尊贵典雅的中、西式总统套房。
每一间客房都配有酒店专用电视。高级套房另配有书房,让你在充裕的空间里,与三五知己或商场密友畅聚,安享前所未有的一流住宿和服务, 使你倍感宾至如归。</p>
<p align="center"><img src="kf7.gif" alt="海港大酒店--客房概述" width="150" height="100" border="0" align="absmiddle">&nbsp;酒店大堂</p>
<p align="center">酒店大堂&nbsp;<img src="kf8.gif" alt="海港大酒店--客房概述" width="150" height="100" border="0" align="absmiddle"></p>
         <p align="center"><img src="kf9.gif" alt="海港大酒店--客房概述" width="150" height="100" border="0" align="absmiddle">&nbsp;酒店大堂</p>
        </span>
        </div>
</div>
<!-- end absolutely positioned scrollable area object -->
</td>
</tr>
</table>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>



wshijun

职务:普通成员
等级:1
金币:0.0
发贴:30
注册:2003/9/5 16:30:56
#42004/6/28 22:20:30
我在用这个滚动插件时,没改什么除了滚动的速度和<P></P>中的东东改变一点,其余的用的都是该插件自动生成的代码.



wshijun

职务:普通成员
等级:1
金币:0.0
发贴:30
注册:2003/9/5 16:30:56
#52004/6/30 14:43:52
怎么没回音 ?



moonly

职务:普通成员
等级:4
金币:2.0
发贴:1614
注册:2004/7/5 11:38:25
#62004/7/3 20:48:05
不好意思
没有看到



moonly

职务:普通成员
等级:4
金币:2.0
发贴:1614
注册:2004/7/5 11:38:25
#72004/7/3 21:24:44
研究了半天,看不懂

我现做了一个给你
你看有没有用
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<div id="slayer" style="position:absolute; top: 120px;
left: 100px; clip: rect(0 300 200 0); width: 300px; height: 200px">

<script language="javascript">

<!-- //by hve

var layerW=parseInt(slayer.style.width);

var layerH=parseInt(slayer.style.height);

var layerL=parseInt(slayer.style.left);

var layerT=parseInt(slayer.style.top);

var step=0; //scroll value

function movstar(a,time){

if (a<0&&step>-parseInt(slayer.scrollHeight)+layerH||a>0&&step<0)

mov(a);

movx=setTimeout("movstar("+a+","+time+")",time);

}

function movover(){

clearTimeout(movx);

}

function mov(a){

slayer.style.top = (step+=a) + layerT;

clipL=0;

clipR=layerW;

clipB=layerH-step;

clipT=0-step;

slayer.style.clip="rect("+clipT+" "+clipR+" "+clipB+" "+clipL+")";

}

//-->

</script>

<p>&nbsp;酒店设有宽敞舒适的豪华套房,温馨浪漫的蜜月套房,时尚潮流的商务套房,以及尊贵典雅的中、西式总统套房。 每一间客房都配有酒店专用电视。高级套房另配有书房,让你在充裕的空间里,与三五知己或商场密友畅聚,安享前所未有的一流住宿和服务, 使你倍感宾至如归。</p>

<p align="center"><img src="kf7.gif" alt="海港大酒店--客房概述" width="150" height="100" border="0" align="absmiddle">&nbsp;酒店大堂</p>
<p align="center">酒店大堂&nbsp;<img src="kf8.gif" alt="海港大酒店--客房概述" width="150" height="100" border="0" align="absmiddle"></p>
<p align="center"><img src="kf9.gif" alt="海港大酒店--客房概述" width="150" height="100" border="0" align="absmiddle">&nbsp;酒店大堂</p>
<p><br>
  
</p>
</div>

<div id="Layer1" style="position:absolute; width:20px; height:200px;
z-index:1; left: 400px; top: 120px">

  <table width="100%" height="250"  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="33"><a href="#" onMouseDown="movover();movstar(3,2)" onMouseOut="movover()" onMouseOver="movstar(1,20)" onMouseUp="movover();movstar(1,20)">up</a></td>
    </tr>
    <tr>
      <td height="198">&nbsp;</td>
    </tr>
    <tr>
      <td><a href="#" onMouseDown="movover();movstar(-3,2)" onMouseOut="movover()" onMouseOver="movstar(-1,20)" onMouseUp="movover();movstar(-1,20)">down</a></td>
    </tr>
  </table>
</div>

</body>
</html>



wshijun

职务:普通成员
等级:1
金币:0.0
发贴:30
注册:2003/9/5 16:30:56
#82004/7/5 13:04:16
谢谢先.