...

View Full Version : no experience with javascript picking up someone elses code



tom.newsome
11-10-2010, 11:10 AM
Hi,

Right I have a bit of a beginners problem, I am a designer and previously had a little HTML knowledge, I am working for a charity and have picked up their website, http://www.2learn.org.uk

They had a drop down menu in place, which I would now like to change. I want to learn how to edit items within the code, delete add and change. I have tried to understand and manipulate the code but as I have not worked with javascript except copying sample code or basic stuff in BlueJ years ago that I forget.

What do I need to do in order to get this sorted can anyone help, sorry if this is a bit vague but I'm not sure where to start. I could liase with someone with the code, call it pro boner work for yourselves.

Thanks
Tom

Philip M
11-10-2010, 11:16 AM
This forum is not a free coding service nor an arm of social security. The short answer is learn JavaScript and, it would appear, HTML.

Presumably you would not attempt to service or repair a machine or appliance without any experience or understanding of how it worked.

If you have specific problems with the code then by all means seek help in this forum. Please pay attention to the forum rules and posting guidelines.


It is your responsibility to die() if necessary….. - PHP Manual

Kor
11-10-2010, 11:17 AM
No chance. Either you learn JavaScript, or you give up. See also:
http://www.codingforums.com/showpost.php?p=1013723&postcount=5

tom.newsome
11-10-2010, 01:09 PM
I appreciate your comments but i did read and I am a designer, I use dreamweaver and have implemented strategies to help me allow links to work. I thought forums were about helping solve problems and I have tried web design forums but obviously java is a more specific technique, I thought someone would understand that my company cannot afford to hire anyone more professional as they would charge through the roof for a simple edit. This is a stop gap for me thought someone would be kind hearted and help me and this charity out, thanks for your comments anyway.

Philip M
11-10-2010, 01:16 PM
I use dreamweaver

Yuck! Puke! :)


... but obviously java is a more specific technique .....

Be aware that Java and Javascript are entirely different programming languages, in spite of the confusingly similar names.

I can understand your desire for a free ride, but would you, for example, say to your dentist "With all your years of training and experience this procedure will be very simple for you. So I think you should treat me for nothing". :p

vwphillips
11-10-2010, 01:18 PM
the menu is configared in content.js

the most important cofig option have been commented



var initX = 154;
var initY = 40;
var backColor = '#89C935'; // the background color of the sub menu
var borderColor = '#FFFCFF'; // the border color of the sub menu
var borderSize = 1; // the border width of the sub menu
var itemHeight = 20; // the height of the sub menu item
var xOverlap = 0;
var yOverlap = 0;

menuContent = new Array ();

{
var xx = 250;
var yy = 117;

var xx1 = 331;
var yy1 = 117;

var xx2 = 419;
var yy2 = 117;



}

//First Menu
menuContent [0] = new Array (
-1,
-1,
81, // submenu width
xx, // the horizontal position of the submenu
yy, // the vertical position of the submenu

new Array (
// submenu item text link
' Introduction', 'introduction.htm',
// submenu item text link
' Objective', 'objective.htm',
// submenu item text link
' Vision', 'vision.htm'
)
);

//second Menu
menuContent [1] = new Array (
-1,
-1,
88,
xx1,
yy1,

new Array (

' Past Projects', 'pastprojects.htm',
' Current  Projects', 'currentprojects.htm',
' Future  Projects', 'futureprojects.htm',
' International  Engagements', 'internationalengagements.htm'
)
);

//third Menu
menuContent [2] = new Array (
-1,
-1,
241,
xx2,
yy2,

new Array (

' Funders people who give help', 'funderspeoplewhogivehelp.htm',
' Volunteers', 'volunteers.htm',
' Case Studies', 'casestudies.htm',
' Business Link', 'businesslink.htm'
)
);

tom.newsome
11-10-2010, 02:12 PM
Thanks for posting the code, can I change the code so that "Business Links" = Partnerships? I did attempt to do this but this did not work.

Also can I add a new item to a drop down menu?

