Hide/Reveal Comments in Wordpress
I'm trying to hide and show comments on my blog.
I am having problems getting the "reveal" & "close" buttons to change according to the toggle.
the blog is up for my design @ http://www.relativityphoto.com/test/
here's my code:
jquery:
- <script type="text/javascript">
- $(document).ready(function() {
- $('#commentbox').hide();
- $('a.comment').click(function() {
- var id = $(this).attr('id');
- $('#commentbox' + id).toggle(500);
- $(this).toggleClass("active");
- // alert(id);
- return false;
- });
- });
- </script>
CSS:
- a.comment {
- background: url(images/rollover-reveal_post.png) 0px 0px no-repeat;
- width: 173px;
- height: 57px;
- position: relative;
- bottom: -35px;
- right: -500px;
- display: block;
-
- }
-
- a.comment:active {
- background: url(images/rollover-close_post.png) 0 0 no-repeat;
- }
HTML:
- <div id="commentboxa0x4" class="commentbox" style="display:none">
- Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
- <img src="http://www.relativityphoto.com/test/wp-content/themes/stephenburtonmedia/images/test.jpg" width="655" height="480" alt="test" />
- </div>
- <div id="revealPost">
- <a href="#" id="a0x4" class="comment" name="3242">
- </a>
- </div>
I've searched tutorials and I just don't understand why it won't work.
Any thoughts?