Log in

View Full Version : Need help, so frustrated!



kevin.cochrane
11-11-2008, 02:17 PM
Hi guys

If anyone can help with this I'd be most appreciative, I've had a horrible time with this.

Basically, I am making a menu on a page whereby you can click an option and some text will appear lower down the page. This is achieved using javascript. Now, I want to make it so that once you click on an option (Like: 'Mission Statement') that options text will change colour- so it is easy to see what option you have selected.

Now, strangely enough, I have managed to get it working in IE of all places, but not FF (latest versions of both). I can't figure out why.

The style I am using is called 'Style1'. The CSS is as follows:

.style1 { font-weight: bold;font-style: italic;font-size:11px ;text-transform:uppercase}
a:link {color: #F68121; text-decoration:none}
a:active {color: Blue; text-decoration:none}
a:visited { color: #F68121; text-decoration:none }

hr {
height:1px;
color: #F4821F;
padding-top: 0px;
padding-bottom: 0px;
line-height: normal;
}

The Javascript I am using looks like this:

<div align="center">
<a href="#principles" onclick="showCont(0);returnfalse;" style="text-decoration: none" ><span class="style1">Mission Statement</span></a><br>
</div>
<div align="center">
<a href="#history" onclick="showCont(1);return false;" style=" text-decoration: none"
><span class="style1">Staff</span></a><br>
</div>
<div align="center">
<a href="#century" onclick="showCont(2);return false;" style=" text-decoration: none"
><span class="style1">B.E.E</div>
</a>
<div align="center">
<a href="#why" onclick="showCont(3);return false;" style=" text-decoration: none"
><span class="style1">Social Responsibility</div>
</a>
<hr>
<br>
<div id="cnt">
</div>

Help!

Thanks

Schmoopy
11-11-2008, 04:01 PM
Link to the site where this page is hosted would be nice to better understand the problem

Snookerman
11-11-2008, 04:02 PM
You missed adding semicolons here:

.style1 {font-weight: bold;font-style: italic;font-size:11px ;text-transform:uppercase;}
a:link {color: #F68121; text-decoration:none;}
a:active {color: Blue; text-decoration:none;}
a:visited { color: #F68121; text-decoration:none;}
I don't remember if FF had a problem with that, but you should have it anyway.

kevin.cochrane
11-12-2008, 08:35 AM
Hi guys.

Thanks for your replies. I managed to fix the problem by tweaking some of my CSS.

I have a new problem that needs help though. The menu that I spoke about earlier works fine, but I am trying to get a div to work within a javascript array. Is this possible?

The array looks like this so far (Remembering that " cannot be included in the array):

function showCont(typ) {
var stuff = new Array()
stuff[0] = "<tr height= 100 class=noprint > <td valign=top rowspan=1 height=100 ><p><span class=style1>TITLE HERE<a name=DCVG></a></span></p><p><span class=bodytext>TEXT HERE </span></p><div align=right class='bodytextbold' id='more1' style=display:block><a href=#readmore1 style=color:#009933; text-decoration:underline onClick=divShow('moretext1'), divHide('more1')>more &gt;&gt;<hr ></a></div><div style=display:none id='moretext1'><div align=right class=noprint> <a href=#readmore1 onClick=divHide('moretext1'), divShow('more1') style=color:#009933; text-decoration:underline class=bodytextbold>&lt;&lt; less </a></div><p>ADDITIONAL TEXT HERE</p></td></tr>

This is the function that I use for the menu, to call the text:

<div align="center" class="aboutlinks"><a href="#cathodic" onclick="showCont(0);return false;">TITLE HERE</a></div>
<div align="center" class="aboutlinks"><a href="#surveys" onclick="showCont(1);return false;">TITLE HERE</a></div>

Any help would be appreciated. I cannot give a link to the site because it is not hosted yet.

Thanks
Kevin

boogyman
11-12-2008, 02:27 PM
are you trying to create that div?

what are you trying to do?

kevin.cochrane
11-13-2008, 12:35 PM
No worries. I'm sorted. Thanks.