View Full Version : trouble with a dynamic drive script!!!HELP!!


rinoa_heartily
04-05-2003, 02:33 AM
this is the script i chose:


<script language="JavaScript" src="navcond.js"></script>
<script language="JavaScript">

/*
Top Navigational Bar II (By Mike Hall)
Last updated: 00/05/08
Permission granted and modified by Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var myNavBar1 = new NavBar(0);
var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub category width in pixels)
//add more menus simply by adding more "blocks" of same code below

dhtmlMenu = new NavBarMenu(100, 0);
dhtmlMenu.addItem(new NavBarMenuItem("Home", "http://dynamicdrive.com"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 120);
dhtmlMenu.addItem(new NavBarMenuItem("News", ""));
dhtmlMenu.addItem(new NavBarMenuItem("CNN", "http://www.cnn.com"));
dhtmlMenu.addItem(new NavBarMenuItem("MSNBC", "http://msnbc.com"));
dhtmlMenu.addItem(new NavBarMenuItem("ABCNews", "http://www.abcnews.com"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(110, 120);
dhtmlMenu.addItem(new NavBarMenuItem("Technology", ""));
dhtmlMenu.addItem(new NavBarMenuItem("News.com", "http://www.news.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Techweb", "http://www.techweb.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Wired", "http://www.wired.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Dynamic Drive", "http://www.dynamicdrive.com"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Search", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Yahoo", "http://www.yahoo.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Alta Vista", "http://www.altavista.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Infoseek", "http://www.infoseek.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Excite", "http://www.excite.com"));
dhtmlMenu.addItem(new NavBarMenuItem("HotBot", "http://www.hotbot.com"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 150);
dhtmlMenu.addItem(new NavBarMenuItem("Webmaster", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Dynamic Drive", "http://dynamicdrive.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Website Abstraction", "http://wsabstract.com"));
dhtmlMenu.addItem(new NavBarMenuItem("Freewarejava.com", "http://freewarejava.com"));
dhtmlMenu.addItem(new NavBarMenuItem("BrainJar", "http://brainjar.com"));
myNavBar1.addMenu(dhtmlMenu);

//set menu colors
myNavBar1.setColors("#000000", "#000000", "#C0C0C0", "#ffffff", "#666666", "#000000", "#cccccc", "#ffffff", "#000080")

//uncomment below line to center the menu (valid values are "left", "center", and "right"
//myNavBar1.setAlign("center")

var fullWidth;

function init() {

// Get width of window, need to account for scrollbar width in Netscape.

fullWidth = getWindowWidth()
- (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);

myNavBar1.resize(fullWidth);
myNavBar1.create();
myNavBar1.setzIndex(2);
//UNCOMMENT BELOW LINE TO MOVE MENU DOWN 50 pixels
//myNavBar1.moveTo(0, 50);
}
</script>

i did everything but i was wondering if someone could tell me how i target the links to my iframe!!!

help please!!

co0kied0ugh
04-05-2003, 02:51 AM
dhtmlMenu.addItem(new NavBarMenuItem("CNN", "http://www.cnn.com"target="iframe" ));
dhtmlMenu.addItem(new NavBarMenuItem("MSNBC", "http://msnbc.com"target="iframe"));

Just like normal. Just put target="iframe" inside links to make them target to different things

rinoa_heartily
04-05-2003, 02:56 AM
er.......................it didn't work!

do i put "iframe"?
or the name of the frame i want it to target to???

co0kied0ugh
04-05-2003, 03:12 AM
Just put the name of the iframe you want to target ^_^

rinoa_heartily
04-05-2003, 03:13 AM
okay thanks!

rinoa_heartily
04-05-2003, 03:36 AM
uhh now it doesn't even show up at all!!!

hmm.......WHAT'S WRONG WITH IT?????LOL!

darn it!!

Alcy
04-05-2003, 03:54 AM
Doesn't it say on dynamic drive ^^;;?
http://www.dynamicdrive.com/dynamicindex1/topnavbar.htm

dhtmlMenu.addItem(new NavBarMenuItem("Dynamic Drive", "javascript:parent.framename.location='http://dynamicdrive.com'
"));

I don't know why it adds that space in javascript :/

rinoa_heartily
04-05-2003, 03:57 AM
okay i'll try it then!^^

rinoa_heartily
04-05-2003, 04:02 AM
okay!
all i have to do now is fix it up!
thanx soo much!!!!!!!!!!!!!!!!!!!^.^

rinoa_heartily
04-06-2003, 03:10 AM
i fixed it but now it doesn't show up!!!!!
what am i doing wrong now?:

<body>
<head>
<TITLE>---+O n e S k y, O n e D e s t i n y+---</TITLE>
<html>
</head>
<body onload="init()">
<script language="JavaScript" src="navcond.js"></script>
<script language="JavaScript">

/*
Top Navigational Bar II (By Mike Hall)
Last updated: 00/05/08
Permission granted and modified by Dynamicdrive.com to include script in archive
For this and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var myNavBar1 = new NavBar(0);
var dhtmlMenu;

//define menu items (first parameter of NavBarMenu specifies main category width, second specifies sub category width in pixels)
//add more menus simply by adding more "blocks" of same code below

dhtmlMenu = new NavBarMenu(100, 0);
dhtmlMenu.addItem(new NavBarMenuItem("Main", "javascript:parent.frame.location=''"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 130);
dhtmlMenu.addItem(new NavBarMenuItem("About", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Formation of Kingdom Hearts", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("The Story", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("The characters", "javascript:parent.frame.location=''"));
myNavBar1.addMenu(dhtmlMenu);



dhtmlMenu = new NavBarMenu(100, 160);
dhtmlMenu.addItem(new NavBarMenuItem("Gallery", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Screenshots", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Charector Art", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Charector Renders", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("World Art", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Wallpapers", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Secret Ending Shots", "javascript:parent.frame.location=''"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 140);
dhtmlMenu.addItem(new NavBarMenuItem("Music", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Mp3's", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem(MIDI's", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Lyrics", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Utada Hikaru", "javascript:parent.frame.location=''"));
myNavBar1.addMenu(dhtmlMenu);


dhtmlMenu = new NavBarMenu(100, 140);
dhtmlMenu.addItem(new NavBarMenuItem("miscellanius", ""));
dhtmlMenu.addItem(new NavBarMenuItem("Animated GIFS", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Avatars", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Deep Dive Theories", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Official Sites", "javascript:parent.frame.location=''"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 130);
dhtmlMenu.addItem(new NavBarMenuItem("Interaction", ""));
dhtmlMenu.addItem(new NavBarMenuItem("tagboard", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Guest Book", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Poll", "javascript:parent.frame.location=''"));
myNavBar1.addMenu(dhtmlMenu);

dhtmlMenu = new NavBarMenu(100, 140);
dhtmlMenu.addItem(new NavBarMenuItem("Site", ""));
dhtmlMenu.addItem(new NavBarMenuItem("About the site", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Affiliates", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Affiliation", "javascript:parent.frame.location=''"));
dhtmlMenu.addItem(new NavBarMenuItem("Link me", "javascript:parent.frame.location=''"));
myNavBar1.addMenu(dhtmlMenu);


//set menu colors
myNavBar1.setColors("#000000", "#000000", "#C0C0C0", "#ffffff", "#666666", "#000000", "#cccccc", "#ffffff", "#000080")

//uncomment below line to center the menu (valid values are "left", "center", and "right"
//myNavBar1.setAlign("center")

var fullWidth;

function init() {

// Get width of window, need to account for scrollbar width in Netscape.

fullWidth = getWindowWidth()
- (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);

myNavBar1.resize(fullWidth);
myNavBar1.create();
myNavBar1.setzIndex(2);
//UNCOMMENT BELOW LINE TO MOVE MENU DOWN 50 pixels
//myNavBar1.moveTo(0, 50);
}
</script>
<div style="position: absolute; top:60; left:424">
<IFRAME src="http://www.geocities.com/onesky_onedestiny/main.htm" name="frame" width="346" height="351" frameborder="0"></IFRAME></div>
<BODY BACKGROUND="http://www.freewebs.com/onesky_onedestiny/backround_for_webbie.jpg">
</html>
</body>


hmm........

Alcy
04-06-2003, 04:50 AM
You need to add the url....

dhtmlMenu.addItem(new NavBarMenuItem("Utada Hikaru", "javascript:parent.frame.location='PAGE.HTML'"));

Umm... pretend that javascript is one word :P

rinoa_heartily
04-06-2003, 01:23 PM
yeah i tried that but it didn't work still!!!!!!!!!!!!!!!!
it didn't even SHOW!!LOL!

Alcy
04-08-2003, 02:06 AM
Did you download the zip file?

rinoa_heartily
04-08-2003, 05:16 AM
it works now!!!!!!

i just did something like remove the space in javascript and it works!!!!!!!

Avi
05-28-2003, 09:09 PM
hi

I use the same JS code, and I would like one of those menu options to open a different browser window. can you please assist?

Avi

Alcy
05-30-2003, 01:54 AM
If you change the framename to a non-existant frame, the link will open in a new window.... but as for modifying the actual script, I have no idea.