/    Sign up×
Community /Pin to ProfileBookmark

Javascript navigation bar problems!

? As a newbie, am trying to create an animated horizontal navigation bar with Xara Webstyle 3, but am having problems with it.

I have created the navigation bar, but there are 2 drop-down lists which are not attached to the navigation bar. These lists seem to display in different parts of the page depending on how far down I scroll on the page. So I am just trying to fix the drop-down lists underneath the navigation bar on mouse-over.

I have 2 .js files plus the .gif images. The one .js file is below, and I have changed the actual URL to ‘temp’ for ease of use here. Have tried to search on the web, but cannot find details about it due to me still learning about Javascript:-

if(typeof(loc)==”undefined”||loc==””){var loc=””;if(document.body&&document.body.innerHTML){var tt=document.body.innerHTML.toLowerCase();var last=tt.indexOf(“navbar.js””);if(last>0){var first=tt.lastIndexOf(“””,last);if(first>0&&first<last)loc=document.body.innerHTML.substr(first+1,last-first-1);}}}

var bd=0
document.write(“<style type=”text/css”>”);
document.write(“n<!–n”);
document.write(“.navbar_menu {z-index:999;border-color:#000000;border-style:solid;border-width:”+bd+”px 0px “+bd+”px 0px;background-color:#730f53;position:absolute;left:0px;top:0px;visibility:hidden;}”);
document.write(“.navbar_plain, a.navbar_plain:link, a.navbar_plain:visited{text-align:left;background-color:#730f53;color:#ffffff;text-decoration:none;border-color:#000000;border-style:solid;border-width:0px “+bd+”px 0px “+bd+”px;padding:2px 0px 2px 0px;cursor:hand;display:block;font-size:7pt;font-family:Arial, Helvetica, sans-serif;}”);
document.write(“a.navbar_plain:hover, a.navbar_plain:active{background-color:#f9d602;color:#000000;text-decoration:none;border-color:#000000;border-style:solid;border-width:0px “+bd+”px 0px “+bd+”px;padding:2px 0px 2px 0px;cursor:hand;display:block;font-size:7pt;font-family:Arial, Helvetica, sans-serif;}”);
document.write(“n–>n”);
document.write(“</style>”);

var fc=0x000000;
var bc=0xf9d602;
if(typeof(frames)==”undefined”){var frames=0;}

startMainMenu(“navbar_left.gif”,19,6,2,0,0)
mainMenuItem(“navbar_b1″,”.gif”,19,125,”temp”,””,”Home”,2,2,”navbar_plain”);
mainMenuItem(“navbar_b2″,”.gif”,19,125,”temp”,””,”Services”,2,2,”navbar_plain”);
mainMenuItem(“navbar_b3″,”.gif”,19,125,”javascript:;”,””,”Location”,2,2,”navbar_plain”);
mainMenuItem(“navbar_b4″,”.gif”,19,125,”javascript:;”,””,”Type”,2,2,”navbar_plain”);
mainMenuItem(“navbar_b5″,”.gif”,19,125,”temp”,””,”Terms & Conditions”,2,2,”navbar_plain”);
mainMenuItem(“navbar_b6″,”.gif”,19,125,”temp”,””,”Contact Us”,2,2,”navbar_plain”);
endMainMenu(“navbar_right.gif”,19,6)

startSubmenu(“navbar_b4″,”navbar_menu”,125);
submenuItem(“1″,”temp”,””,”navbar_plain”);
submenuItem(“2″,”temp”,””,”navbar_plain”);
submenuItem(“3″,”temp”,””,”navbar_plain”);
submenuItem(“4″,”temp”,””,”navbar_plain”);
submenuItem(“5″,”temp”,””,”navbar_plain”);
endSubmenu(“navbar_b4”);

startSubmenu(“navbar_b3″,”navbar_menu”,125);
submenuItem(“6″,”temp”,””,”navbar_plain”);
submenuItem(“7″,”temp”,””,”navbar_plain”);
submenuItem(“8″,”temp”,””,”navbar_plain”);
submenuItem(“9″,”temp”,””,”navbar_plain”);
submenuItem(“10″,”temp”,””,”navbar_plain”);
submenuItem(“11″,”temp”,””,”navbar_plain”);
endSubmenu(“navbar_b3”);

loc=””;

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @KlingonBatleth spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.8,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...