Log in

View Full Version : navigation iframe help?



Nailgunpro
04-07-2008, 09:29 PM
Hello, and thanks for the help in advance.

I am using the Dynamic Drive Chrome Drop Down Menu (http://www.dynamicdrive.com/dynamicindex1/chrome/index.htm) and I want to edit all of my navigation at once so I use the following code:

<script type="text/javascript">
document.write('<iframe name="menu" src="menu.html" style="position:absolute; left:-10000px; display:none;width:0px;height:0px" frameborder="0"></iframe>');
function extractMenuFromIframe(){
document.body.innerHTML+=frames['menu'].document.body.innerHTML}
window.onload=extractMenuFromIframe;
</script>
(http://molendijk.110mb.com/include_menu6/suckertree1.html)
The problem is that to use the chrome menu i have to use some css and some scripts for it to do anything. the iframe acts as if those don't exist, and it shows it plain, no drop down or anything.
How could I get it to show?
Thanks,
Nailgun

molendijk
04-07-2008, 10:17 PM
You should put chrome.js and chromestyle.css (and possibly the gifs as well) AFTER the script, in each page containing the script.
So:
- the script (extractMenuFromIframe);
- chrome.js and chromestyle.css

You can insert js-files and css-files in the standard way. If you don't know how to do that, let me know. (It's very simple indeed).
----
Arie Molendijk.

Nailgunpro
04-08-2008, 10:02 PM
Thanks, But i found out that with a regular iframe no border or scrolling it works just fine. Sorry for the trouble.

Nailgunpro
04-08-2008, 10:16 PM
Since I'm using this for my navigation, is there a way to make clicked links open in the actual window and not the frame???

molendijk
04-08-2008, 11:23 PM
Since I'm using this for my navigation, is there a way to make clicked links open in the actual window and not the frame???The normal way of targeting the (main) window containing an iframe is (in the iframe): 'href="bla.html" target="_top"'. But since I don't have the source of your pages, I don't know if that is what you need.
---
Arie.