我有一个两种语言的博客。单击 FlagA.png 或 FlagB.png 时,我想在语言 A 和 B 之间切换。每个帖子至少包含两个标志图像。如何使用(引导)Jquery 做到这一点?(上下文,我没有数据库,为了方便多语言我想使用切换功能)
<div class="post">
<div class="post-content">
<div class="post-title"><a href="#"><b>title</b</a> </div>
<a href="" class="languageA">
<img src="img/countryA.png" alt=""
style="float: right;" /></a>
<a href="" class="languageB">
<img src="img/countryB.png" alt="" style="float: right;
padding-right: 10px;" /></a>
</br>
<div class="post-description">
<p>
post in language A
</p>
</div>
<div class="post-description">
<p>
post in language B but now it is invisible, when pressed countryB image this becomes visible and post in language A not.
</p>
</div>
<p class="test"> test test test test test test test test test test test test</p>
</div>
<div class="post">
<!-- second post\-->
</div>
<!-- -->
<script type="text/jscript">
$(function() {
$('.languageA').click(function () {
$('.test').collapse({
toggle: true
})
});
});
});
</script>