Log in

View Full Version : a scrolling menu question



pdsok
11-07-2007, 04:34 PM
Hi,
I am currently using a scrolling menu which is a floating div see here (http://tstiger.org.uk/index1.htm) oops, corrected url
I now find that I want to change the menu content fairly often and there are 20 odd pages, so it is a bit long winded. would it be easy to make a floating iframe or some-such so that I can use a src="???.htm" so that i only need to change the 1 page

I am not asking for you to do it for me, just give me some idea if it is fairly straight forward for a dabbler like myself. (rest assured I will be asking for advice when i can't quite get it right) :)

thanks in advance

PdS

molendijk
11-07-2007, 11:44 PM
Here's one of the (many!) ways to do it.
1) Create a file called 'menu.html' and put your menu in it (without the styles and javascript needed for the menu to function properly!!).
2) Put this in the body part of every page:
<iframe name="iframe" src="menu.html" style="width:0px;height:0px" frameborder="0"></iframe>
<div id="loader" ></div>
In the head section of every page, put also all the styles and javascript needed for the menu to function properly.
3) Finally, also put this in the head section of every page:
<script>
function callmenu()
{document.getElementById('loader').innerHTML = frames['iframe'].document.body.innerHTML;}
window.onload=callmenu
</script>

This will write your menu to every page. Any change of the menu will be visible on every page.

As for the floating, I don't know where you've put it. It's probably part of the styles you have to put in the head section of every page.

Arie Molendijk.

pdsok
11-08-2007, 03:31 PM
sorry the link was not correct, the menu page auto loads after 10 seconds or so. I sent you to just the index page.correct link (http://tstiger.org.uk/index1.htm)

ok, I think I see where you are going with this,
but would it be ok for me just to iframe the table part of my menu and use menu.htm as the src for that iframe?

is this a proper way of doing it or could i be making trouble for myself.

The code for the menu is towards the bottom of the source page

molendijk
11-08-2007, 07:54 PM
Yes, you could try that, although I'm not sure whether the floating of the menu will be preserved.

Arie M.

pdsok
11-13-2007, 12:41 PM
:)
I tried that and (eventually) got it to work thanks for that my friend, makes life a lot easier