jquery toggle
-
Hi,
I am trying to create a collapsable overview of authors.
This is my jQuery:<script type="text/javascript"> jQuery(document).ready(function(){ //hide all jQuery('.slidingDiv',this).hide(); jQuery(".show_hide").click(function(){ jQuery(".slidingDiv").slideToggle("slow"); jQuery(this).toggleClass("active"); return false; }); }); </script>
Here is my template markup. What happens is that all the authors toggles at the same time, instead of individually. Therefor I am let to believe that it is in fact the markup of the template and not the jQuery that is the problem. I just can’t find the error. So a pair of fresh eyes would be nice ??
<?php /* Template Name: Medlemmer */ ?> <?php get_header(); ?> <div id="content"> <div id="inner-content" class="wrap clearfix"> <div id="main" class="eightcol first clearfix" role="main"> <?php $blogusers = get_users('blog_id=1&orderby=nicename&role=subscriber'); foreach ($blogusers as $curauth) { ?> <div class="userProfile"> <header class="profile"> <div class="info"> <h1 class="title"><?php echo $curauth->lydsystem; ?></h1> <a href="<?php echo $curauth->facebook; ?>"><?php echo $curauth->facebook; ?></a> </div> <div class="avatar"><?php echo get_wp_user_avatar($curauth->ID, 100); ?></div> <div class="show_hide">Vis Profil</div> </header> <div class="slidingDiv"> <p> <b>Beskrivelse: </b><?php echo $curauth->description; ?> </p> <p> <b>Specs: </b><?php echo $curauth->specs; ?> </p> <?php $upload_dir = wp_upload_dir();?> <p> <b><a href="<?php echo $curauth->pdf; ?>">Download PDF</a></b> </p> <p> <b>Galleri: </b> </p> <?php echo do_shortcode('[wppa type="album" album="#owner,'.$curauth->user_login.'"][/wppa]'); ?> </br> </div> <hr/> </br> </div> <?php } ?> </div> <?php get_sidebar(); ?> </div> </div> <?php get_footer(); ?>
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘jquery toggle’ is closed to new replies.