PDA

View Full Version : Javascript Scroll Bar not working



Ashane
01-17-2007, 07:19 PM
Hi all,

First time here but I beleive this is the right place. I did a search and coudnt really find a match to the problem I'm experincing. I've got a javascript scroll bar (using div's) that works on one portion of my "test" site, but not the flash picture viewer portion.

Here is where it works... http://www.flameborne.net/TestBanner/webpage/newsbody.html

Thats just the specific frame without all the other frames included.

Here is where it dosent work...

http://www.flameborne.net/TestBanner/webpage/ then click screens.

It SHOULD look like this...

http://www.flameborne.net/TestBanner/webpage/screens.html

(So you can access the other pictures, the albums and the slideshow feature.. its Coffecup)

Is it because you cant scroll a SWF and only text? Really stumped :X

Here is the actual code for the scroller, and I'm putting the text (and the flash SWF) below the last div tag, and ending with </div> twice.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#divUpControl{position:absolute; width:17; left:753; top:63; z-index:1; text-align: right; clip: rect( )}
#divDownControl{position:absolute; width:17; left:753; top:248; z-index:1; text-align: right; clip: rect( )}
#divContainer{
position:absolute;
width:400;
height:400;
overflow:hidden;
top:60;
left:420;
clip: rect(0,400,251,0);
visibility: hidden;
background-color: #000000;
}
#divContent{position:absolute; top:0; left:0;}
</style>
<script language="JavaScript">
<!--
// Copyright (C) 1999 Thomas Brattli
// Coded modified by Abhisek Pramanik [ www.abystudio.cjb.net ]
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>
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
</head>

<body leftmargin="0" topmargin="0" onLoad="InitialiseScrollableArea()" bgcolor="#000000">



<!-- begin absolutely positioned scrollable area object-->
<div id="divUpControl" style="left: 403px; top: 43px; width: 17"> <a href="#" onMouseOver="PerformScroll(-10);window.status = 'Scroll Up'; return true" onMouseOut="CeaseScroll();window.status = ''"><img src="images/up.gif" width="17" height="14" border="0"></a></div>
<div id="divDownControl" style="left: 403px; top: 228px; width: 17"> <a href="#" onMouseOver="PerformScroll(3);window.status = 'Scroll Down'; return true" onMouseOut="CeaseScroll();window.status = ''"><img src="images/down.gif" width="17" height="14" border="0"></a></div>
<div id="divContainer" style="right; 1px; top: 10px; height: 374px; z-index: 4">
<div id="divContent" style="">

thetestingsite
01-19-2007, 03:41 AM
Try adding a <br> tag or even some invisible text just below the SWF, just to give it something else in the div to scroll to (if that makes any sense).

Hope this helps.