/    Sign up×
Community /Pin to ProfileBookmark

Problem with my start() function – please help !!

Same browser – same code – Why the difference.

Hi

Veiwing in Moz FF or IE I get the same problem.

On my website I use js to hide an info box on start up and reveal only on a mouse-over.

This works fine on some pages – but doesn’t on others even though the code is identical because I have put the js functions into an external file which they all refer to.

Can anyone spot what I have done wrong ?

The pages are live on :
[url]http://www.yodbod.com/ad_manager_a.php[/url]

If you just click on the top GO (ie with “Local Services” already selected) you will see that the READ THIS info box is hidden until you roll over it.

BUT
if you select “Cars Bikes & Boats” section (instead of “Local Services” )
you see that the info box is visable on loading – and wrecking the page cos no-one will guess that you need to roll on and off the READ THIS label.

Both pages readt the “start” function from the functions1.js file and yet they behave differently – how can this be ?

– please help

Here is the function file:

[CODE]function show_tip1(targetID) {
document.getElementById(targetID).style.visibility = “visible”;
} // end of function

function show_part(targetID) {
document.getElementById(targetID).style.visibility = “visible”;
} // end of function

function show_tip2(targetID) {
document.getElementById(targetID).style.visibility = “visible”;
} // end of function

function show_agent() {
document.getElementById(‘agent’).style.visibility = “visible”;
document.getElementById(‘layer2’).style.visibility = “hidden”;
} // end of function

function hide_agent() {
document.getElementById(‘layer2’).style.visibility = “visible”;
document.getElementById(‘agent’).style.visibility = “hidden”;
} // end of function

function show_offwant() {
document.getElementById(‘offwant’).style.visibility = “visible”;
} // end of function

function hide_offwant() {
document.getElementById(‘offwant’).style.visibility = “hidden”;
} // end of function

function show_read() {
document.getElementById(‘read’).style.visibility = “visible”;
document.getElementById(‘layer1’).style.visibility = “hidden”;
} // end of function

function hide_read() {
document.getElementById(‘read’).style.visibility = “hidden”;
document.getElementById(‘layer1’).style.visibility = “visible”;
} // end of function

function show_layer2(targetID) {
document.getElementById(targetID).style.visibility = “visible”;
document.getElementById(‘layer3’).style.visibility = “visible”;
document.getElementById(‘readThis’).style.visibility = “hidden”;
document.getElementById(‘theTips1’).style.visibility = “hidden”;
document.getElementById(‘theTips2’).style.visibility = “hidden”;
document.getElementById(‘layer1’).style.visibility = “hidden”;
document.getElementById(‘part’).style.visibility = “hidden”;
document.getElementById(‘ow’).style.visibility = “hidden”;
} // end of function

function start(){
document.getElementById(‘layer1’).style.visibility = “visible”;
document.getElementById(‘readThis’).style.visibility = “visible”;
document.getElementById(‘layer2’).style.visibility = “hidden”;
document.getElementById(‘layer3’).style.visibility = “hidden”;
document.getElementById(‘theTips1’).style.visibility = “hidden”;
document.getElementById(‘theTips2’).style.visibility = “hidden”;
document.getElementById(‘part’).style.visibility = “hidden”;
document.getElementById(‘agent’).style.visibility = “hidden”;
document.getElementById(‘offwant’).style.visibility = “hidden”;
document.getElementById(‘read’).style.visibility = “hidden”;
document.main_fm.x_area_cd.focus()
} // end of function[/CODE]

Thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@cyber1Nov 02.2006 — The FF Javascript Console gives this error

Error: document.getElementById("offwant") has no properties

Source File: http://www.yodbod.com/functions1.js

Line: 61
×

Success!

Help @DaveinLondon 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...