newbees
10-20-2009, 03:56 PM
1) Script Title: Animated Collapsible DIV v2.4
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
3) Describe problem:
I have home page called index.htm. There is menu made of collapsible divs with submenus with link. To work, I need to put
...
animatedcollapse.addDiv('menu1', 'fade=0,speed=300,group=menu,persist=0,hide=1')
animatedcollapse.ontoggle=function($, divobj, state){}
animatedcollapse.init()
to trigger the js and divs. Everything is working like it should.
That menus have links (ofc) that are on click loading content from external pages via Ajax (jQ), so that only div "content" is changed. Thats fine also and woking.
But one of the external pages (probably will have few of them if I make this work) have also collapsible div in it that are not working untill I put new
animatedcollapse.addDiv('cat1', 'fade=0,speed=300,group=cat,persist=0,hide=1')
animatedcollapse.ontoggle=function($, divobj, state){}
animatedcollapse.init()
in that external file. And animatedcollapse.init() to trigger it. animatedcollapse.js is loaded only once in index head.
Now, and menu and that script is working except that MENU IS TRIGGERED TWICE. So menu does double animation.
As I see it animatedcollapse.init() was triggered in index and menu is working, when external file loads, animatedcollapse.init() is triggered again for divs in that file to work. And with that menu is triggered twice.
If I have 2 external files that are having colapsible divs in them, and I click on link to one, then to second then to first again, then second and 10 times that, I am triggering divs in those external files only once (like it should) but menu is triggered 10 times and is doing 10 times expand/close before 10th time it stays in state like it supposed.
So I need to find a way to init only one group which is existing in external file. Something like
in cat.htm file to init "cat" group of divs:
animatedcollapse.init(cat) or
animatedcollapse.init('cat')
or i saw uninit function in js so I tried
animatedcollapse.uninitinit() (to undo init of the menu,to erase first init)
animatedcollapse.init() (to init menu and cat divs)
and its not working (maybe uninit isnt for that). As you see I have very limited knowledge of js overall and my biggest weapon is deduction unfortunatelly.
I looked at this forum first trying to find something similar but I couldnt find any.
Thank you in advance
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
3) Describe problem:
I have home page called index.htm. There is menu made of collapsible divs with submenus with link. To work, I need to put
...
animatedcollapse.addDiv('menu1', 'fade=0,speed=300,group=menu,persist=0,hide=1')
animatedcollapse.ontoggle=function($, divobj, state){}
animatedcollapse.init()
to trigger the js and divs. Everything is working like it should.
That menus have links (ofc) that are on click loading content from external pages via Ajax (jQ), so that only div "content" is changed. Thats fine also and woking.
But one of the external pages (probably will have few of them if I make this work) have also collapsible div in it that are not working untill I put new
animatedcollapse.addDiv('cat1', 'fade=0,speed=300,group=cat,persist=0,hide=1')
animatedcollapse.ontoggle=function($, divobj, state){}
animatedcollapse.init()
in that external file. And animatedcollapse.init() to trigger it. animatedcollapse.js is loaded only once in index head.
Now, and menu and that script is working except that MENU IS TRIGGERED TWICE. So menu does double animation.
As I see it animatedcollapse.init() was triggered in index and menu is working, when external file loads, animatedcollapse.init() is triggered again for divs in that file to work. And with that menu is triggered twice.
If I have 2 external files that are having colapsible divs in them, and I click on link to one, then to second then to first again, then second and 10 times that, I am triggering divs in those external files only once (like it should) but menu is triggered 10 times and is doing 10 times expand/close before 10th time it stays in state like it supposed.
So I need to find a way to init only one group which is existing in external file. Something like
in cat.htm file to init "cat" group of divs:
animatedcollapse.init(cat) or
animatedcollapse.init('cat')
or i saw uninit function in js so I tried
animatedcollapse.uninitinit() (to undo init of the menu,to erase first init)
animatedcollapse.init() (to init menu and cat divs)
and its not working (maybe uninit isnt for that). As you see I have very limited knowledge of js overall and my biggest weapon is deduction unfortunatelly.
I looked at this forum first trying to find something similar but I couldnt find any.
Thank you in advance