PDA

View Full Version : javascript menu not appearing in IFrame



CarbonTerry
07-06-2008, 02:22 AM
That pretty much says it all. I have a js menu that is published on a page all by itself. I have an IFrame on another page calling for the JS menu. Everything is published. I added a shape where the js menu is positioned and the shape was visible but no menu.

Karen Mac
07-08-2008, 08:47 PM
Terry..

ahem... can you give us a link to the page? your script might be running UNDER the shape.

Karen

CarbonTerry
07-08-2008, 10:45 PM
LOL, I know, how many times have we asked for an URL !!! I put the shape in to make sure that the IFrame was positioned correctly. When I previewed the shape was there. Removed the IFrame the menu was not there. I have not published yet but will do so and provide an URL.
Thanks

CarbonTerry
07-08-2008, 11:04 PM
Well, live and learn ! The 2nd js menu appears after publishing the main page (http://masterpac.com/2blisters.html). The "shortmenu" page was already published. The only reason I put it into a frame was because it created a conflict with the long horizontal js menu.
This is a redesign and nothing is finished and/or final design.

CarbonTerry
07-08-2008, 11:16 PM
Whoa !! It was there ! Nowhere to be seen now.

Karen Mac
07-09-2008, 12:45 AM
None of the menus there look like js on any of the pages i clicked around on. I did see an image holder or something tho.. didnt look at the source to see if it was under it.

In your js menuscripts.. use the full path to the url instead of the relative one. Seems I had to do that before when i used one of them for somebody somewhere.

<edit... i see you have done that but youve combined using both http:// and http://www try to use the same.. also in the urls to the images you might have to change those too..and I see the codes.. im just wondering if its UNDER that shape somehow..if you have to add a layer and move it top...

Karen

Karen Mac
07-09-2008, 12:57 AM
Looks like youre missing the src statement the beginning of your code too


<script type='text/javascript'>

Im thinking you need this


<script type='text/javascript' src='whateverjsmenu.js">

Karen

CarbonTerry
07-09-2008, 01:43 AM
That is the background color of the js page where the empty IFrame is.
Right click and you'll see the code. The main navbar is a js menu also.
I'll swear....the menu appeared for a while and then ..........nothing.
This menu comes from a js generator and all of the code is complete. I am not calling for a script but actually have it inserted in the page code.
If you click on my other BV websites (http://www.zone5pix.com/Web-Design/) in my siggy most of thoise sites use the same js generator.

Bethers
07-09-2008, 02:46 AM
OK, I just went through the view source and only see one instance of a js menu in the source code for that page. But wow, that is one heavy script - is 90% of your view source LOL

That said, I don't find a 2nd js menu on that page. Is it on the inline frame page???? Cuz I show the call up for an inline frame. So, if on that page, the question is did you do it properly to call it up - and as you and Karen have been discussing, is it on top of the shape.

CarbonTerry
07-09-2008, 02:54 AM
There is no shape there anymore. That is the page background color. Right click on the empty IFrame and you will see the script.
The called for page www.masterpac.com/shortmenu.html (http://www.masterpac.com/shortmenu.html) views fine. It just does not appear in the IFrame.

Bethers
07-09-2008, 03:01 AM
Here's your problem:

<iframe name="short menu

That's the name of the iframe being called up - but the actual name of it is
shortmenu

Karen Mac
07-09-2008, 03:59 AM
Ok ... I see this right smack dab in between Menu5= New array and Menu6= new array..and it dont belong


Menu5_1=new Array("Clamshells","http://masterpac.com/clamshell.html","",0,20,115);
Menu5_2=new Array("Mock Clamshells","http://masterpac.com/mock-clamshell.html","",0,20,0);
Menu5_3=new Array("Blisters","http://masterpac.com/blisters.html","",0,20,80);
Menu5_4=new Array("Trays & Inserts","http://","",0,20,80); (http://","",0,20,80);)


Now according to your post this is your short menu.. so yes its there but its clear up under your header and nav bar. you must have duplicated it somehow? Also Beth is Correct.. You have called "short menu" When it is 'shortmenu' so thats why it doesnt appear and theres a blank space there.

Karen

CarbonTerry
07-09-2008, 04:04 AM
I tried it as shortmenu (http://masterpac.com/2blisters.html) with no change in results

CarbonTerry
07-09-2008, 04:09 AM
www.masterpac.com/shortmenu.html (http://www.masterpac.com/shortmenu.html) is the page being called for. It's not calling for a js per se. It's calling for a page that has a js menu.

There is a main js menu right below the logo and "The Clear Choice..et al"
I'll reconfigure the page as I may have made a mistake after making a lot of changes to see if I could fix the problem. ;})

Karen Mac
07-09-2008, 04:11 AM
ok.. i see you have it twice.. or are trying to have it twice? and the codes and arrays are the same. I bet its overwriting each other. Try calling for the js instead and see if it works

Karen

CarbonTerry
07-09-2008, 04:13 AM
I changed the name to shortmenu to no avail and reconfigured the js menus. Same result.

Karen Mac
07-09-2008, 04:15 AM
ok.. but upload your shortmenu in a text file from note pad and save it as shortmenu.js

Now in your iframe call for the shortmenu.js instead of the html page

Karen

CarbonTerry
07-09-2008, 04:17 AM
I tried calling for the second js instead of the page and had a conflict. Yes, the 2 menus have the same (almost) links/headings. That is why I chose an IFrame to call for another page (www.masterpac.com/shortmenu.html (http://www.masterpac.com/shortmenu.html)) instead of another script.

Bethers
07-09-2008, 04:20 AM
OK, I started following the steps from the tutorial Naval did long ago on menubars in iframes but I'm tired LOL - so I suggest you go through it step-by-step and see if there's anything there that will fix the problem:
http://www.vodahost.com/vodatalk/bluevoda-tips-tricks-shortcuts/4528-menubar-i-frame.html

Good luck and good night :)

navaldesign
07-09-2008, 06:17 AM
Hi Terry,

I can see the text in the iframe, if i scroll horizontally, though i can't see the menu itself as the iframe will only allow me to scroll horizontally but not vertically.

Remove the text, so only the menu appears.

Move the short menu on the top left corner.

Re-publish the shortmenu.html

then we can take it from there

CarbonTerry
07-09-2008, 07:13 AM
The text was directly over the menu (I removed it). I think that I solved it by changing the target to "TOP" although I had to search for it in the script I think that I got it. However, I have to manually place the menu in the exact place rather than the upper left on the page.

www.masterpac.com/shortmenu.html (http://www.masterpac.com/shortmenu.html)
www.masterpac.com/2blisters.html (http://www.masterpac.com/2blisters.html)

Thanks George.

CarbonTerry
07-09-2008, 07:18 AM
OK G.,
I republished the shortmenu in the upper left corner and put scroll bars on the IFrame

navaldesign
07-09-2008, 07:57 AM
Hi terry,

Your Javascript absolute coordinates overide the frame boundaries.

To solve your problem, go in the shortmenu page code. Edit these two lines:

var StartTop=320; // Menu offset x coordinate
var StartLeft=355; // Menu offset y coordinate

because your frame is positioned at 320 from top and 355 from left.

Take off the frame border, and you are done.

See it live in http://www.dbtechnosystems.com/Tips/Tips/2blisters.html

CarbonTerry
07-09-2008, 08:07 AM
Thanks George,
Initially, I couldn't see
the menu at all. I had to change 2 lines of code
(var SecLineFrame='top';// Frame where sub levels appear
var DocTargetFrame='top';// Frame where target documents appear)
to "top" instead of "space" as they are originally generated.
Thanks for your help.

Bethers
07-09-2008, 03:06 PM
Glad to see in my sleeping hours it got corrected. :)

I'm thinking you don't even need it in an iframe with some of the changes, but now that it's working, why play more?

Just more proof of why we need a network here!

CarbonTerry
07-09-2008, 04:15 PM
Bethers,
I can have only one script on the page without a conflict. However, I have not tried calling for the second script.
Thanks for your time.

CarbonTerry
07-12-2008, 04:03 AM
George,
Would the php method work better here? I was worried about the pages already being indexed and was concerned about losing ground in page results. Not to bother though as I am having an extremely difficult time moving this site up in search results. There is another site that uses content that is very similar. www.clamshellpackaging.net (http://www.clamshellpackaging.net)
This a web page from a webdesigner that would not finish the site but keeps the index page going because of a good search results and there is a link that clicks through to his design service.

navaldesign
07-12-2008, 05:44 AM
Hi Terry,

I can't see why two menus in the same page would conflict, for any reason.
I will test and come back to you.