Pages: [1]
Print
Author Topic: Java Script Help  (Read 770 times)
0 Members and 1 Guest are viewing this topic.
yourweb
Global Moderator
General
*****

Karma: +10/-0
Offline Offline

Posts: 10777



View Profile WWW
« on: September 14, 2009, 03:57:43 AM »

I need help with Java Script. I was wondering if any body would have a file that they could send my way that would have the code in it already for a menu. I need it to go vertical. It has been driving me nuts.
Logged

YourWeb.Info Shopping Mall is the friendliest on the net! -
BuyingFirstTime Real Estate Agent Directory
Seo'ers - UK SEO, Internet Marketing and Webmaster Forums
« on: September 14, 2009, 03:57:43 AM »

Recommended SEOers Resources

3 months free Web Hosting from 123-reg!
 Logged
yourweb
Global Moderator
General
*****

Karma: +10/-0
Offline Offline

Posts: 10777



View Profile WWW
« Reply #1 on: September 14, 2009, 12:42:59 PM »

this also could be a css file
Logged

YourWeb.Info Shopping Mall is the friendliest on the net! -
BuyingFirstTime Real Estate Agent Directory
Matt Inertia
General
*****

Karma: +33/-1
Offline Offline

Posts: 2026


S.E.Oooooh Yeah!


View Profile WWW
« Reply #2 on: September 14, 2009, 01:50:58 PM »

Have you made sure the <li> styling in CSS has float:left or right in it?
Logged

My Freelance SEO Site - My Favourite Client - Online Game Publishers - My Latest Site - Plumber In Lancaster - I'm blogging here: SearchQuest SEO Blog
caravan
Global Moderator
Major
*****

Karma: +10/-0
Offline Offline

Posts: 589



View Profile WWW
« Reply #3 on: September 14, 2009, 02:26:49 PM »

Do I understand you correctly that you are looking for a vertical drop down menu? Have you tried position is everything? I think this is the one I tend to us

http://www.positioniseverything.net/css-flyout.html

or

http://www.positioniseverything.net/css-dropdowns.html

They always take a bit of configuring to sort out
Logged

yourweb
Global Moderator
General
*****

Karma: +10/-0
Offline Offline

Posts: 10777



View Profile WWW
« Reply #4 on: September 14, 2009, 03:25:26 PM »

I am not looking for a drop down menu at this point. I want to keep the same menu setup I have but I want to put it in java script so that I can change it when I want to and have the rest of the site update at the same time. I don't want to keep on having to go into each page of the site and make that change. One file, one change, done all at once.
Logged

YourWeb.Info Shopping Mall is the friendliest on the net! -
BuyingFirstTime Real Estate Agent Directory
caravan
Global Moderator
Major
*****

Karma: +10/-0
Offline Offline

Posts: 589



View Profile WWW
« Reply #5 on: September 14, 2009, 03:39:00 PM »

Sounds like you want to use an include file. That way all pages reference the one instance of your navigation so any updates to the navigation are made to the one file and the change then ripples through the site. Presuming you're using php I'd use the following:

Code:
<?php include("PATH_TO_NAVIGATION_FILE.php"); ?>

Alternatively if you want to use javascript you can use

Code:
function menuContent() {
var menuStr = "";

menuStr = menuStr + "<ul>";
menuStr = menuStr + "<li><a href='/LINK1.html'>Link 1</a></li>";
menuStr = menuStr + "<li><a href='/LINK2.html'>Link 2</a></li>";
menuStr = menuStr + "<li><a href='/LINK3.html'>Link 3</a></li>";
menuStr = menuStr + "<li><a href='/LINK4.html'>Link 4</a></li>";
menuStr = menuStr + "<li><a href='/LINK5.htmlp'>Link 5</a></li>";
menuStr = menuStr + "<li><a href='/LINK6.html'>Link 6</a></li>";
menuStr = menuStr + "</ul>";

document.write(menuStr);
}

This code would be help in an external file and referenced in the html code with:

Code:
<script src="scripts/menu.js" language="javascript"></script>
<script language="javascript">
menuContent();
</script>

My preference would be to go for the include file for search engine reasons. Hope this helps.
Logged

yourweb
Global Moderator
General
*****

Karma: +10/-0
Offline Offline

Posts: 10777



View Profile WWW
« Reply #6 on: September 16, 2009, 03:22:48 AM »

That kind of looks like what I am looking for. Thanks. Now to find the time to test it out. Thanks again.
Logged

YourWeb.Info Shopping Mall is the friendliest on the net! -
BuyingFirstTime Real Estate Agent Directory
yourweb
Global Moderator
General
*****

Karma: +10/-0
Offline Offline

Posts: 10777



View Profile WWW
« Reply #7 on: September 17, 2009, 11:32:48 PM »

Thanks caravan. I tested that script out on the site.

I now have another problem that, that script has added to the site.

http://www.psychpa.com/

This is the site where I am using that script on. I believe you will see the problem the first time you go to that site. The script now will show that column where the script has been placed as 100 percent of the site and than go back down to where it is suppose to be.

Is there a command that can be added to the script to make it 130 wide like the column is?

I also took out the < ul > < li > code. Did not need it indented like that. I had to add < br > code to the script to get separate lines for each link. Is there a different code that could be used in the script to achieve this?

Also can you have a mouse over I think it is called and get rid of the underlines under each link?
Logged

YourWeb.Info Shopping Mall is the friendliest on the net! -
BuyingFirstTime Real Estate Agent Directory
yourweb
Global Moderator
General
*****

Karma: +10/-0
Offline Offline

Posts: 10777



View Profile WWW
« Reply #8 on: September 24, 2009, 02:30:03 PM »

Is there any other scripts that one could put on one's site that would be useful? I have gone script happy.
Logged

YourWeb.Info Shopping Mall is the friendliest on the net! -
BuyingFirstTime Real Estate Agent Directory
Seo'ers - UK SEO, Internet Marketing and Webmaster Forums
« Reply #8 on: September 24, 2009, 02:30:03 PM »

Recommended SEOers Resources

3 months free Web Hosting from 123-reg!
 Logged
caravan
Global Moderator
Major
*****

Karma: +10/-0
Offline Offline

Posts: 589



View Profile WWW
« Reply #9 on: September 25, 2009, 02:26:42 PM »

Not sure as the html code uses tables rather than divs and it's years since I used tables. You could try adding a class to the table and give it a width of 130px. Why are you using tables to layout the page as well as a javascript menu?
Logged

caravan
Global Moderator
Major
*****

Karma: +10/-0
Offline Offline

Posts: 589



View Profile WWW
« Reply #10 on: September 25, 2009, 02:27:16 PM »

or maybe add a width value to the td cell
Logged

yourweb
Global Moderator
General
*****

Karma: +10/-0
Offline Offline

Posts: 10777



View Profile WWW
« Reply #11 on: September 25, 2009, 03:40:22 PM »

Not sure as the html code uses tables rather than divs and it's years since I used tables. You could try adding a class to the table and give it a width of 130px. Why are you using tables to layout the page as well as a javascript menu?

That is how I first learned to write code.

I do have set width on that side of the page. I have messed around with it more and more. Just a matter of time until I can it working the way I think it should work. Thanks for the help again.
Logged

YourWeb.Info Shopping Mall is the friendliest on the net! -
BuyingFirstTime Real Estate Agent Directory
Pages: [1]
Print
Jump to:  


Related Topics
Subject Started by Replies Views Last post
PHP Poll Script
Website design and development
ash 6 252 Last post December 20, 2006, 03:49:31 PM
by yourweb
PHP - Rotation script « 1 2 »
Website design and development
ash 26 700 Last post January 23, 2007, 07:56:10 AM
by ash
Script Download Section
Forum News, Feedback and Suggestion Box
MuNKy 14 459 Last post January 04, 2007, 07:46:56 PM
by yourweb
is java is completely oops
Website design and development
hkp819 1 144 Last post August 20, 2010, 10:46:37 AM
by sandy_joy
whats better to use html or java?
Website design and development
jeena1 0 418 Last post March 02, 2009, 08:09:22 AM
by jeena1