要約すると、私は食べ物の画像と対応するレシピdivを持つスライダーを持っています。レシピdivでは、ドイツ語と英語のテキストを一度に読み込みますが、英語が表示されるように設定されています:なしjqueryどのように言語divを表示/非表示にする?
言語の選択に基づいて適切なdivを表示/非表示するにはどうすればよいですか?
<span id="lang">
<span id="de" class="selectlang">
<img src="imgs/lang_de.jpg" alt="German" />
</span>
|
<span id="en" class="selectlang">
<img src="imgs/lang_en.jpg" alt="English" />
</span>
</span>
と私は
<script type="text/javascript">
$(window).load(function() {
$('#recipes').orbit({
timer: false,
bullets: true,
captions: true,
afterSlideChange: textSlides
});
$('.selectlang').click(function() {
var theId = "." + $(this).attr('id');
alert(theId);
$(theId).toggle().show();
});
});
function textSlides() {
var theId = "#d" + $(this).attr('id');
$(theId).toggle().siblings().hide()
}
</script>
敬具
私は表示/フラグの画像とdivのを非表示にしようとしていない。しかし、ページ上の他のdiv
– alexps:私は – alex