Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Location
    Huddersfield, UK
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,027
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    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.

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    No chance. Either you learn JavaScript, or you give up. See also:
    Need opinion on drop down navigation (usability etc) and possible code optimization
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #4
    New to the CF scene
    Join Date
    Nov 2010
    Location
    Huddersfield, UK
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,027
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    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.

  • #6
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,511
    Thanks
    3
    Thanked 504 Times in 491 Posts
    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/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • Users who have thanked vwphillips for this post:

    tom.newsome (11-10-2010)

  • #7
    New to the CF scene
    Join Date
    Nov 2010
    Location
    Huddersfield, UK
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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?
    Last edited by Kor; 11-10-2010 at 03:04 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #9
    New Coder
    Join Date
    Mar 2010
    Location
    New Jersey USA
    Posts
    81
    Thanks
    13
    Thanked 4 Times in 4 Posts
    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?

  • #10
    Regular Coder
    Join Date
    Sep 2010
    Location
    Virginia
    Posts
    112
    Thanks
    11
    Thanked 7 Times in 7 Posts
    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.

  • #11
    New Coder
    Join Date
    Mar 2010
    Location
    New Jersey USA
    Posts
    81
    Thanks
    13
    Thanked 4 Times in 4 Posts
    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



    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.

  • Users who have thanked connollyc4 for this post:

    tom.newsome (11-24-2010)

  • #12
    New to the CF scene
    Join Date
    Nov 2010
    Location
    Huddersfield, UK
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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

  • #13
    New to the CF scene
    Join Date
    Nov 2010
    Location
    Huddersfield, UK
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    sack that i found the error lol schoolboy mistake, sorry guys should work now!

  • #14
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #15
    New to the CF scene
    Join Date
    Nov 2010
    Location
    Huddersfield, UK
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •