I am making a page that is responsive and is pulling content from wordpress. There are 4 photos and in each photo is a button displaying "whats in the bag" and "player history." When you click each button I want it to display the hidden div content below the photo. Right now when I click the button it opens all of the divs instead of the 1 player I want to show. Here is the script I am using
$(document).ready(function(){
$(".slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$(".slidingDiv").slideToggle();
return false;
});
});
$(document).ready(function(){
$(".slidingDiv2").hide();
$(".show_hide2").show();
$('.show_hide2').click(function(){
$(".slidingDiv2").slideToggle();
return false;
});
});
Here is the html
<div class="popup-open">
<div class="title"><?php the_title(); ?></div>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>" class="show_hide popup">WHAT'S IN THE BAG</a><br/>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>" class="show_hide2 popup">PLAYER HISTORY</a>
</div>
</div>
<div class="slidingDiv">
<div id="tabs-1">
<div class="witb-tab">
<?php
$fields = CFS()->get('witb');
if($fields) :
foreach ($fields as $field) : ?>
<div class="row">
<a target="_blank" href="<?php echo $field['cta_link'];?>">
<div class="image">
<img src="<?php echo $field['product_image'];?>" alt="<?php echo $field['product_name'];?>">
<a target="_blank" class="product-name" href="<?php echo $field['cta_link'];?>" title="<?php echo $field['product_name'];?>">
<?php echo $field['product_name'];?>
</a>
</div>
</a>
</div>
<?php endforeach; endif; ?>
</div>
<a href="#" class="show_hide" style="float:right;">CLOSE</a>
</div>
</div>
<div class="slidingDiv2">
<div class="column left">
<!-- post thumbnail -->
<?php
if (has_post_thumbnail()) {
the_post_thumbnail('profile-thumb');
}
// Check if post thumbnail exist
else {
$values = CFS()->get('gender');
if (is_array($values)) {
foreach ($values as $value => $label) {
//echo '<h1 style="color:red">' . $value . '</h1>';
echo '<img src="' . get_bloginfo('template_directory') . '/img/thumb-'. $value . '.png"' . 'alt="thumbnail" />';
}
}
}
?>
<!-- /post thumbnail -->
<div class="player-biography">
<?php echo CFS()->get('player_biography'); ?>
</div>
</div>
<div class="column right">
<div id="tabs-2">
<div class="content-wrap"><?php the_content(); // Dynamic Content ?></div>
</div>
<a href="#" class="show_hide2" style="float:right;">CLOSE</a>
</div>
</div>