Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-10-2010, 11:10 AM   PM User | #1
tom.newsome
New to the CF scene

 
Join Date: Nov 2010
Location: Huddersfield, UK
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
tom.newsome is an unknown quantity at this point
no experience with javascript picking up someone elses code

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
tom.newsome is offline   Reply With Quote
Old 11-10-2010, 11:16 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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

Last edited by Philip M; 11-10-2010 at 11:18 AM..
Philip M is online now   Reply With Quote
Old 11-10-2010, 11:17 AM   PM User | #3
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
No chance. Either you learn JavaScript, or you give up. See also:
http://www.codingforums.com/showpost...23&postcount=5
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 11-10-2010, 01:09 PM   PM User | #4
tom.newsome
New to the CF scene

 
Join Date: Nov 2010
Location: Huddersfield, UK
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
tom.newsome is an unknown quantity at this point
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.
tom.newsome is offline   Reply With Quote
Old 11-10-2010, 01:16 PM   PM User | #5
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by tom.newsome View Post
I use dreamweaver
Yuck! Puke!

Quote:
Originally Posted by tom.newsome View Post
... 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".

Last edited by Philip M; 11-10-2010 at 01:27 PM..
Philip M is online now   Reply With Quote
Old 11-10-2010, 01:18 PM   PM User | #6
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,355
Thanks: 3
Thanked 458 Times in 445 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
the menu is configared in content.js

the most important cofig option have been commented

Code:
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'
					)
	);
__________________
Vic

God Loves You and will never love you less.

http://www.vicsjavascripts.org.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is offline   Reply With Quote
Users who have thanked vwphillips for this post:
tom.newsome (11-10-2010)
Old 11-10-2010, 02:12 PM   PM User | #7
tom.newsome
New to the CF scene

 
Join Date: Nov 2010
Location: Huddersfield, UK
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
tom.newsome is an unknown quantity at this point
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
tom.newsome is offline   Reply With Quote
Old 11-10-2010, 02:22 PM   PM User | #8
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Quote:
Originally Posted by tom.newsome View Post
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?
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Last edited by Kor; 11-10-2010 at 03:04 PM..
Kor is offline   Reply With Quote
Old 11-10-2010, 02:22 PM   PM User | #9
connollyc4
New Coder

 
Join Date: Mar 2010
Location: New Jersey USA
Posts: 74
Thanks: 11
Thanked 4 Times in 4 Posts
connollyc4 is an unknown quantity at this point
Quote:
Originally Posted by tom.newsome View Post

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?
connollyc4 is offline   Reply With Quote
Old 11-10-2010, 02:25 PM   PM User | #10
Afro_Programmer
Regular Coder

 
Join Date: Sep 2010
Location: Virginia
Posts: 112
Thanks: 11
Thanked 7 Times in 7 Posts
Afro_Programmer is an unknown quantity at this point
Quote:
Originally Posted by connollyc4 View Post
I thought BlueJ was used for Java?
Doesn't matter. Once you know one, you know them all.
Afro_Programmer is offline   Reply With Quote
Old 11-10-2010, 02:46 PM   PM User | #11
connollyc4
New Coder

 
Join Date: Mar 2010
Location: New Jersey USA
Posts: 74
Thanks: 11
Thanked 4 Times in 4 Posts
connollyc4 is an unknown quantity at this point
Quote:
Originally Posted by tom.newsome View Post
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
Code:
' Business Link', 'businesslink.htm'
To
Code:
 ' 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



Quote:
Also can I add a new item to a drop down menu?
Yes, Like so.
Code:
' 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

Last edited by connollyc4; 11-10-2010 at 03:14 PM..
connollyc4 is offline   Reply With Quote
Users who have thanked connollyc4 for this post:
tom.newsome (11-24-2010)
Old 11-24-2010, 03:55 PM   PM User | #12
tom.newsome
New to the CF scene

 
Join Date: Nov 2010
Location: Huddersfield, UK
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
tom.newsome is an unknown quantity at this point
Code:
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 is offline   Reply With Quote
Old 11-24-2010, 03:58 PM   PM User | #13
tom.newsome
New to the CF scene

 
Join Date: Nov 2010
Location: Huddersfield, UK
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
tom.newsome is an unknown quantity at this point
sack that i found the error lol schoolboy mistake, sorry guys should work now!
tom.newsome is offline   Reply With Quote
Old 11-24-2010, 04:15 PM   PM User | #14
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Quote:
Originally Posted by tom.newsome View Post
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
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 01-25-2011, 02:45 PM   PM User | #15
tom.newsome
New to the CF scene

 
Join Date: Nov 2010
Location: Huddersfield, UK
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
tom.newsome is an unknown quantity at this point
changing where the menu displays

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.
tom.newsome is offline   Reply With Quote
Reply

Bookmarks

Tags
beginners, drop down, web design

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:16 PM.


Advertisement
Log in to turn off these ads.