Ell20 Posted April 6, 2008 Share Posted April 6, 2008 Hi, I am attempting to use the collaspsable div made by dynamic drive. However I am using it within a while loop. The problem with this is no matter which of the links to show/hide the div it always collaspes the last item in the while statement. Code: <a href="javascript:collapse2.slideit()">Show/Hide Biography</a> <div id="cat" style="width: 300px;"> <!--Your DIV content as follows. Note to add CSS padding or margins, do it inside a DIV within the Collapsible DIV --> <div> <b>Biography</b> <?=$biography?> </div> </div> <script type="text/javascript"> //Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] ) var collapse2=new animatedcollapse("cat", 800, true) </script> Thanks for your help Link to comment https://forums.phpfreaks.com/topic/99823-annoying-please-help/ Share on other sites More sharing options...
papaface Posted April 6, 2008 Share Posted April 6, 2008 Isn't it because each div has to have a different id? Link to comment https://forums.phpfreaks.com/topic/99823-annoying-please-help/#findComment-510538 Share on other sites More sharing options...
Ell20 Posted April 6, 2008 Author Share Posted April 6, 2008 I tried giving the div the name of the $userid but that didnt seem to work either Cheers Link to comment https://forums.phpfreaks.com/topic/99823-annoying-please-help/#findComment-510539 Share on other sites More sharing options...
poleposters Posted April 7, 2008 Share Posted April 7, 2008 Are you sure you have the right number of divs? Try adding a </div> after the while loop. Link to comment https://forums.phpfreaks.com/topic/99823-annoying-please-help/#findComment-511398 Share on other sites More sharing options...
cooldude832 Posted April 7, 2008 Share Posted April 7, 2008 since we're in a php help board could u point me to your php problems so I could help you? Link to comment https://forums.phpfreaks.com/topic/99823-annoying-please-help/#findComment-511401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.