Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:20

IFRAMES issue


Poster: fredlongworthhighschool
Dated: Tuesday August 12 2003 - 10:25:10 BST

I don't think this is a MM coding problem, just general HTML. I've uploaded the tests I'm doing with V5 so you can see the problem I'm having:

http://www.flhs.org.uk/v5test

Only 'Heads intro' and 'accreditations' in the ABOUT section work at present.

The problem is to do with the scroll bars. Ideally, it would be great if the menu bar stayed at the top of the screen, but its not essential.

I'm not sure which is the best way to go about things. My site currently uses V3 frames but I want to get it over to V5 ASAP, but I don't know whether to:

Use IFRAMES
Wait to see if a FRAMES version is created
Use a third alternative

I'd welcome any suggestions from you all.

Thanks.

Andy


Poster: Andy
Dated: Tuesday August 12 2003 - 11:21:28 BST

There's no contest. Ditch the Frames ;)

I've always hated frames and unfortunately the v5 frames based menu is not yet on our list of priorities.

There are many advantages to having a non-framed site and if you use PHP or ASP you can put headers in all your pages that will do the same job as frames.

Cheers
Andy


Poster: fredlongworthhighschool
Dated: Tuesday August 12 2003 - 11:39:32 BST

I've tried this, adding a #include routine on every page to call a HTM file with the two JS files in it, but it just doesn't work.


Poster: fredlongworthhighschool
Dated: Tuesday August 12 2003 - 11:41:46 BST

If I preview it in Dreamweaver, it works fine. But when I try it out of Dreamweaver, it doesn't.

Will it only work if it has been uploaded to a website?


Poster: Hergio
Dated: Tuesday August 12 2003 - 13:43:07 BST

Are you using IIS? If you are, you should stop using .htm files and make them .asp files. Then you can do the <!--#include virtual='banner.asp' --> stuff and make your life easier. If thats what you're trying to do, then yeah it won't work unless the pages are on your server, becuase ASP is a server side language and needs to be parsed by IIS. If you can get IIS running on your test machine (win2000,xp have it) you can test it there and the ASP will render.

p.s. I agree with Andy...frames bad, me no like frames.


Poster: fredlongworthhighschool
Dated: Tuesday August 12 2003 - 13:52:45 BST

Hmm, that would make things really difficult for running it locally. We do have an internal webserver running 2000 Server and I am currently working on an XP Pro machine. IIS appears to be active, but I'm still not getting anything.

Did you manage to sort out the IFRAME scrolling problem you were having?


Poster: Hergio
Dated: Tuesday August 12 2003 - 15:38:36 BST

Well if you can get it going, definetly consider trying to use includes...it will make your life alot easier. Regarding the scrolling problem, I found this example that seems to work. Its basically the iframe telling its parent what its size is and then the parent resizing the iframe on the fly. Give it a try. http://www.milov.nl/forum/1/1767 I am about to too.


Poster: fredlongworthhighschool
Dated: Wednesday August 13 2003 - 10:59:15 BST

I've had a look at it, but it doesn't seem very clear where to implement each bit of code and in what file.

My 'main' page containing the menu system and title page is called DEFAULT.HTM and then I have lots of other pages sorted into folders. For sake of argument, lets just call them PAGE1.HTM, PAGE2.HTM and so on.

From here can you explain where in each file the code from that site goes?


Poster: Hergio
Dated: Wednesday August 13 2003 - 15:13:14 BST

Ok, give this a try:
your PAGE1 and PAGE2 files should have a BODY tag that looks like:
Code:
<body style="margin:0;border:0;" scroll="no">

This way, when it renders in the iframe, it will look its best. Then at the bottom of your PAGE1 and PAGE2 pages, right before the </BODY> tag, put this...
Code:
<script DEFER>parent.resizeMe(self.name,document.body.scrollWidth,document.body.scrollHeight)</script>

This will tell the page to look to its parent, and call the resizeMe function thats defined in its parent, and its passes its name and its dimensions so the parent can resize the iframe accordingly.
Then in your main page, DEFAULT, which has the iframe tags, put into your head section...
Code:
<script>
function resizeMe(sFrame,iX,iY) {
   obj = document.all[sFrame].style;
   obj.width = iX;
   obj.height = iY;   
}
</script>

Now I am unsure as to how the child page (your PAGE1 and PAGE2) will react if its not inside of another page, which very well may happen. But try it, and if it gives you an error because it cant find its parent, or the function of its parent, put the 'parent.resizeMe...' code in a try/catch block so it doesn't matter if the page is loaded in an iframe or not. Best of luck.


Poster: fredlongworthhighschool
Dated: Wednesday August 13 2003 - 15:38:14 BST

No, didn't work. There was a little bit of scrolling but an error.

I don't know what you mean about 'try/catch' block.

I've uploaded my working code to

http://www.flhs.wigan.sch.uk/v5test/

The page with the frame modifications is in ABOUT..OUR ACCREDITATIONS


Poster: Hergio
Dated: Wednesday August 13 2003 - 15:51:46 BST

Ok first, put that resizeme function declaration in the head of your default.htm page. Thats part of the reason you're getting an error, because accreditations page is trying to find 'resizeMe' and can't. You can put it in there, it wont hurt the other pages that work fine cuz they dont call for it.

A try/catch block is a way in javascript to try to do something and if it errors out, you can catch it so it doesn't cause your whole page to fail. So in your about/accreditations.htm page, put this at the bottom of your page right before the </body>
Code:
<script>
try{
  parent.resizeMe(self.name,document.body.scrollWidth,document.body.scrollHeight);
}catch(e){ //do nothing
}
</script>


Poster: Hergio
Dated: Wednesday August 13 2003 - 17:02:39 BST

I see you're already trying some of the changes...occassionally I will refresh and see some stuff. But one thing I noticed, make sure the ID and the NAME of the iframe are the same. Because the frame will pass its name to the function and the function will take that name and try to use it as the ID, so make sure they are the same.


Poster: fredlongworthhighschool
Dated: Thursday August 14 2003 - 8:14:44 BST

Thanks Hergio, I'll give that a try today.


Poster: fredlongworthhighschool
Dated: Thursday August 14 2003 - 13:42:58 BST

It seems to be working ok offline. But, when I uploaded it to the following url:

http://www.flhs.wigan.sch.uk/v5test/

I've found that the menu bar seems to 'grow'. You can see it if you click refresh.

Ignore the colour scheme, I'm writing a new CSS!


Poster: Hergio
Dated: Thursday August 14 2003 - 19:23:12 BST

Thats kinda funny looking, but I am sure you are not laughing. I wonder if it has to do with the resizeme call. Try commenting things out in the resizing things to see if you can narrow it down. Besides that, this iframes thing is starting to stump me. I am running dry on ideas (maybe work is stressing me out alittle too).

But you would save yourself a TON of work and frsutration if you started using ASP pages (if you use IIS) or PHP (if you use linux). Includes are the things to use. You could also try using shtml, which allows you to insert things into pages globally. You should do all this because then you can have the one copy included into all your pages only have to maintain in one spot. Definetly consider it. :)


Poster: fredlongworthhighschool
Dated: Friday August 15 2003 - 8:34:16 BST

It is slightly amusing. If I don't laught at it I'll end up throwing this laptop as far as I can!

I did have a try at juggling some of the settings last night, I'll have a further play.

One good thing is that I have moved the site to a machine running IIS and that showed up the problem. So at least I can work on it without the hassle of uploading.

With this in mind I will give the #INCLUDE method a try again to see if I can get away with not using frames at all.

Thanks again.

Andy

PS........... Fixed it. The reason was down to calling an OVERFILTER in the main menu:

Code:
myfilter = "Alpha(style=0,opacity=80);Shadow(color='#666666', Direction=135, Strength=8)";
overfilter = myfilter;


The problem was the strength variable. Set it higher than 2 and it starts to grow. I thought it controlled the length of the shading.


Poster: Hergio
Dated: Friday August 15 2003 - 19:51:54 BST

Wow thats crazy, nice detective work on that Andy! Never woulda thunk it, good to know for future reference. :lol: