我有一个带有博客结构的页面,我将在其中放置多个帖子。我面临的问题是试图让一个阅读更多链接被扩展并折叠其他链接。我尝试了不同的 jquery 方法和多个 html 结构来实现这一点,但未能获得预期的结果。请让我知道如何解决此问题。谢谢你。网址:http: //jsfiddle.net/DSbFc/
<script src="script.js"></script>
<script src="script.responsive.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('.ReadMore').bind('click', function(e)
{
e.preventDefault();
$('.hide').slideToggle(function()
{
$(this).closest('.readmore').find(".hide").toggle();
});
});
});
</script>
<body>
<div id="art-main">
<article class="post">
<table>
<tr>
<td><a href="images/image.png" data-lightbox="width:260;height:280" title="image"><img src="images/image.png" width="260px" height="280px"/></a></td><td>
<br/>
<table>
<tr>
<td>No.</td><td>Description</td><td>Qty.</td>
</tr>
<tr>
<td>1</td><td> content</td><td> 1</td>
</tr>
<tr>
<td>2</td><td> content</td><td> 1</td>
</tr>
<tr>
<td>3</td><td> content</td><td> 1</td>
</tr>
<tr>
<td>4</td><td> content</td><td> 2</td>
</tr>
<tr>
</table>
<div class="ReadMore">
<a href="#" >Read More</a>
</div>
<div class="hide">
<table >
<tr >
<td>6</td><td> content</td><td> 1</td>
</tr>
<tr >
<td>7</td><td> content</td><td> 1</td>
</tr>
<tr >
<td>8</td><td> content</td><td> 1</td>
</tr>
<tr >
<td>9</td><td> content </td>
</tr>
</table>
</div>
<div class="hide">
text
</div></td>
</tr>
</div>
</table>
<br/>
<br/>
<table>
<tr>
<td><a href="images/image2.gif" data-lightbox="width:400;height:400" title="image2"><img src="images/image2.gif" width="260px" height="280px"/></a></td><td><b style="font-size:22px; color:#fff;">title</b>
<br/>
<b style="font-size:22px; color:#fff;">title</b>
<br/>
content
<br/>
<div class="ReadMore">
<a href="#" >Read More</a>
</div>
<div class="hide">
content
<br/>
<br/>
• content
<br/>
• content
<br/>
• content
<br/>
<br/>
</article>
</div> </div>
</div>
</div>
</div>
</body>