a runtime error has occurred
line 95
error: object required
and the line 95 is
<code>
this.el = (ns4)? (nest)? document.layers[nest].document.layers[obj]: document.layers[obj]: (ie4)? document.all[obj]: (ie5||ns5)? document.getElementById(obj): null;
</code>
but...the debugger says something about variable i already defined...
<code>
for (var i=0; i<wndo.length; i++) {
</code>
everything else seems to be working fine.aparto from the irritating message...
and...the whole code is here:
<code>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0035)http://your.workcomms.com/test.html -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1250">
<STYLE>#wndo1 {
Z-INDEX: 4; LEFT: 30px; OVERFLOW: hidden; WIDTH: 500px; CLIP: rect(0px 500px 230px 0px); POSITION: absolute; TOP: 180px; HEIGHT: 230px
}
.content {
LEFT: 0px; POSITION: absolute; TOP: 0px
}
#divUpControlMain {
Z-INDEX: 4; LEFT: 550px; WIDTH: 20px; POSITION: absolute; TOP: 180px; HEIGHT: 20px
}
#divDownControlMain {
Z-INDEX: 4; LEFT: 550px; WIDTH: 20px; POSITION: absolute; TOP: 390px; HEIGHT: 20px
}
</STYLE>
<SCRIPT language=JavaScript type=text/javascript>
/*
scroll-multi.js
*/
dom = (document.getElementById) ? true : false;
ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
ns4 = (document.layers && !dom) ? true : false;
ie4 = (document.all && !dom) ? true : false;
nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;
var inc = 4; // controls speed of scroll (larger number for faster scroll)
var timer = 20; // interval between calls to scroll onmouseover
var t=0; // for setTimeouts
var done;
wndo = new Array(); // for window layers
cntLyrs = new Array(); // for scrolling content areas
function getLyrTop() { return parseInt(this.css.top); }
function getLyrLeft() { return parseInt(this.css.left); }
function shiftTo(x,y) {
if (ns4) { this.css.moveTo(x,y); }
else { this.css.left=x+"px"; this.css.top=y+"px"; }
}
function shiftBy(x,y) {
if (ns4) { this.css.moveBy(x,y); }
else {
this.css.left = parseInt(this.css.left)+x+"px";
this.css.top = parseInt(this.css.top)+y+"px";
}
}
function inchRight(num) {
if (!done) return; var y = cntLyrs[num].getLeft();
if (y>-maxX[num]) {
cntLyrs[num].shiftBy(-inc,0);
//cntLyrs[num].css.left=parseInt(cntLyrs[num].css.left)-inc;
t = setTimeout("inchRight('"+num+"')",timer);
}
}
function inchLeft(num) {
if (!done) return; var y = cntLyrs[num].getLeft();
if (y<0) {
cntLyrs[num].shiftBy(inc,0);
t = setTimeout("inchLeft('"+num+"')",timer);
}
}
function inchDown(num) {
if (!done) return; var y = cntLyrs[num].getTop();
if (y>-maxY[num]) {
cntLyrs[num].shiftBy(0,-inc);
t = setTimeout("inchDown('"+num+"')",timer);
}
}
function inchUp(num) {
if (!done) return; var y = cntLyrs[num].getTop();
if (y<0) {
cntLyrs[num].shiftBy(0,inc);
t = setTimeout("inchUp('"+num+"')",timer);
}
}
////////////////////////////////////////////////////////////////////
// Constructor function used for creating scrollable content areas.
// Used to create both wndo and content objects.
////////////////////////////////////////////////////////////////////
function createObj(obj,nest,id) {
this.el = (ns4)? (nest)? document.layers[nest].document.layers[obj]: document.layers[obj]: (ie4)? document.all[obj]: (ie5||ns5)? document.getElementById(obj): null;
this.css = (ns4)? this.el: (ie4||ie5||ns5)? this.el.style: null;
this.height = (ns4)? this.el.clip.height: (ie4||ie5)? this.el.clientHeight: (ns5)? this.el.offsetHeight: 0;
this.width = (ns4)? this.el.clip.width: (ie4||ie5)? this.el.clientWidth: (ns5)? (id)? document.getElementById(id).offsetWidth: this.el.offsetWidth: 0;
this.getLeft = getLyrLeft; this.getTop = getLyrTop;
this.shiftBy = shiftBy; this.shiftTo = shiftTo;
}
</SCRIPT>
<SCRIPT language=JavaScript type=text/javascript>
<!--
/*
This code is from Dynamic Web Coding
www.dyn-web.com
Copyright 2001 by Sharon Paine
Permission granted to use this code as long as this
entire notice is included.
*/
dom = (document.getElementById) ? true : false;
ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
ns4 = (document.layers && !dom) ? true : false;
ie4 = (document.all && !dom) ? true : false;
nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;
var origWidth, origHeight;
if (ns4) {
origWidth = window.innerWidth; origHeight = window.innerHeight;
window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}
function initObjs() {
/////////////////////////////////////////////////////////////
// Argument for creating wndo objects: id of wndo div.
// Arguments for creating content:
// id of content div, id of its wndo div (div it is nested in),
// id of table or other html element that contains content.
// NOTE: Netscape 6 needs that html container and its id
// in order to get width for horizontal scrolling.
// If only using vertical scrolling, that extra container
// is not necessary.
/////////////////////////////////////////////////////////////
// first scrollable content area
wndo[0] = new createObj('wndo1');
cntLyrs[0] = new createObj('cnt1_1','wndo1');
/////////////////////////////////////////////////////////////////////
// Don't remove these lines
// set left, top to 0,0 (necessary for all but ns4 to get top,left)
for (var i=0; i<cntLyrs.length; i++){
cntLyrs[i].shiftTo(0,0);
}
// to keep track of distance to scroll
maxX = new Array(); maxY = new Array();
for (var i=0; i<wndo.length; i++) {
maxX[i] = cntLyrs[i].width - wndo[i].width;
maxY[i] = cntLyrs[i].height - wndo[i].height
}
done = true; // ready
}
window.onload = initObjs;
//-->
</SCRIPT>
<META content="MSHTML 6.00.2716.2200" name=GENERATOR></HEAD>
<BODY bgcolor="#54585C">
<table width="100%" border="0" callpadding = 0 cellspacing= 0 height="100%" cellpadding="0">
<tr>
<td align="left" valign="top" height="616">
<table width="306" border="0" cellpadding="0" cellspacing="0" height="238">
<tr bgcolor="#FFFFFF">
<td width="41%"> </td>
<td width="0%"> </td>
<td width="9%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="41%"> </td>
<td width="0%"> </td>
<td width="9%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="41%"> </td>
<td width="0%"> </td>
<td width="9%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="41%"> </td>
<td width="0%"> </td>
<td width="9%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="41%"> </td>
<td width="0%"> </td>
<td width="9%"> </td>
</tr>
</table>
</td>
</tr>
</table>
</BODY></HTML>
</code>
please help.
check it out at: http://www.inet.hr/~osvlan02/




Bookmarks