1) Script Title: DD Drop Down Panel
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...pdownpanel.htm
Right i have been trying to get help for this in a few places but so far no one seems to want to help. I'm trying to use this in a dynamic context within wordpress. what i want to do is get the "Panel", "content" and "tab" id's to automatically generate based on a php variable. In this case it is
I have tried a number of variations but to no effect. I have renamed dropdownpanel.js as dropdownpanel.php.Code:. $category->category_nicename.
I'm pretty sure it can be done but I'm just not sure exactly how to get the JS and PHP to interact.
Additional information if it helps.Code:var defaultpanel=new ddpanel({ ids: ["panel", "content", "tab"], // id of main panel DIV, content DIV, and tab DIV stateconfig: {initial: "0px", persiststate: true}, // initial: initial reveal amount in pixels (ie: 5px) animate: {enabled: true, steps: 5}, //steps: number of animation steps. Int between 1-20. Smaller=faster. pointerimage: {enabled: true, src: ["arrow-down.gif", "arrow-up.gif"]}, closepanelonclick: {enabled: true} // close panel when links or elements with CSS class="closepanel" within container is clicked on? })
The code that generates the panel, content and tab is:
Code:<div id="panelnav"> <?php $args=array( 'orderby' => 'id', 'order' => 'DESC' ); $categories=get_categories('child_of=54'); foreach ($categories as $category) { echo '<div id="'. $category->category_nicename.'tab" class="ddpaneltab left col_3"> <a href="#"><h3>' . $category->category_nicename. '</h3></a></div>';} ?> </div> <div class="clear"></div> <?php $args=array( 'orderby' => 'id', 'order' => 'DESC' ); $categories=get_categories('child_of=54'); foreach ($categories as $category) { echo '<div id="'. $category->category_nicename.'panel" class="ddpanel"> <div id="'. $category->category_nicename.'content" class="ddpanelcontent">'; $query = new WP_Query( 'cat='.$category->cat_ID ); while ( $query->have_posts() ) : $query->the_post(); echo '<li>'; the_title(); echo '</li>'; endwhile; echo '</div> </div>'; wp_reset_postdata(); } ?>



Reply With Quote

Bookmarks