0

ここで私のコード..画像のサムネイルをクリックすると、画像が表示されます..今、画像を変更する必要があります..クリックイベントではなく、このjavascriptを変更してください

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
         $(function() {
            $(".image").click(function() {
            var image = $(this).attr("rel");
            $('#img').hide();
            $('#img').fadeIn('slow');
            $('#img').html('<img src="' + image + '" class="img"/>');
            $('#img').
            return false;
                });
        });
</script>

<style>
.img{
border:4px #666 solid;
width:410px; height:350px;
}

.thumb{
float:left; 
height:60px;
width:80px;
padding:10px;
}
</style>

<div  id="img" ><img src="../content/ohoopee1.jpg" border="0" style="width:410px; height:350px;border:4px #666 solid;" /></div>

                    <a href="#" rel="../content/ohoopee1.jpg" class="image"><img src="../content/ohoopee1.jpg" class="thumb" border="0"/></a>
                    <a href="#" rel="../content/ohoopee2.jpg" class="image"><img src="../content/ohoopee2.jpg" class="thumb" border="0"/></a>
                    <a href="#" rel="../content/ohoopee3.jpg" class="image"><img src="../content/ohoopee3.jpg" class="thumb" border="0"/></a>
                    <a href="#" rel="../content/ohoopee4.jpg" class="image"><img src="../content/ohoopee4.jpg" class="thumb" border="0"/></a>

これを手伝って……

4

1 に答える 1

0

http://jonraasch.com/blog/a-simple-jquery-slideshow

このチュートリアルを実行できます。

于 2012-06-05T09:46:57.100 に答える