As for "free ride" I work for a charity and am not asking for a huge thing. I did programming for a few months, yes its a skill but the time isn't monumental. Any suggestions to where I might go to get some guidance on this one issue please feel free.

Thanks

Kor
11-10-2010, 02:22 PM
I work for a charity and am not asking for a huge thing.
You may work for the Pope himself, that will make no difference. The problem is that you must have the basic knowledge in JavaScript, otherwise you will not understand, no matter which advice you may get. I don't see what else we can add to the kind vwphillips's explanation. If you really don't understand that, what more can we do for you?

connollyc4
11-10-2010, 02:22 PM
I have tried to understand and manipulate the code but as I have not worked with javascript except copying sample code or basic stuff in BlueJ years ago that I forget.


I thought BlueJ was used for Java?

Afro_Programmer
11-10-2010, 02:25 PM
I thought BlueJ was used for Java?

Doesn't matter. Once you know one, you know them all. :D

connollyc4
11-10-2010, 02:46 PM
Thanks for posting the code, can I change the code so that "Business Links" = Partnerships? I did attempt to do this but this did not work.


Thanks

Just change the below code from


' Business Link', 'businesslink.htm'


To

' Partnerships', 'businesslink.htm'

in the content.js file ... This will still go to the same businesslink.htm page but the name on the dropdown will change from business link to partnership





Also can I add a new item to a drop down menu?


Yes, Like so.


' Past Projects', 'pastprojects.htm',
' Current  Projects', 'currentprojects.htm',
' Future  Whatever1', 'whatever1.htm',
' Future  Whatever2', 'Whatever2.htm',
' Future  Whatever3', 'Whatever3.htm',
' Future  Whatever4', 'Whatever4.htm',
' International  Engagements', 'internationalengagements.htm'
)

Which is also in the content.js file

tom.newsome
11-24-2010, 03:55 PM
var initX = 154;
var initY = 40;
var backColor = '#89C935';
var borderColor = '#FFFCFF';
var borderSize =1;
var itemHeight = 20;
var xOverlap = 0;
var yOverlap = 0;

menuContent = new Array ();

{
var xx = 250;
var yy = 117;

var xx1 = 331;
var yy1 = 117;

var xx2 = 419;
var yy2 = 117;



}

//First Menu
menuContent [0] = new Array (
-1,
-1,
81,
xx,
yy,

new Array (

' Introduction', 'introduction.htm',
' Objective', 'objective.htm',
' Vision', 'vision.htm'
' Staff', 'staff.htm'

)
);

//second Menu
menuContent [1] = new Array (
-1,
-1,
88,
xx1,
yy1,

new Array (

' Past Projects', 'pastprojects.htm',
' Current  Projects', 'currentprojects.htm',
' Future  Projects', 'futureprojects.htm',
' International  Engagements', 'internationalengagements.htm'
)
);

//third Menu
menuContent [2] = new Array (
-1,
-1,
241,
xx2,
yy2,

new Array (

' Funders – people who give help', 'funderspeoplewhogivehelp.htm',
' Volunteers', 'volunteers.htm',
' Case Studies', 'casestudies.htm',
' Business Link', 'businesslink.htm'
)
);


Following previous advice this is what I came up with and dreamweaver says there is an error. Thanks for all the help and advice so far is there any reason this isn't working? please don't say dreamweaver without a good explanation :)

Thanks

tom.newsome
11-24-2010, 03:58 PM
sack that i found the error lol schoolboy mistake, sorry guys should work now!

Kor
11-24-2010, 04:15 PM
sack that i found the error lol schoolboy mistake, sorry guys should work now!
See? :) Working with the language helps a lot. We are glad to hear that you have solved your problem :thumbsup:

tom.newsome
01-25-2011, 02:45 PM
Hi guys, I am using the same javascript menu code, as before but i am wanting to use it for my own site. Can anyone point out the bit I need to change, i'm sure its probably obvious.

I have not put the site online yet but the code isn't changed. Any help much appreciated, this is my personal project.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum