PDA

View Full Version : Accordion Menu script (v1.6)



Mustapha
01-31-2009, 09:08 AM
1) Script Title: Accordion Menu script (v1.6) (Glossy accordion menu)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm

3) Describe problem: I can not target a frame in a frameset, the link opens a new window or opens in the same frame as the hitten link.

best regards
Mustapha

jscheuer1
01-31-2009, 01:29 PM
What method have you tried? If using the target attribute, the target attribute must exactly match the name attribute of an existing frame. Otherwise it will open in a new window or in the reserved location for certain targets (those with the underscore prefix, like _top, and _self). Do your frames even have name attributes? If so, the may not use the underscore prefix if their names are one of those reserved.

If you are using some other method, what?

If you want more help:

Please post a link to the page on your site that contains the problematic code so we can check it out.

And - Tell us what we need to do to see the problem.

bad inferno
01-31-2009, 09:43 PM
Hi

I use a frameset and my glossy accrodian menu has the following:

<div class="glossymenu">
<a class="menuitem submenuheader" href="#" >Aquarium Data</a>
<div class="submenu">
<ul>
<li><a href="Aqua_0.html" target="BodyFrame" >2 Day trends</a></li>
</ul>
</div>

Just replace the target with the name you specified for your frame.

Mustapha
02-02-2009, 09:14 AM
Thanks its working,

I had a diffrent framename.

again thanks everybody :)
Mustapha

johnsnackz
09-13-2010, 02:26 PM
Hey,

I don't know if anyone can help, I have posted on this link as it seems to be the most appropriate one that I found through searching the forum.

My first problem is, that I updated to the newest Glossy Accordion Menu including the ddaccordion.js and jquery/1.4.2/jquery.min.js files.

Since doing that, the menu still works fine in firefox, however not in internet explorer. I am not too concerned with this as I will simply revert back to the older versions as I have copies from an old site, but if it can be fixed great. (I will post links further down)

The main problem that I need to resolve is manipulating the content to open in the correct frame.

As I am only just building the site, then a lot of the links are dead, but I will point out the ones that I have done.

The first problem that I encountered was that because I was using frames, the content I was trying to open, was opening in my LeftFrame, which is where the Menu is, and I wanted to open it as a new frameset, I resolved this by adding the code in red:

<div class="glossymenu">
<a class="menuitem" href="http://www.mysite.html">Home</a>
<a class="menuitem submenuheader" href="ddaccordionmenu-glossy.htm?submenuheader=0">Orkney & Shetland</a>
<div class="submenu">
<ul>
<li><a href="http://www.kirkwall.html"target="_top">Kirkwall</a></li>

So now when I expand the Orkney & Shetland menu and select Kirkwall, then this loads in my current window with no problems, in both firefox and ie.

Now I wanted to start manipulating data in the frames, so I have three frames on each page, which I have named "LeftFrame" "CentreFrame" "RightFrame"

So once on the Kirkwall page, I have only changed the top of the menu to "Places to drink" with sub menu's "Pubs & Bars" and "Clubs" The idea is now that if I click either of these then it should appear in the "CentreFrame" however sadly this is not the case. The code that I have used for "Pubs & Clubs" is:

<li><a href="http://www.mysite/pubs.php"target id="CentreFrame">Pubs & Bars</a></li>

Which opens the content in my "LeftFrame" I have also tried changing it to "RightFrame" to see if it made any difference... it didn't.

So the other way that I tried is on the "Clubs" one, which I used the following code:

<li><a href="http://www.mysite/clubs.php"target="CentreFrame">Clubs</a></li>

Which opens in a new window altogether. As the site is going to be mainly changing the frame each time, this is quite a major issue for me.

So if anyone could help I would be grateful, as I love this menu, and I don't really want to use my alternative one.

Thanks in advance.

jscheuer1
09-13-2010, 05:27 PM
You are missing spaces, and using the wrong attribute (id), for example:


<li><a href="http://www.snackz.co.uk/OrkneyAndShetland/Kirkwall/KirkwallPubs.php"target id="CentreFrame">Pubs & Bars</a></li>

should be:


<li><a href="http://www.snackz.co.uk/OrkneyAndShetland/Kirkwall/KirkwallPubs.php" target="CentreFrame">Pubs & Bars</a></li>

For this to work, the name attribute of the center frame must be CentreFrame. Any difference in spelling or upper and lower case letters and it will not work. You cannot use the id attribute, it must be the name attribute.

I see you have:


<frame src="home/HomeMainContent.php" noresize="noresize" id="CentreFrame"/>

It should be:


<frame src="home/HomeMainContent.php" noresize="noresize" name="CentreFrame"/>

In short, the target attribute of the link must be the same as the name attribute of the frame you want the link to open in.

johnsnackz
09-14-2010, 08:26 AM
Thanks, got it working now, for some reason Adobe CS5 set the id=CentreFrame so upon replacing the id= to name= it works a treat, thanks so much, I hope this also helps others. Now just to sort out why it is not being displayed correctly in IE

jscheuer1
09-14-2010, 10:40 AM
Well, it's fine in IE 8. In IE 7 it's got like a double space thing happening. We can apply specific corrections for that. For example, on the KirkwallMainNavigation.php page add the highlighted after the main stylesheet as shown:


. . . rmal 13px "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, sans-serif;
color: black;
text-decoration: none;
padding: 2px 0;
padding-left: 10px;
}

.glossymenu div.submenu ul li a:hover{
background: #DFDCCB;
colorz: white;
}

</style>
<!--[if lt IE 8]>
<style type="text/css">
.glossymenu a.menuitem {
display: inline-block;
width: 210px;
}
</style>
<![endif]-->
</head>

<body>

<div class="glossymenu">
<a class="menuitem" href="htt . . .

johnsnackz
09-14-2010, 11:11 AM
Thank you very much, this solves the problem.

I recently wiped my laptop which is Vista, and as I don't really use IE, then I have not bothered updating it, but I am glad as I saw a problem that I would of otherwise missed, as there are still people using older browsers and such like.

Thanks again.