PDA

View Full Version : Accordion ddaccordion Help



yuchien
03-03-2008, 05:14 AM
1) Script Title: Accordion Menu Script

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

3) Describe problem:

When the menu takes me to a new page, the menu is supposed to stay expanded due to the cookie function, but when the new page is loading, the menu collapsed first then expands...is that what it is supposed to do? is it possible to avoid seeing it collapse? I hope I am being clear... I would just like to see that when click on a menu item, when the new page is loading, the menu is already displaying the expanded state.

also, when i click back to home page, is it possible to have the menu go back to its original state?? if the accorion menu is not supposed to do what i need, can someone point me to another menu i can use to do what i need please?!!!

can someone help please?!!!

thanks.

ddadmin
03-04-2008, 05:11 AM
Hmm this is normal behavior (all headers are initially hidden before the script determines which ones should be open), though unless your page is very long, the entire process should occur so fast it's barely noticeable...

yuchien
03-04-2008, 06:12 AM
Thank you for your responce!!!

what about, when I hit back, and even hitting the homepage button, that the menu should go back to its original state, collapsed, not expanded.

can this be done?!

ddadmin
03-04-2008, 10:44 AM
Thank you for your responce!!!

what about, when I hit back, and even hitting the homepage button, that the menu should go back to its original state, collapsed, not expanded.

can this be done?!

Not sure I understand what you're trying to do here. Are you asking how to set up the menu so it's fully collapsed when the page first loads? This can be done inside the settings:


defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content

yuchien
03-04-2008, 09:03 PM
no, sorry...English is not my first language..let me try it again here.

What I would like it to do is this: after I have visited the page under a subheader, I want to go back a page, or even back to the homepage. The menu then still appears to be expanded (i understand this to be the effect of the cookies). however, is there a way to only apply the cookies when going to sub menus?

if not, is there a different approach i have to take to achieve that effect?

yuchien
03-05-2008, 06:59 PM
anyone? please...

ddadmin
03-06-2008, 07:27 AM
I think I understand. Try the below ddaccordion.js file, which now sees if it should persist the menu states only when the sub content DIV is clicked on (ie: a link within it). By default this was done whenever the page unloads.

yuchien
03-07-2008, 02:52 AM
However, by doing it this way, the help that you provided me before regarding opening an url when clicking on the header does not work anymore. what you told me to do was to // return false in the js file.

so what should I do to keep the capabilty of opening a new page by clicking on the header and at the same time persis the menu states only when the sub content DIV is clicked on....

I hope i am clear...thanks alot!

this is the link to what i am working on
http://www.theglobalinkgroup.com/index1.html

currently only the header "about us" and its content is working with content. So what I need is for clicking on about us and it takes the visitors to an about us page and expanding the menu at the same time. but when I click back, it should not persist the menu in an expanded mode.

ddadmin
03-07-2008, 07:42 AM
Hmm I don't see why commenting out "return false" would stop working in terms of allowing the header to now be linkable in the new ddaccordion.js file I provided above. Nothing has changed to affect that part of the script. Are you saying doing this no longer works for you?


else{
ddaccordion.collapseit($(this), $subcontent, config)
}
//return false
})

yuchien
03-07-2008, 08:18 AM
yes...its weird...after i commenting out //return false with the new file you provided above. the menu does not expand anymore. as well as it still persist to show the expanded menu....

http://www.theglobalinkgroup.com/index1.html click on about us...you will see what i mean

ddadmin
03-07-2008, 08:37 AM
Ok, this is what I see. When I click on a header, since it's now hyperlinked, the page changes. The sub menus do expand, but since the browser is navigating to another page, they don't even have time to expand yet before the page is unloaded. Regarding persistence, since the modified ddaccordion menu only persists expanded sub menus when the user clicks on a link within an expanded sub menu (instead of just clicking on a header to expand it), what you get is the result you're seeing.

I think fundamentally there is a conflict between what you're trying to do with the header (hyperlink them) and what you're trying to do with how the persistence should work (only when expanded sub menu links are clicked on).

yuchien
03-07-2008, 06:32 PM
is there a way to resolve the conflict?

ddadmin
03-08-2008, 09:28 AM
Well, I mean conflict in your logic. For example, if clicking on the header by itself navigates to a page, when will its sub menus ever have the chance to expand and persist, since persistence is now based on the user having clicked on links within the sub menu?

jgjh151
05-21-2008, 07:15 PM
Link to example page: http://otb.logical.net/index.php?option=com_content&view=article&id=54&Itemid=58

I have the onclick="ddaccordion.toggleone('mypets', 5); return false" in the area tags of the image map to open and close the divs under the image.

In FF, it works as expected. In IE 7, it does nothing and all divs are expanded. Also in IE7, the divs act as if they have links, they show hand cursor.

Besides the above, do u know how I can scroll down to the selected div after clicking on the image map?

Ricendithas
05-27-2008, 12:30 AM
Hello there, I would like to ask if it is possible that there will be no collapsed header? I mean, it will only allow one header to be expanded at a time but will not allow all the headers to be collapsed that there will be one header that will remain expanded. I hope you understand me. Thanks.

:)

Ricendithas
05-30-2008, 01:23 AM
Link to example page: http://otb.logical.net/index.php?option=com_content&view=article&id=54&Itemid=58

I have the onclick="ddaccordion.toggleone('mypets', 5); return false" in the area tags of the image map to open and close the divs under the image.

In FF, it works as expected. In IE 7, it does nothing and all divs are expanded. Also in IE7, the divs act as if they have links, they show hand cursor.

Besides the above, do u know how I can scroll down to the selected div after clicking on the image map?

Hmm, I have an idea, why not use bookmarks? I mean, in the Area tag, insert target="#targetdiv" and add bookmarks inside the headers below. :confused:

ddadmin
05-30-2008, 07:33 AM
Hello there, I would like to ask if it is possible that there will be no collapsed header? I mean, it will only allow one header to be expanded at a time but will not allow all the headers to be collapsed that there will be one header that will remain expanded. I hope you understand me. Thanks.

:)

Please start your own thread when asking a question. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format.

Almeida
03-29-2012, 11:07 PM
Good evening everyone, sorry for my english not mastered this language, in relation to an application Accordion ddaccordion is excellent if not for the bug in (ddaccordion.js) it prevents the generation of cookie, my difficulty is to generate a Cokie where it remembers the password of the User, facilitating his entry to the site, and as I said up there it does not allow the generation of a second cookie, I use (print_r ($ _COOKIE);) to view the cookies generated on the page and only the cookie menu is shown (cookies: Array ([PHPSESSID] => ct0jm3d9h1f9pusrevvdfcr900)), if someone has a solution will be grateful, thank you and I look forward to!