I have been trying to make it so that when you click the thumbnail image of a post, the content is animated down in a div. If you click another div, the content animates back up and then animates back down with the new content. The content is to be shown in the div theContainer.
Currently it is doing nothing, but I am fairly sure it is close just have made a silly mistake somewhere that I haven't seen.
Live: http://www.mathewhood.com/sitefiles jsFiddle: http://jsfiddle.net/YpHCq/
N.B. <?php the_post_thumbnail(); ?>
- Displays the post thumbnail (defined when creating the post i开发者_开发知识库n WP)
<?php the_title(); ?>
- Displays the title of the post
<?php the_content(); ?>
- Displays the content of the post
This is a very simple thing to do, using the following jQuery as a start:
$(thumb-nail).click(function(){
$('.down').slideUp("fast").removeClass('down');
$(this).parent().find(stuff-to-hide).slideDown("fast").addClass('down');
});
Check my working example here - http://jsfiddle.net/ajthomascouk/byWwk/
Try commenting out the pieces of php that are contained within your jQuery as they look to be whats causing the page to run incorrectly. I would also change the name of the var from $container to something more distinctive.
精彩评论