DHTML Menu help - Page 6 - Post ID 81791

User 13379 Photo


Ambassador
37 posts

Thank You very much Bill ... I will try all them in the morning ..was just shutting down it's 0100 here ..
Well I am only basically a learner but I like to play but have not the knowledge for javascripting but I saw your site and like it so any info is warmly received ...
BTW I am a bit long in the tooth and still learning ........
User 13379 Photo


Ambassador
37 posts

decided to have a little play first ..

Brian
User 13379 Photo


Ambassador
37 posts

OK Bill made the changes local will now upload seems the the menu becomes vertical
and move to the far right and extensions show om the main frame ...will go and upload now .....

Brian
User 13379 Photo


Ambassador
37 posts

Ok Bill it is now0145 and i'm now off to bed ...I like your Idea of the javascript and no frames so if you would like to send the info for me to try I would be grateful and my email is
brianbrain@adam.com.au
and thanks for the help ......bye for now .....
User 355448 Photo


Ambassador
3,144 posts

Brian,

To make the DHTML menu a javascript file, start by deleting everything above the line:
function Go(){return}

With that as your first line of the menu code, go to the bottom and make:
function AfterCloseAll(){return}

the bottom line of the menu, and save what remains as something like bsals_menu.js (I just used the initials from your site).

Edit the menu code. You will a line that reads:
var TargetLoc=''; // span id for relative positioning
change it to read:
var TargetLoc='themenu'; // span id for relative positioning

Now save that file with code like this:

<span id="themenu">
<SCRIPT type="text/javascript" SRC="bsals_menu.js"></SCRIPT>
</span>

After I finish writing this paper, I will get back with you and see what additional help you want.
User 13379 Photo


Ambassador
37 posts

Hi Bill I put the modified files up on the system for you to browse
so here is the js and the index page I thought might work had a bit of a play, it but didn't
so onward and upward
and in the meantime I may have to get my Java for idiots book out.
and learn a lot more
I also did some cheating and had a look at your source code and used it on the index page ..
<div id="nav">
<!-- Top navigation bar insert -->

<span id="themenu">
<SCRIPT type="text/javascript" SRC="bsals_menu.js"></SCRIPT>
</span>


http://www.adam.com.au/brianbrain/bsals_menu.js
http://www.adam.com.au/brianbrain/index.html
User 355448 Photo


Ambassador
3,144 posts

Brian,

Sorry about my previous directions for the javascript file. Remove the last two lines of code and you have the correct javascript. I failed to notice the second identical function line of code.

The very last four lines in your menu javascript should be:

function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}

For now, you should leave your index.html page as it is.

Open your intro.htm file and save it as new_index.html and add the menu code to it using the span code in your message. Also add your logo code. Now upload that to your server, and see how it works.
User 13379 Photo


Ambassador
37 posts

Hi Bill
made the suggested adjustments and the menu came up in the middle so I went in and changed the menu for it to go to the top....seems to work ok.
now all one has to do is the adjustment to stop the mne disappearing when one clicks on the menu to page change .....
W3c Mark passed ok ...
changed for fun (well trying)
var ChildOverlap=1; // horizontal overlap child/ parent
var ChildVerticalOverlap=1; // vertical overlap child/ parent
and now get a almost straight vertical menu drop ..I am learning a little ....
User 355448 Photo


Ambassador
3,144 posts

Brian,

Unless you are using positioning, the order of your HTML is the order you see on the page. I code my page masthead with an <h1> tag, logo, etc. Then I put my menu code and since I have a horizontal menu, it is immediately under the masthead.

When I have used a vertical menu, I set a div that was just a little wider than the menu and put the menu in that div. That worked great for putting my menus where I wanted them. Just one of the many different ways of programming your pages.

As you learn, you will find some things that you feel comfortable with and others that are not what you like. Just stick with what you like and have fun.
User 13379 Photo


Ambassador
37 posts

Thanks Bill
I will continue on my Journey of discovery ...doing ok for an oldie 71 .........

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.