/    Sign up×
Community /Pin to ProfileBookmark

any clue why this isn’t working?

Hi all. I keep getting an error with this script; line 44 object required.

Any help with what I’m missing is greatly appreciated!
The url for the file is [url]http://www.gman.tourbusstudios.com/projects/lcc/lccintro.html[/url]
Here’s the code:

[code]
<html>
<head>

<script type=”text/javascript”>

function init() {
var obj = document.getElementById(“quilt”);
obj.innerHTML = ‘<img SRC=”http://www.gman.tourbusstudios.com/projects/lcc/fadeimages/quiltblock.jpg” height=218 width=243>’;
obj.style.position = “absolute”;
obj.style.top = “91px”;
obj.style.left = “200px”;
obj.style.zIndex = 1;
window.setTimeout(“fader()”, 225);
}

function quilt() {
var obj = document.getElementById(“quilt”);
obj.innerHTML = ‘<img SRC=”http://www.gman.tourbusstudios.com/projects/lcc/fadeimages/fade15.jpg” height=218 width=243>’;
obj.style.position = “absolute”;
obj.style.top = “91px”;
obj.style.left = “200px”;
obj.style.zIndex = 3;
}

//
var maxDivs = 15;
var divIndex = 1;
//
function fadeDivs()
{
var obj = document.getElementById(“fade”+divIndex);
obj.innerHTML = ‘<img src=”http://www.gman.tourbusstudios.com/projects/lcc/fadeimages/fade’+divIndex+’.jpg” height=”218″ width=”243″>’;
divIndex++;
if(divIndex <= maxDivs) {
window.setTimeout(“fadeDivs()”, 225);
} else {
window.setTimeout(“quilt()”, 1);
}
}
function setupDivs()
{
var obj = document.getElementById(“fade”+divIndex);
obj.style.position = “absolute”;
obj.style.top = “91px”;
obj.style.left = “200px”;
obj.style.width = “243px”;
obj.style.height = “218px”;
obj.style.zIndex = 2;
divIndex++;
if(divIndex <= maxDivs) {
window.setTimeout(“setupDivs()”, 100);
} else {
divIndex = 1;
}
}
function fader()
{
setupDivs();
window.setTimeout(“fadeDivs()”, 100);
return true;
}

window.onload = init;
</script>
</head>

<BODY background=http://www.gman.tourbusstudios.com/projects/lcc/fadeimages/introback.jpg>
<div id=”quilt”></div>
<div id=”text1″></div>
<div id=”fade2″></div>
<div id=”fade3″></div>
<div id=”fade4″></div>
<div id=”fade5″></div>
<div id=”fade6″></div>
<div id=”fade7″></div>
<div id=”fade8″></div>
<div id=”fade9″></div>
<div id=”fade10″></div>
<div id=”fade11″></div>
<div id=”fade12″></div>
<div id=”fade13″></div>
<div id=”fade14″></div>
<div id=”fade15″></div>
</body>
</html>
[/code]

Thanks!!!

Gman

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMar 16.2006 — I think that is because the function referred to here:

TO=window.setInterval("movetext1()", 10);

does not exist.
Copy linkTweet thisAlerts:
@bubba4gmanauthorMar 16.2006 — I'm sorry. I forgot to transfer the current version of the file to my server. I'm not using the one you accessed at that url anymore. I transfered the copy I'm now working with, which is the same as the code I posted above. I'm getting an error on line 44, character 5: object required.

Thanks for your help!!!

Gman
Copy linkTweet thisAlerts:
@phpnoviceMar 16.2006 — It is failing because there is no [B]fade1[/B] in your document:

<div id="text1"></div>

<div id="fade2"></div>
Copy linkTweet thisAlerts:
@bubba4gmanauthorMar 16.2006 — Doh! Sorry I missed that one. That was too easy.

Thanks!

One more question on this. The images are being displayed where they are supposed to according to the style properties defined in the script, but they are also being displayed down the left side of the screen. Any clue what I am not seeing in the script that is causing this?

Thanks again!!!

Here's the url again: http://www.gman.tourbusstudios.com/projects/lcc/lccintro.html

Gman
Copy linkTweet thisAlerts:
@phpnoviceMar 16.2006 — This is causing that:

<BODY background=http://www.gman.tourbusstudios.com/projects/lcc/fadeimages/introback.jpg>
Copy linkTweet thisAlerts:
@HTML-designerMar 16.2006 — phpnovice means that a backround in the body of an html repeats itself as many times as it has to to cover the page, I only do html, so that seems obvious to me, but if you don't know much about it, it may be confusing.
Copy linkTweet thisAlerts:
@bubba4gmanauthorMar 16.2006 — I took out the background image and it didn't make a difference. It seems to me that something is causing the divs to be displayed two different places, and I don't see what is doing it. I'm not concerned with the background image. It's the quilt image and the fade images. The fade images should display at the postion: top 91, left 200. They are, but they are also being displayed down the left side of the screen.


Thanks for your help!

Gman
Copy linkTweet thisAlerts:
@phpnoviceMar 16.2006 — OK, the problem is that your use of [b]divIndex[/b] in two different functions which are executing at the same time -- due to setTimeout() overlaps -- is causing some divs to not get their absolute position style setup at all.
×

Success!

Help @bubba4gman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...