/    Sign up×
Community /Pin to ProfileBookmark

js menu problem driving me insane!

Hi guys,

not sure if you can help me, I have to get this left hand menu sorted and for some reason it won’t start contracted on certain pages but will on others, not sure why – pulling my hair out (I’m not a js coder)(all pages use same global file),

[URL=”http://www.petwise.com.au”]http://www.petwise.com.au[/URL]

left hand menu starts out expanded which I don’t want… but on

[URL=”http://www.petwise.com.au/petadvice/?action=petadvice”]http://www.petwise.com.au/petadvice/?action=petadvice[/URL]

the menu is collapsed which is what I want on every page

when you view source code of both pages it should behave the same.

the petadvice page is the only page that uses a different index file, so that is the only difference (index info below).

js menu code

<script type=”text/javascript”>
<!–
function exp_coll(ind)

{
s = document.getElementById(“sp_” + ind);
i = document.getElementById(“im_
” + ind);
if (s.style.display == ‘none’)
{
s.style.display = ‘block’;
i.src = “assets/images/paw_minus.gif”;
}
else if (s.style.display == ‘block’)
{
s.style.display = ‘none’;
i.src = “assets/images/paw_plus.gif”;
}
}

function exp(ind)
{
s = document.getElementById(“sp_” + ind);
i = document.getElementById(“im_
” + ind);

if (!(s && i)) return false;
s.style.display = ‘block’;
i.src = “assets/images/paw_plus.gif”;
}

function coll(ind)
{
s = document.getElementById(“sp_” + ind);
i = document.getElementById(“im_
” + ind);
if (!(s && i)) return false;
s.style.display = ‘none’;
i.src = “assets/images/paw_plus.gif”;
}

function coll_all()
{

coll(0);
coll(9);
coll(33);
coll(85);
coll(87);
coll(90);
coll(91);
coll(92);
}

function exp_all()
{

exp(0);
exp(9);
exp(33);
exp(85);
exp(87);
exp(90);
exp(91);
exp(92);

}
–>
</script>

<BODY onload=”coll_all();

<li>&nbsp;&nbsp;&nbsp;<a href=”javascript:exp_coll(0);”><img src=”assets/images/paw_minus.gif” alt=”toggle” border=”0″ id=”im_0″ /></a>
<a href=”javascript:exp_coll(0);” STYLE=”text-decoration: none” >Dog</a>

[B]normal index ( for all pages other than pet advice pages – relevent bits only)[/B]:

<?php

/* Load the SaveContent Class */

require(“class.SaveContent.php”);

/* Create a new instance of the SaveContent Class called $SC */

$SC = new SaveContent();

/* Include Header File */

include (“header.php”);

/* Make sure we don’t include the Left Navigation display if this is the onlineshop or mycart */

if ((!($_GET[“action”] == ‘onlineshop’)) && (!($_GET[“action”] == ‘mycart’)) && (!($_GET[“action”] == ‘forum’)) && (!($_GET[“action”] == ‘dogshop’)) && (!($_GET[“action”] == ‘catshop’)) && (!($_GET[“action”] == ‘birdshop’)) && (!($_GET[“action”] == ‘fishshop’)) && (!($_GET[“action”] == ‘smallanimalshop’)) && (!($_GET[“action”] == ‘reptileshop’)))

include (“leftnav.php”);

[B]petadvice index (relevent bits):[/B]

?>

<?php

include (“../leftnav.php”);

?>

Does anybody have any ideas why it won’t expand on load on certain pages? Any help would be most appreciated ?

thanks a lot
Justin

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@rpgivpgmrJul 01.2007 — Juzzman,

You may think my answer is a cop-out, but it isn't really...

I believe you have an include or css that is overridding another css setting (which is the one you want to occur):

When you have a complex problem you can't figure out, stop looking

at the whole and trying to find the needle in the haystack, cut a section

of code or include and re-run it. If all is okay, put it back in and cut another

section and rerun it. If the offender is gone, you know your problem is in that block of code. I bet that helps you find it in only a few minutes.
Copy linkTweet thisAlerts:
@JuzmanauthorJul 02.2007 — thanks rpg, I'm trying to isolate the culprit...
×

Success!

Help @Juzman 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,
)...