.ギャラリーを作ろうとしています。addClass を使用して画像を表示し、同じ場所をクリックして、グーグルで検索したこの新しいクラスを削除したいのですが、何時間も正常に機能させようとした後、助けを求めています。ここで逆のオプションの解決策を見つけました(最初に削除して追加します)
コード:
<html>
<script type="text/javascript" src="http://www.s-ola.me/js/jquery.js"></script>
<script type="text/javascript" src="http://www.s-ola.me/js/jquery.nailthumb.1.1.min.js"></script>
<style>
#window {
width: 570px;
height: 455px;
position: relative;
background-color: grey;
padding: 20px;
margin: 0 auto;
top: 50%;
margin-top: -225px;
}
.image {
display: inline-block;
margin: 5px;
}
#wrapper {
width: 568px;
height: 455px;
position: absolute;
}
.close {
display: none;
}
.big_image{
width: 100%;
display: block;
}
</style>
<body>
<div id="window">
<div id="wrapper">
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
<img class="image" src="http://www.livethelesson.com/wp-content/uploads/2012/01/snow.jpg" />
</div>
</div>
<script>
$(document).ready(function(){
$('.image').nailthumb({containerClass:'image',height:100, width:100, fitDirection:'center', proportions:0.5, maxShrink:0.5});
})
$(document).ready(function(){
$('img').click(function(){
$('.image').toggleClass('close');
$('#wrapper').append('<img src="'+this.src+'" class="big_image" />');
})
})
$(document).ready(function(){
$('.big_image').click(function(){
if($('.big_image')) {$('.big_image').remove(); $('.image').toggleClass('close'); }
})
})
</script>
</body>
</html>
どこを間違えたのか教えてください。
再度、感謝します。アレクセイ alexela.biz
更新しました